From: Wanted Returns
For one application… think of SRL 6 as a whole ;)
Wait derp….
Lol ;)
Ah you meant XP Bar..
More sauce!!
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
function IsXPBarOpen: Boolean;
Contributors: Wanted
Description: Returns true if the XP counter bar is open.
Date Created: August 7th, 2011. By Wanted. RS2 Build 660.
Last Modified: February 19th 2012. By Wanted. RS2 Build 701.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
function IsXPBarOpen: Boolean;
begin
Result := CountColor(14474460, 410, MSY1, MSX2, 27) > 6;
end;
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
function ToggleXPBar(Open: Boolean): Boolean;
Contributors: Wanted
Description: Opens or closes the XP Bar, true if had to toggle.
Date Created: August 7th, 2011. By Wanted. RS2 Build 660.
Last Modified: October 28th, 2011. By Wanted. RS2 Build 671.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
function ToggleXPBar(Open: Boolean): Boolean;
begin
Result := IsXPBarOpen <> Open;
if (not (Result)) then
Exit;
MouseCircle(12, 534, 63, ClickLeft);
end;
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
function GetXPBarTotal: LongInt;
Contributors: Wanted, Freddy
Description: Returns the number from your XP Bar.
Date Created: August 7th, 2011. By Wanted. RS2 Build 660.
Last Modified: July 20th, 2012. By Freddy. RS2 Build 725.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
function GetXPBarTotal: LongInt;
var
Previous: Boolean;
TPA: TPointArray;
XP: string;
B: TBox;
begin
Result := -1;
Previous := ToggleXPBar(True);
if (Previous) then
if (not (WaitFunc(@IsXPBarOpen, True, 10, 15, 1500, 1750))) then
Exit;
FindColorEx(TPA, 14474460, 350, MSY1, MSX2, 27)
B := TPABounds(TPA);
XP := GetTextAtEx(B.X1 - 1, B.Y1 - 3, 0, XPChars, False, False, 0, 2, 14474460, 20, False, tr_AllChars);
XP := XP + '#';
if (Pos('xp', XP) > 0) then
Result := StrToIntDef(GetNumbers(Between(' ', '#', XP)), -1)
else
Result := StrToIntDef(GetNumbers(XP), -1);
if (not (Previous)) then
Exit;
WaitRR(500, 1500);
ToggleXPBar(False);
end;
;)
#WantedReturns
From: Officer Barbrady
It would be simple as
procedure MarkTime(var a:Integer);
begin
a := GetSystemTime;
end;
function TimeFromMark(a:Integer):Integer;
begin
result := (GetSystemTime - a);
end;
function findText:Integer;
var
textTPA:TPointArray;
begin
findColorsTolerance(textTPA, color, x1, y1, x2, y2, tol);
result := length(textTPA);
end;
function choppedIvy:Boolean;
var
originalCount:Integer;
begin
originalCount := findText;
repeat
wait(25);
result := (findText <> originalCount);
until (result) or (TimeFromMark(t) > 4000);
end;
From: Wanted Returns
Have some sauce ;)
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
function HoverSkill(Skill: Integer; CheckST: Boolean): Boolean;
Contributors: Wanted
Description: Hovers a skill. Put a triple digit number for a random skill.
Date Created: November 3rd, 2011. By Wanted. RS2 Build 674.
Last Modified: March 20th, 2013. By Wanted. RS07 Build ???.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
function HoverSkill(Skill: Integer; CheckST: Boolean): Boolean;
begin
Result := False;
if (CheckST) then
if (not (SetGameTab(Tab_Stats))) then
Exit;
MouseBoxB(GetSkillBounds(Skill), MoveTo);
Result := True;
WaitRR(1500, 2000);
end;
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
function GetSkillXPEx(Skill: Integer; var CurrentXP, XPTilNextLevel: LongInt; CheckCurrent, CheckNext, CheckST: Boolean): Boolean;
Contributors: Wanted
Description: Returns the information by hovering the skill.
Date Created: November 3rd, 2011. By Wanted. RS2 Build 674.
Last Modified: March 22nd, 2013. By Wanted. RS07 Build ???.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
function GetSkillXPEx(Skill: Integer; var CurrentXP, XPTilNextLevel: LongInt; CheckCurrent, CheckNext, CheckST: Boolean): Boolean;
var
bmpSkillInfoBox: TSCARBitmap;
Client: TSCARClient;
TPA: TPointArray;
B: TBox;
begin
Result := False;
CurrentXP := -1;
XPTilNextLevel := -1;
if (not (HoverSkill(Skill, CheckST))) then
Exit;
if (not (WaitFindColorEx(TPA, clSkillInfoBox, MIB, 50, True, 100, 200, 1500, 2500))) then
Exit;
Result := True;
B := TPABounds(TPA);
try
bmpSkillInfoBox := GetClient.CaptureEx(B.X1, B.Y1, B.X2, B.Y2);
Client := SetClient(TSCARBitmapClient.Create(bmpSkillInfoBox));
B := Box(0, 0, bmpSkillInfoBox.Width - 1, bmpSkillInfoBox.Height - 1);
if (CheckCurrent) then
CurrentXP := StrToIntDef(GetNumbers(GetTextAtEx(B.X1, B.Y1 + 2, 0, SmallChars, False, False, 0, 2, clBlack, 30, False, tr_AllChars)), -1);
if (CheckNext) then
XPTilNextLevel := StrToIntDef(GetNumbers(GetTextAtEx(B.X1, B.Y1 + 15, 0, SmallChars, False, False, 0, 2, clBlack, 30, False, tr_AllChars)), -1);
finally
SetClient(Client).Free;
bmpSkillInfoBox.Free;
end;
end;
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
function GetXP(Skill: Integer; CheckST: Boolean): Integer;
Contributors: Wanted
Description: Returns the information by hovering the skill.
Date Created: November 3rd, 2011. By Wanted. RS2 Build 674.
Last Modified: March 20th, 2013. By Wanted. RS07 Build ???.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
function GetXP(Skill: Integer; CheckST: Boolean): Integer;
var
I: Integer;
begin
GetSkillXPEx(Skill, Result, I, True, False, CheckST);
end;
Thanks guys, this will help me greatly.