John
2013-01-20 00:56:18
I'm really bored so here are some functions I've created, I may add more later.
One note, You MUST use P06Setup; if you are going to use these.
This:
You can test them with this.
One note, You MUST use P06Setup; if you are going to use these.
This:
{$i SRL\SRL.simba}Is still required for mouse moving functions.{*******************************************}
//Made by: John
//Use: Highly altered Setup
//Date: 01/20/13
{*******************************************}
procedure P06Setup;
var
t: Integer;
begin
SetupBoxes; //Sets up box variables in globals.simba
t := GetTimeRunning;
MouseSpeed := 25;
setupGauss;
end;{*******************************************}
//Made by: John
//Use: True if we are logged in, if not false.
//Date: 01/20/13
{*******************************************}
function P06LoggedIn: Boolean;
begin
Result := (GetColor(484, 482) = 16777215);//uses the white report text.
{if Result then
WriteLn('We are logged in')
else
WriteLn('We are NOT logged in');}
end;{*******************************************}
//Made by: John
//Use: Opens specified tabs.
//Date: 01/20/13
{*******************************************}
function P06GameTab(Tab: string): Boolean;
var
CoordsX, CoordsY: Integer;
begin
if (not P06LoggedIn) then
Exit;
case Tab of //rough but works.
'inv':
begin
CoordsX:= 650;
CoordsY:= 185;
end;
'equip':
begin
CoordsX:= 685;
CoordsY:= 185;
end;
'prayer':
begin
CoordsX:= 711;
CoordsY:= 185;
end;
'magic':
begin
CoordsX:= 740;
CoordsY:= 185;
end;
'quest':
begin
CoordsX:= 613;
CoordsY:= 185;
end;
'skill':
begin
CoordsX:= 587;
CoordsY:= 185;
end;
'combat':
begin
CoordsX:= 558;
CoordsY:= 185;
end;
'friend':
begin
CoordsX:= 586;
CoordsY:= 483;
end;
'ignore':
begin
CoordsX:= 614;
CoordsY:= 483;
end;
'logout':
begin
CoordsX:= 649;
CoordsY:= 483;
end;
'settings':
begin
CoordsX:= 684;
CoordsY:= 483;
end;
'controls':
begin
CoordsX:= 712;
CoordsY:= 483;
end;
'music':
begin
CoordsX:= 739;
CoordsY:= 483;
end;
end;
Mouse(CoordsX, CoordsY, 10, 10, MOUSE_LEFT);
end;
{*******************************************}
//Made by: John
//Use: Logs out your Character.
//Date: 01/20/13
{*******************************************}
procedure P06Logout;
var
x, y, t: integer;
begin
if (not P06LoggedIn) then
Exit;
if P06GameTab('logout') then
begin
MarkTime(t);
Repeat
Wait(50);
until (FindColorTolerance(x, y, 2106259, 581, 362, 712, 384, 5)) or (TimeFromMark(t) > 2000+random(700))
Mouse(644, 378, 5, 5, MOUSE_LEFT);
end;
end;
{*******************************************}
//Made by: John
//Use: Logs in your Character.
//Date: 01/20/13
{*******************************************}
procedure P06LogIn;
var
x, y, t: integer;
begin
if P06LoggedIn then
Exit;
If (not P06Ready) then
begin
WriteLn('P06 is not loaded, please load it up and then start the script again(Make sure you have targeted the game client');
TerminateScript;
end else
begin
MouseBox(390, 273, 534, 306, MOUSE_LEFT);
MarkTime(t);
Repeat
Wait(50);
until (FindColorTolerance(x, y, 65535, 432, 222, 435, 227, 4)) or (TimeFromMark(t) > 2000+random(700));
TypeSend(Players[CurrentPlayer].Name);
SendKeys(Players[CurrentPlayer].Pass, 70, 70);
MouseBox(230, 302, 371, 338, MOUSE_LEFT);
MarkTime(t);
Repeat
Wait(50);
until (P06LoggedIn) or (TimeFromMark(t) > 2000+random(700));
Wait(2500+random(1000));
end;
end;You can test them with this.
begin
P06setup;
if P06LoggedIn then
P06GameTab('inv');
end.