ForMyFutures
2013-02-04 19:42:01
Okay so I'm trying to use cases so when a number between 1 and 4 is generated the script will click on a designated box, however, I think either my parameters are wrong, or I perhaps don't understand it?
Anyways, here's the code:
Also, it's basically to click the clean button once the interface has popped up to clean a herb. Help is much appreciated! Cheers.
Anyways, here's the code:
procedure CleanHerbs;
var
ItemBox, CleanBox1, CleanBox2, CleanBox3, CleanBox4: TBox;
begin
CleanBox1.X2:= 264;
CleanBox1.Y2:= 322;
CleanBox1.X1:= 298;
CleanBox1.Y1:= 305;
CleanBox2.X2:= 321;
CleanBox2.Y2:= 323;
CleanBox2.X1:= 350;
CleanBox2.Y1:= 310;
CleanBox3.X2:= 368;
CleanBox3.Y2:= 320;
CleanBox3.X1:= 400;
CleanBox3.Y1:= 310;
CleanBox4.X2:= 440;
CleanBox4.Y2:= 320;
CleanBox4.X1:= 460;
CleanBox4.Y1:= 304;
if not (GameTab(Tab_Inv)) then
FTab(Tab_Inv) else
begin
Wait(RandomRange(300, 600));
case Random(4) of
1: GetInvItemBounds(7, ItemBox);
2: GetInvItemBounds(5, ItemBox);
3: GetInvItemBounds(3, ItemBox);
4: GetInvItemBounds(4, ItemBox);
end;
MouseTbox(ItemBox, Mouse_left);
Wait(RandomRange(750, 800));
case Random(4) of
1: MouseTBox(CleanBox1, Mouse_left);
2: MouseTBox(CleanBox2, Mouse_left);
3: MouseTBox(CleanBox3, Mouse_left);
4: MouseTBox(CleanBox4, Mouse_left);
end;
end;
end;
Also, it's basically to click the clean button once the interface has popped up to clean a herb. Help is much appreciated! Cheers.