SRL Archive - SRL Bugs

HPPercent


Camaro'

2010-03-11 17:26:16

Works often. just randomly didn't work, I'm running a bandits afker which relies on HPPercent. It worked for like 20min , then HPPercent stopped working, and the script just ate all my fish. >.> :D

It may of been a scar bug, but I just wanted to put it out there.

i luffs yeww

2010-03-11 17:30:11

Colors/font could have very possibly changed. ;)

Camaro'

2010-03-11 17:31:02

From: i luffs yeww
Colors/font could have very possibly changed. ;)


So if the fonts/colors change during runtime, HPPercent wont work?

i luffs yeww

2010-03-11 17:33:23

What? Haha no I meant like.. from the last login update. The font/colors they use for HP could have changed, so it doesn't work at all percents. Unless it worked at one point then it didn't at that same point later.. But uhh.. What about it just getting stuck in an infinite loop somehow (in your script)? Could that be a possibility?

Or if it's neither, then it might be that the OCR is wrong for that for whatever reason. If that's the case, then I dunno right now. At work. :<

Camaro'

2010-03-11 17:41:16

From: i luffs yeww
What? Haha no I meant like.. from the last login update. The font/colors they use for HP could have changed, so it doesn't work at all percents. Unless it worked at one point then it didn't at that same point later.. But uhh.. What about it just getting stuck in an infinite loop somehow (in your script)? Could that be a possibility?

Or if it's neither, then it might be that the OCR is wrong for that for whatever reason. If that's the case, then I dunno right now. At work. :<


It failed again, it started eating all my fish at 100 % HP


program new;
{.include srl/srl.scar}

Procedure DeclarePlayers;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;

Players[0].Name :='i i';
Players[0].Pass :='';
Players[0].Nick :='eeee';
Players[0].Active := True;
end;

Procedure afk;
Begin
// cleardebug;
case random(88) of
0: begin
KeyDown(VK_RIGHT);
Wait(Random(1000));
KeyUp(VK_Right);
end;
1: begin
KeyDown(VK_UP);
Wait(Random(1000));
KeyUp(VK_UP);
end;
2..5: begin
mmouse(random(500),random(500), 0,0);
end;
6: begin
KeyDown(VK_LEFT);
Wait(Random(1000));
KeyUp(VK_LEFT);
end;
7: begin
KeyDown(VK_DOWN);
Wait(random(1000));
KeyUp(VK_DOWN);
end;
8..88: Wait(random(1000));
end;
findnormalrandoms;
userewardbox;

end;

procedure letseat;
var i,x,y:integer;
begin
cleardebug;
for i := 5 to 28 do
begin
if ExistsItem(i) then
begin
mMouseItem(i);
wait(60+random(60));
if isuptext('at') then
begin
getmousepos(x,y);
mouse(x,y,0,0,true);

writeln('ate');
wait(1500+random(1500));
end;
if (hppercent > (65 + random(3))) then exit;
end;
end;
if hpPercent < 50 then
begin
writeln('uh oh ');
alert('HELPZ0r');
end;
end;




begin
setupsrl;
declareplayers;
gametab(tab_inv);

repeat
afk;
if HpPercent < ( 60 - random(5)) then
letseat;
wait(400+random(400));
writeln('t r = '+timerunning+'');
until false;
end.

end.

That script works fine, until a random moment in time BOOM, Lets eat all of camaro's fish. :p

Wanted

2010-03-11 17:43:50

Maybe it's missing one of the numbers for example maybe it always misses the number 5 ect… the bitmap for one the chars might of changed, if not debug it and check if it's returning 0… if that's the case then simply do if (Whatever < 1) then Ignore…

i luffs yeww

2010-03-11 17:48:54

That's kind of what I meant, IceFire. :p But thanks for explaining. :3

Oh wait.. :o HPPercent checks the thing in the top right, right? Now that it's 100-990, could that have any effect on it? Since some of the numbers may just be unreadable, it'd just mistake the whole thing for a very small number. But that doesn't really solve the nonstop eating.. :/ If anything, it should stop at 100% health, I think.

Camaro'

2010-03-11 18:09:25

From: i luffs yeww
That's kind of what I meant, IceFire. :p But thanks for explaining. :3

Oh wait.. :o HPPercent checks the thing in the top right, right? Now that it's 100-990, could that have any effect on it? Since some of the numbers may just be unreadable, it'd just mistake the whole thing for a very small number. But that doesn't really solve the nonstop eating.. :/ If anything, it should stop at 100% health, I think.


You guys are probably right with the 'one' bitmap being broken. Now, which one………

i luffs yeww

2010-03-11 18:13:11

Uhh.. Just get down to your max health - 10, and then take a screen shot and save it after every number (0, 1, 2, 3, 4, 5, 6, 7, 8, 9), and then if all of those work, it's something to do with how the text is read/displayed. :/

NCDS

2010-03-11 19:22:07

Or just debug a bunch of different HPPercent's until one comes up wrong, then that's the bad one?