SRL Archive - SRL Suggestions

TotalLevel/XP


bolshak25

2012-05-03 00:19:09

Can we add Total as an option for getxp/getlevel.

Total level would just get the bottom level, and if you hover it, it shows the xp. i think it would be good to add those as skill constants because it wont hurt to have them, and if people want to use them they can for various things that get lots of different xp.

I would write my own procedure for it, but i feel that we already have the entire outline for it, so why not just have it be added in like 3 places. Also if i just added it to mine then anyone using my scripts that have that included would need it as well.

tl;dr Seems trivial to add it and it cant hurt anyone to add one more constant to be used in 2 or so functions

bolshak25

2012-05-05 13:57:55

I was looking at how its setup, and we already have the constant, we just need to figure out how to get the total level and if we mouseover that level we can see the xp.

Le Jingle

2012-05-08 06:25:28

Made this, it gets your player's Overall Experience: (Modified from Nielsie95's "GetXP')

[To test, target the RS client, whilst being logged in]

Program New;
{$DEFINE SRL5}
{$i SRL/srl.simba}

Function GetTotalXP: Integer;
Var
b: TBox;
TPA: TPointArray;
Begin
Result := -1;
If (Not GameTab(Tab_Stats)) Then
Exit;
MMouse(620, 444, 105, 12);
Wait(400+Random(200));
If (WaitFindColors(TPA, 15133931, MIX1, MIY1, MIX2, MIY2, 0, 3000)) Then
Begin
b := GetTPABounds(TPA);
Wait(400+random(150));
Result := StrToIntDef(GetNumbers(GetTextAt(653, 421, 0, 1, 4, 4305653, 0, 80, SmallChars)), -1);
End;
End;

Begin
SetupSRL;
GameTab(Tab_Stats);
WriteLn(IntToStr(GetTotalXP));
End.

:>

E: I suppose it couldn't hurt to add in some failsafes like checking to see if we can use our inventory or not(i.e. can't if we're in the bankscreen or maybe a random event), or making sure we're logged in