SRL Archive - Help

Eating function..


Imagine

2012-04-28 09:20:45

function Eating:Boolean;
var
x,y,Shark:Integer;
begin
Shark := DTMFromString('mggAAAHicY2NgYChnYmDIBeJ6IG4F4jogLgViH0YGhhAgjgTiaCD2BWI3IA6y02Xg5eFhiHUzZnA0VGHoK45jyAx1Y+AHmoUNM+LAEAAARuYJ7A==');
if HPPercent < 25 then
while HPPercent < 75 do
begin
writeln('Need to eat');
GameTab(25);
if FindDTM(Shark, x, y,MIX1,MIY2,MIX2,MIY2) then
begin
writeln('Found Shark');
Mouse(x,y,3,3,True);
Result := True;
end
else begin
LogOut;
TerminateScript
end;
end;
FreeDTM(Shark);
end;

For some reason, this never eats. The DTM has enough matches when I use it on the DTM editor, so I'm really puzzled.

Gucci

2012-04-28 09:31:17

Do the lines "Need to eat" and "Found shark" come in debug?

Total

2012-04-28 09:32:46


FindDTM(Shark, x, y,MIX1,MIY1,MIX2,MIY2)

You have it wrong in your procedure, you have Y2 as your Y1.

Joe

2012-04-28 09:46:20

 GameTab(25);
whats this? the proper gametab clicker would be
(GameTab_Inv or GameTab_Magic);

Imagine

2012-04-28 09:52:28

From: TotalKillz

FindDTM(Shark, x, y,MIX1,MIY1,MIX2,MIY2)

You have it wrong in your procedure, you have Y2 as your Y1.


Ohhh, stupid typos :/

From: JOEbot
 GameTab(25);
whats this? the proper gametab clicker would be
(GameTab_Inv or GameTab_Magic);


GameTab(25); is equivalent to Gametab(Tab_Inv);

Constants are better though I guess…

Joe

2012-04-28 11:07:28

From: Imagine

GameTab(25); is equivalent to Gametab(Tab_Inv);

Constants are better though I guess…


Whatever floats your boat… It might be easier to read with Inv instead of 25 though

putonajonny

2012-04-28 11:10:01

From: JOEbot
Whatever floats your boat… It might be easier to read with Inv instead of 25 though


Also if there is an update that needs to change the numbers, your script will break if you haven't used constants