
Originally Posted by
Farts
Dont think the Boolean works with the math in the Mousebox
Can FindDTM be an Integer? (like gives coordinates x, y of where it is found?)
lol nvm think i got it xD
Code:
Procedure Click;
Var
Bx, By, PDTM :Integer;
begin
PDTM := DTMFromString('78DA639CC6C4C0F088010D30814946288FB11' +
'3C87F4840CD5420FF3601358B80FC2704D44C06F2DF12503317C8' +
'BF4F40CD0420FF297E3500B6C20A74');
FindDTM(BoneDTM, Bx, By, MIX1, MIY1, MIX2, MIY2);
MouseBox((Bx - 15), (By - 7), (Bx + 17), (By + 17), 1)
FreeDTM(PDTM);
end;
I think lol
thanks for Brainstorming with me =]
I'm a little rusty.. But shouldn't that be..something like this?
SCAR Code:
Function Click: Boolean;
Var
Bx, By, PDTM: Integer;
begin
PDTM := DTMFromString('78DA639CC6C4C0F088010D30814946288FB11' +
'3C87F4840CD5420FF3601358B80FC2704D44C06F2DF12503317C8' +
'BF4F40CD0420FF297E3500B6C20A74'); //Load the DTM
Result := FindDTM(PDTM, Bx, By, MIX1, MIY1, MIX2, MIY2); //Attempt to find the DTM, return True if found, False if not.
if (Result) then //Checks the Result variable (if it is true)
//Also, I changed BoneDTM to PDTM, because I'm guessing that you mistyped that, plus I see no reason in declaring that DTM unless that's the one your searching for.
MouseBox((Bx - 15), (By - 7), (Bx + 17), (By + 17), 1) //if its true, MouseBox
else begin //Else (if its false)
FreeDTM(PDTM); //Free the DTM
Exit; //Exit Function
end;
FreeDTM(PDTM); //Free DTM if the statement was true.
end;
Because what happens if the finding of that DTM fails? I'm sure that would cause some kind of Runtime error, or just click a random spot and change tabs / move. Also, by changing that procedure to a function, you can use that function to detect if your out of bones, no?
-- that Result doesn't have to be called as Result: Boolean;, because in a function the Result variable modifies what the function returns.
SCAR Code:
if (not Click) then
if (not Click) then
Exit; //Exit the bury procedure and go to the banking? Instead of calling a check after every bone (if that is what you're doing).
EDIT: mixster kinda beat me too it.