SRL Archive - Help

Question about a function.


Element17

2012-05-03 20:39:03

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

2012-05-03 20:44:33

You would need to pass

CheckToolBeltFor('Fishing', 'Harpoon');
as both parameters are strings.

Element17

2012-05-03 21:42:18

Sweet thanks!