Log in

View Full Version : Eating function..



Imagine
04-28-2012, 01:20 PM
function Eating:Boolean;
var
x,y,Shark:Integer;
begin
Shark := DTMFromString('mggAAAHicY2NgYChnYmDIBeJ6IG4F4jogLg ViH0YGhhAgjgTiaCD2BWI3IA6y02Xg5eFhiHUzZnA0VGHoK45j yAx1Y+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
04-28-2012, 01:31 PM
Do the lines "Need to eat" and "Found shark" come in debug?

Total
04-28-2012, 01:32 PM
FindDTM(Shark, x, y,MIX1,MIY1,MIX2,MIY2)


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

Joe
04-28-2012, 01:46 PM
GameTab(25);
whats this? the proper gametab clicker would be
(GameTab_Inv or GameTab_Magic);

Imagine
04-28-2012, 01:52 PM
FindDTM(Shark, x, y,MIX1,MIY1,MIX2,MIY2)


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

Ohhh, stupid typos :/


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
04-28-2012, 03:07 PM
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
04-28-2012, 03:10 PM
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