Log in

View Full Version : Question about a function.



Element17
05-04-2012, 12:39 AM
function CheckToolBeltFor(Category, Tool : string) : Boolean;
var
I, catCount : Integer;
begin
if(not(toolBeltScreen()))then
openToolBelt();
setCategory(Category);

case(LowerCase(Category))of
'general', 'crafting' : catCount := 13;
'fishing' : catCount := 8;
'farming' : catCount := 5;
end;

for I := 1 to catCount do
begin
if(not(FindTextTpa(1158880, 9, 167, 146, 352, 161, Tool, SmallChars, Nothing)))then
begin
Mouse((375 + 397) / 2, (147 + 163) / 2, 1, 1, True);
Wait(RandomRange(250, 750))
end else
Break;
end;

Result := itemSlotFilled;

Wait(RandomRange(250, 750));
MouseBox(479, 20, 491, 29, mouse_Left);
end;


If I put CheckToolBeltFor(Fishing, 'Harpoon'); will that check for a harpoon in the tool belt?

euphemism
05-04-2012, 12:44 AM
You would need to pass

CheckToolBeltFor('Fishing', 'Harpoon');

as both parameters are strings.

Element17
05-04-2012, 01:42 AM
Sweet thanks!