SRL Archive - SRL Archives

function GetLevelUpText: integer;


marpis

2009-04-27 22:41:43

Returns the level found in uptext.
Returns 0 if not found.


function GetLevelUpText: integer;
var
s: string;
begin
s:= Trim(Between('l:', ')', GetUpText));
if s='' then
result:= 0
else
Result:= StrToInt(s);
end;

Gu3st...

2009-04-27 23:21:41

Do you mean when hovering players?
EG, Zezima - Level 3: Results 3?

Floor66

2009-04-27 23:23:33

I think he does ;)

BKNYKavkaz

2009-04-28 00:45:33

Thats cool…you can use this for antiban…
if s > 137 then
typesend('wow nice lvl')


something like that.

Also can be used to find mobs, for example in barb vil thers lvl 16 goblins and lvl 24 goblins. They both look the same but this simple procedure can be used to fight only the higher or lower lvl goblin.

Gu3st...

2009-04-28 14:27:24

If it is when hovering players then this is great! This is one of my "To make" functions for my wcer, now I don't need to ;P

Nava2

2009-04-28 15:09:04

I'll look deeper into this. :)

Gu3st...

2009-04-28 15:46:16

Instead of
  if s='' then
result:= 0
else
Result:= StrToInt(s);
use
Result := StrToIntDef(s, 0);
Or am I wrong?

Nava2

2009-04-28 20:37:14

Committing:
{*******************************************************************************
function GetLevelAtPos(x, y: Integer): integer;
By: marpis and Nava2
Description: Returns the level of the character at (x, y), uses uptext. Returns
-1 if none are found.
*******************************************************************************}
function GetLevelAtPos(x, y: Integer): integer;
begin
MMouse(x, y, 0, 0);
Wait(RandomRange(80, 150));
Result := StrToIntDef(Between('l: ', ')', GetUpText), -1);
end;

Like?

marpis

2009-04-29 00:18:44

very nice :)