SRL Archive - SRL Suggestions

GetTotalXPGained


Tim0suprem0

2010-04-30 15:49:33

Might be helpful? I don't know how it works with a whole new font.

Function GetTotalXPGained : Integer;
var XPChars : integer;
begin
XPChars := LoadChars2(AppPath + '\Fonts\XPBarFont\');
//if (not(CountColorTolerance(16777215, 430, 55, 515, 70, 3) >= 50)) then
if (not (XPBarOpen) ) then //thanks Frement and Home
Mouse(531,64,2,2,true);//opens bar
Result:= StrToInt(GetTextAtEx(455, 57, 10, XPChars, False, False, 0, 0, -1, 8, False, tr_Digits))
FreeChars2(XPChars);
Mouse(531,64,2,2,true);//closes bar
end;

You could probably just use color to see if the bar is open or not, but since it opens over the mainscreen, I figured it was safest to search for text. EDIT: Added Frement's method of checking for the bar with color.

Font is attached (doesn't have the colon ":"). Credit to Frement for making 90% of the font :)

Gu3st...

2010-04-30 16:30:25

What's the use? :/

Bionicle

2010-04-30 16:45:36

the little xp icon below the compas, click on it and it displays an xp meter. not sure how the xp is measured though

Frement

2010-04-30 16:52:03

From: bionicle1800
the little xp icon below the compas, click on it and it displays an xp meter. not sure how the xp is measured though


It gathers it until you reset the counter. You can hide/show and reset it, reset it by right-click > reset or left-click (the actual bar).

Coh3n

2010-04-30 16:59:04

From: Frement
It gathers it until you reset the counter. You can hide/show and reset it, reset it by right-click > reset or left-click (the actual bar).

I'm guessing it also resets after you logout?

I like this idea. Could be useful instead of calculating xp.

Frement

2010-04-30 17:13:34

From: Coh3n
I'm guessing it also resets after you logout?

I like this idea. Could be useful instead of calculating xp.


It stays until you reset it :) I have not tested if it stays after system update, but i guess it should.

Coh3n

2010-04-30 18:12:19

From: Frement
It stays until you reset it :) I have not tested if it stays after system update, but i guess it should.

Ahh okay.

Gu3st...

2010-04-30 18:26:36

Yeah, I know what it is, but is there any use for it in scripts?

Timer

2010-04-30 18:27:20

From: Zyt3x
Yeah, I know what it is, but is there any use for it in scripts?


To get gained EXP?

aran armath

2010-04-30 18:59:30

Stays the same after updates.

Mouse(531,64,2,2,true);

I suggest a bigger clicking area or MouseBox maybe.

MouseBox(775, 186, 793, 201, True);
(maybe those aren't right…)

Or color find?

Gu3st...

2010-04-30 19:15:42

From: Timer
To get gained EXP?
And how is that useful? >_<

Main

2010-04-30 20:14:27

If its already open, you should leave it open. If you always close it then it defeats the purpose of checking if its open eh? :)

Coh3n

2010-04-30 23:06:57

From: Zyt3x
And how is that useful? >_<

For progress reports…

Frement

2010-05-01 05:55:44

Heres a bunch of functions i made:
{*******************************************************************************
function XPBarOpen: Boolean;
By: Frement
Description: Returns true if XP bar is open.
*******************************************************************************}
function XPBarOpen: Boolean;
begin
Result := (CountColorTolerance(16777215, 430, 55, 515, 70, 3) >= 50);
end;

{*******************************************************************************
function OpenXPBar: Boolean;
By: Frement
Description: Opens the XP bar if it already is not open.
*******************************************************************************}
function OpenXPBar: Boolean;
var x, y: Integer;
begin
Result := False;
if not (XPBarOpen) then
if (FindColorTolerance(x, y, 12317946, 520, 50, 540, 70, 5)) then begin
Mouse(x, y, 5, 5, True);
Result := True;
end;
end;

{*******************************************************************************
function CloseXPBar: Boolean;
By: Frement
Description: Closes the XP bar if it already is not closed.
*******************************************************************************}
function CloseXPBar: Boolean;
var x, y: Integer;
begin
Result := False;
if (XPBarOpen) then
if (FindColorTolerance(x, y, 12317946, 520, 50, 540, 70, 5)) then begin
Mouse(x, y, 5, 5, True);
Result := True;
end;
end;

{*******************************************************************************
function ResetXPBar: Boolean;
By: Frement
Description: Resets the XP bar, opens it if its closed and then closes it.
*******************************************************************************}
function ResetXPBar: Boolean;
begin
Result := False;
if (XPBarOpen) then begin
Mouse(RandomRange(450, 490), 65, 5, 5, True);
Result := True;
end else begin
OpenXPBar;
Mouse(RandomRange(450, 490), 65, 5, 5, True);
Result := True;
CloseXPBar;
end;
end;

Home

2010-05-01 08:55:23

Frement you could shorten this one to this :)


{*******************************************************************************
function XPBarOpen: Boolean;
By: Frement
Description: Returns true if XP bar is open.
*******************************************************************************}
function XPBarOpen: Boolean;
begin
Result := (CountColorTolerance(16777215, 430, 55, 515, 70, 3) >= 50);
end;


~Home :)

Frement

2010-05-01 09:15:08

From: Home
Frement you could shorten this one to this :)


{*******************************************************************************
function XPBarOpen: Boolean;
By: Frement
Description: Returns true if XP bar is open.
*******************************************************************************}
function XPBarOpen: Boolean;
begin
Result := (CountColorTolerance(16777215, 430, 55, 515, 70, 3) >= 50);
end;


~Home :)


Oh yeah, true :) Well, everything can allways be shortened somehow :)

Tim0suprem0

2010-05-01 09:53:24

From: Main_Ftw
If its already open, you should leave it open. If you always close it then it defeats the purpose of checking if its open eh? :)


This is true, but I figured it was better safe than sorry because on the off chance that it was already open it would mess up if you clicked to open it.

Tbh I really only see this as having a use in progress reports.

Frement

2010-05-01 10:04:23

From: Tim0suprem0
This is true, but I figured it was better safe than sorry because on the off chance that it was already open it would mess up if you clicked to open it.

Tbh I really only see this as having a use in progress reports.


Still alot of people want XP gained on their scripts? XP / Hour and stuff like that.

i luffs yeww

2010-05-01 11:42:22

I think this would be useful. :)