PDA

View Full Version : P06 Functions/Procedures



John
01-20-2013, 05:56 AM
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:
{$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.

Janus
01-20-2013, 06:16 AM
Oh cool this is good to see. I am new to scripting (so apologies if I make no sense!) but was thinking of doing something similar soon. Do you just paste these into your code if you want to use them? Is there anyway to make an include thing for these? We could have numerous people working on things and collate them altogether?

What other functions do you think should be made? I would love to attempt some.

John
01-20-2013, 06:25 AM
Oh cool this is good to see. I am new to scripting (so apologies if I make no sense!) but was thinking of doing something similar soon. Do you just paste these into your code if you want to use them? Is there anyway to make an include thing for these? We could have numerous people working on things and collate them altogether?

What other functions do you think should be made? I would love to attempt some.

I just finished Logout and I am starting on Login now.

E: Just added them

drivebygangbang
01-20-2013, 09:47 AM
include thing
a library?

John
01-20-2013, 11:30 AM
a library?

He means something like this: {$i srl/P06.simba}

John
01-21-2013, 10:48 AM
Sorry to double post, But would anyone like a function made to work with P06?

Justin
01-21-2013, 11:46 AM
Jawn, Why?? :(

John
01-22-2013, 02:53 AM
Jawn, Why?? :(

because I'm bored Jawstin.

Pew
01-24-2013, 03:30 AM
Something to possibly check run percentage? Anti-randoms? Great work so far!

rj
01-24-2013, 03:59 AM
I'll start in a p06 include when i add mouse movements to my ss include

Echo_
01-24-2013, 04:37 AM
I'll start in a p06 include when i add mouse movements to my ss include

What's wrong with the mouse movements already in SRL?

rj
01-24-2013, 11:38 AM
What's wrong with the mouse movements already in SRL?

I can't include my ss include and the srl include add the same time.. therfor when i use the soulsplit include the mouse jumps because mmouse is not availible, so i have to add the srl mouse movements

Echo_
01-24-2013, 05:21 PM
I can't include my ss include and the srl include add the same time.. therfor when i use the soulsplit include the mouse jumps because mmouse is not availible, so i have to add the srl mouse movements

That's what I was wondering, because you're post made it sound like you were writing your own custom mouse procedure just for use with SS.

Awkwardsaw
01-25-2013, 03:03 AM
has anyone by chance made a simple uptext checker? just one that counts the colors of either white/blue/yellow. I know someone made one a while ago when the fonts got screwed up, but can't find it.

I'm only asking because I tried making one, and it's not finding the colors