SRL Archive - SRL Bugs

GetMMLevels, ConvertXpToLvl


Sabzi

2009-08-16 14:46:43

GetMMLevels returns 0 and no color if we got 100 energy/hp/prayer.
I have tested this with energy because I don't have 100 hp or prayer :P
program New;
{.include SRL/SRL.scar}

var
c: string;

begin
ActivateClient;
SetupSRL;
ClearDebug;
WriteLn('Run: ' + IntToStr(GetMMLevels('run', c)));
WriteLn(c);
WriteLn('');
WriteLn('Prayer: ' + IntToStr(GetMMLevels('prayer', c)));
WriteLn(c);
WriteLn('');
WriteLn('Hp: ' + IntToStr(GetMMLevels('hp', c)));
WriteLn(c);
WriteLn('');
end.

The fix: Change max spacing in GetTextAtEx to 0. So it would be:
GetTextAtEx(B.X1 - 1 , B.Y1 - 1, 0, statChars,
False, False, 0, 0, Colors[I], 20, False, tr_Digits)), -1);


ConvertXpToLvl is a mistype I think because it's pretty obvious. It's not really used so nobody noticed it but why leave it broken?
Fix: Change line 20 in FindXP.scar to:
exp := exp + Trunc(level + 300 * Pow(2, level / 7));
Like in ConvertLvlToXp.

I tested both of the fixes and they should work. In theory this should fix RunEnergy and RestUntil too so no more resting when we got 100 energy but I haven't tested those though.

3Garrett3

2009-08-16 18:56:13

I will test out the run energy, it was making me mad earlier. I actually just ended up putting "If energy = 0 then setrun(true)" because it was easier than fixing it

Sabzi

2009-09-06 14:48:13

From: 3Garrett3
I will test out the run energy, it was making me mad earlier. I actually just ended up putting "If energy = 0 then setrun(true)" because it was easier than fixing it


I got that in my scripts too because other users may don't have this fix. And I hope it will work.

EDIT: Nope, it won't fix RestUntil. It's because of the glowing resting thing.
More here:
http://www.villavu.com/forum/showthread.php?t=48942&highlight=restuntil

ZephyrsFury

2009-09-06 15:30:00

Added both. Thanks :)