SRL Archive - Unofficial Development

Projectrs06 SRL Include


DannyRS

2013-01-31 19:18:16

About

PLEASE NOTE THIS IS A PRIVATE SERVER INCLUDE, NOT 07Scape My 07Scape here: http://villavu.com/forum/showthread.php?t=96863

Auto-updater added hopefully

Also Available Here On code.google.com

Last Update: [10/2/13] [D/M/Y]

SPS Edit BETA Added :)

ChangeLog:

SPS BETA added
AutoUpdater for googlecode svn trunk added

Original Thread: http://villavu.com/forum/showthread.php?t=95733

As I'm currently leading development of this, I need my own thread I can Update myself with the latest files and not have to constantly bump a random post in rjj95's thread, all credit to rjj95 for originally starting this and bringing us together

Ok, so we are working on an Include for projectrs06, a private server, we will attempt to re-create useful SRL functions to work for this this to make it easier for the members here who script for it :)

Current Contributor's

@DannyRS
@rjj95
@John
@Awkwardsaw
@Shatterhand
@CynicRus


{$I P06Include/P06Include.Simba}
SetupP06Include; //call in your script

{$I Sps/P06sps.Simba} //if you are using the sps beta

Obviously Designed To Work For These Settings:

You must drag the target from Simba's toolbar onto the game client!

Functions Available So Far:




Setup Video by @Sneakdella
[video=youtube;E3dfYdENGAU]http://www.youtube.com/watch?v=E3dfYdENGAU[/video]

Create a Folder Somewhere, Extract The Attached Folders Into That, Open It, Then Move Folder's To:

P06Include To:

P06UpChars To:

p06sps To:

Example how to use in a Script:


Program testP06;

{$I SRL/SRL.Simba}
{$I P06Include/P06Include.Simba}

//LOGIN INFO STUFF
Procedure P06_DeclarePlayer;
Begin
P06_PlayerName:='username';
P06_PlayerPass:='password';
End;

Begin

P06_DeclarePlayer;
SetupP06Include;
ActivateClient;
Wait(2000);
If (Not P06_LoggedIn) Then
P06_LogInPlayer;
P06_MakeCameraAngleHigh;
P06_MakeCompassNorth;

Writeln(P06_GetUpText);

If P06_BankScreen Then
WriteLn('Bank is Open');
If P06_InvFull Then
WriteLn('Inventory is Full');

End.

SPS Beta Stuff

If you are trying out SPS, I recommend you use CynicRus's PathMaker, it has a number of useful tools and code generation options, it can be found Here

There are alot of other sps tutorials that you can try aswell, they should be almost exactly the same as what we have here, look around the tutorial section :)

Ubuntu

2013-02-01 21:19:00

Looks promising. I attempt some scripts for this soon.

Pew

2013-02-02 08:31:44

Super cool, especially the uptext. :)

Awkwardsaw

2013-02-02 09:09:18

could someone host on git? :p

I could if no one else

rj

2013-02-02 11:21:38

From: Awkwardsaw
could someone host on git? :p

I could if no one else


I'll ask danny if he wants to, I can't stand tortoise SVN or -we it's called just because of extra right click options on every file.

DannyRS

2013-02-02 11:28:06

From: Awkwardsaw
could someone host on git? :p

I could if no one else


I'll setup a git account later, and MakeCompass(AnyDegrees); will be done later today ;)


From: rjj95
I'll ask danny if he wants to, I can't stand tortoise SVN or -we it's called just because of extra right click options on every file.


Yeh I'm not too fond of tortoise SVN either, but its easier than unzipping a file every update ;)

rj

2013-02-02 11:33:44

From: DannyRS
I'll setup a git account later, and MakeCompass(AnyDegrees); will be done later today ;)




Yeh I'm not too fond of SVN either


Ok, i'll do some work on it, I want to make banking for my RS script but I'm having trouble -.- Radial walk is stubbern and I don't have SPS maps

DannyRS

2013-02-02 11:44:21

From: rjj95
Ok, i'll do some work on it, I want to make banking for my RS script but I'm having trouble -.- Radial walk is stubbern and I don't have SPS maps


I'm going to write "DepositInventorySlot(X, Boolean)" the boolean being weather to deposit just that item or all of that item ;) and maybe WithdrawBankSlot(X, Boolean); too for real easy banking :p

I was planning to do some included bank open functions with ACA too (e.g. A global bank booth opener), but I'll leave that till last,

If anyone can think of any functions that would be useful, post them in this thread and i'll add them if they are within my capabilities, I'll be home in like 2 hours to do all this,

On a side note, Is the LoginProcedure working flawlessly?

Shatterhand

2013-02-02 13:25:41

This looks cool, I might start playing/botting on this.
I tested your P06_GetUpText function. It does not work with 'orange' text (inventory items).

DannyRS

2013-02-02 13:36:15

From: Shatterhand
This looks cool, I might start playing/botting on this.
I tested your P06_GetUpText function. It does not work with 'orange' text (inventory items).


ah, i forgot to add orange to that, will do, choseoptionmulti should have it :)

Awkwardsaw

2013-02-02 16:46:03

Uptext could use some more work, "Chop down Evergreen" always returns "Chop down Everg. ree"

It's not to bad since I only need Ever anyways, but it would be nice for it to be more accurate :)

DannyRS

2013-02-02 18:50:15

From: Awkwardsaw
Uptext could use some more work, "Chop down Evergreen" always returns "Chop down Everg. ree"

It's not to bad since I only need Ever anyways, but it would be nice for it to be more accurate :)


The color of text changes depending on color behind it, so its hard as hell, trying, thats why I didn't add P06_IsUpText and used P06_IsUpTextMultiCustom :)

Compass stuff all done as best as I can, added to OP file,

tested just now:
Chop down Tree


What area are you in? snow/ground color? brightness V-Bright?

Can you drag over a tree to get the text up then get me a 24-bitmap screenshot of the uptext, then I can update the colors :p

I Need Help Setting up GoogleSVN/GitHub version :)

New Function List:
http://i.imgur.com/N53B5St.png

Schnauzer

2013-02-03 19:59:01

Queston: How do I use the make compass functions? I have tried:

P06_MakeCameraAngleHigh;
P06_MakeCompassDegree(180);
P06_MakeCompassNorth;

And none of them work

DannyRS

2013-02-03 20:21:03

From: Schnauzer
Queston: How do I use the make compass functions? I have tried:

P06_MakeCameraAngleHigh;
P06_MakeCompassDegree(180);
P06_MakeCompassNorth;

And none of them work


Your mouse must be onscreen and you must have clicked to gain focus of the window, and

You must drag the target from Simba's toolbar onto the game client!

Schnauzer

2013-02-03 20:22:56

From: DannyRS
Your mouse must be onscreen and you must have clicked to gain focus of the window, and


This is my main loop:

Begin
SetupSRL;
SetupP06Include;
MouseSpeed := 17;
ActivateClient;
Wait(2000);

P06_MakeCameraAngleHigh;
P06_MakeCompassDegree(180);
P06_MakeCompassNorth;

FindMan;

It's not doing anything

DannyRS

2013-02-03 20:47:01

From: Schnauzer
This is my main loop:

Begin
SetupSRL;
SetupP06Include;
MouseSpeed := 17;
ActivateClient;
Wait(2000);

P06_MakeCameraAngleHigh;
P06_MakeCompassDegree(180);
P06_MakeCompassNorth;

FindMan;

It's not doing anything


Dont do SetupSRL; - its only for official rs

and set P06_MouseSpeed:=17; if you want a constant speed - before you call SetupP06Include;

Schnauzer

2013-02-03 20:51:45

From: DannyRS
Dont do SetupSRL; - its only for official rs

and set P06_MouseSpeed:=17; if you want a constant speed - before you call SetupP06Include;


If I don't add SetUPSRL then it won't right click anything

DannyRS

2013-02-03 20:56:05

From: Schnauzer
If I don't add SetUPSRL then it won't right click anything


Try this?:
P06_ClickCurrent(False);

Schnauzer

2013-02-03 20:58:44

From: DannyRS
Try this?:
P06_ClickCurrent(False);


Same result

DannyRS

2013-02-03 21:03:03

From: Schnauzer
Same result


I have the include setup, and my script looks like this and works perfect, let it log you in:

Program testP06;

{$I SRL/SRL.Simba}
{$I P06Include/P06Include.Simba}

//LOGIN INFO STUFF
Procedure P06_DeclarePlayer;
Begin
P06_PlayerName:='username';
P06_PlayerPass:='password';
End;

Begin
P06_DeclarePlayer;
SetupP06Include;
ActivateClient;
Wait(2000);
If (Not P06_LoggedIn) Then
P06_LogInPlayer;
Writeln(P06_GetUpText);
If P06_BankScreen Then
WriteLn('Bank is Open');
P06_MakeCameraAngleHigh;
P06_MakeCompassSouth;
End.

Schnauzer

2013-02-03 21:06:45

From: DannyRS
I have the include setup, and my script looks like this and works perfect, let it log you in:

Program testP06;

{$I SRL/SRL.Simba}
{$I P06Include/P06Include.Simba}

//LOGIN INFO STUFF
Procedure P06_DeclarePlayer;
Begin
P06_PlayerName:='username';
P06_PlayerPass:='password';
End;

Begin
P06_DeclarePlayer;
SetupP06Include;
ActivateClient;
Wait(2000);
If (Not P06_LoggedIn) Then
P06_LogInPlayer;
Writeln(P06_GetUpText);
If P06_BankScreen Then
WriteLn('Bank is Open');
P06_MakeCameraAngleHigh;
P06_MakeCompassSouth;
End.


Wouldn't log me in, so I logged in myself, and then it didn't do anything

DannyRS

2013-02-03 21:11:49

From: Schnauzer
Wouldn't log me in, so I logged in myself, and then it didn't do anything


your simba setup is wrong, or you have the folder in the wrong place, or you didn't download the font bitmaps and add them, try restarting Simba and,

From: DannyRS
You must drag the target from Simba's toolbar onto the game client!


if still nothing, try a different internet browser? if using the .jar client, try a browser, if it still doesn't work I'll either have to team-viewer you to help or you'll have to troubleshoot on your own :/

Schnauzer

2013-02-03 21:22:04

From: DannyRS
your simba setup is wrong, or you have the folder in the wrong place, or you didn't download the font bitmaps and add them, try restarting Simba and,



if still nothing, try a different internet browser? if using the .jar client, try a browser, if it still doesn't work I'll either have to team-viewer you to help or you'll have to troubleshoot on your own :/


Grr I hate using the web client it's terrible for botting

DannyRS

2013-02-03 21:28:16

From: Schnauzer
Grr I hate using the web client it's terrible for botting


Well if the client is blocking simba from seeing the colors correctly, then duno what else to suggest, let me know if it still doesn't work in the browser, and we can explore other possible causes ;)

Dormik

2013-02-04 14:42:18

How to use;
P06_TypeFast('Hi'); <— is correct
P06_UseKey(?: Enter); <— I want it to click on ENTER, how can I do this?

This is very helpfull btw!

Oh and is there a way with P06_DropAll to dont drop the first item in your inventory?

DannyRS

2013-02-04 15:05:49

From: Dormik
How to use;

This is very helpfull btw!


try

P06_TypeFast('Hi');
P06_UseKey(13);

edit- worked for me

verac2k11

2013-02-04 15:30:18

From: Dormik
How to use;

This is very helpfull btw!

Oh and is there a way with P06_DropAll to dont drop the first item in your inventory?


P06_DropAllExcept(dontdrop : integerArray)
([2, 1, 3]);

Dormik

2013-02-04 15:35:51

Thanks for the fast replys!
Can you make a P06_CheckInvEmpty? That'd help me with some scripts :P! Or is there an easy to detect this?

Im using this to detect if inv full.

procedure CheckInvFull;
var
X,Y:integer;
begin
if (P06_InvFull = true) then
repeat
writeln('Your inventory is full');
if FindBitmapToleranceIn(ancho, X, Y, 548, 175, 751, 461, 145) then
mMouse(x,y,1,1);
ClickMouse2(mouse_right);
if FindBitmapToleranceIn(dropan, X, Y, 548, 175, 751, 461, 145) then
begin
mMouse(x,y,1,1);
ClickMouse2(mouse_left);
end;
until (false);
end;

rj

2013-02-04 16:58:59

From: Dormik
Thanks for the fast replys!
Can you make a P06_CheckInvEmpty? That'd help me with some scripts :P! Or is there an easy to detect this?

Im using this to detect if inv full.


If not P06_InvFull Then

DannyRS

2013-02-04 17:26:52

going to add these next update

edit -

Procedure P06_DropAllExcept(SkipSlots: TIntegerArray); //Added Inventory 0-27
Function P06_InvEmpty: Boolean; //Added

From: Dormik
How to use;

This is very helpfull btw!

Oh and is there a way with P06_DropAll to dont drop the first item in your inventory?


P06_DropAllExcept([0]);

Dormik

2013-02-05 09:01:26

I dont understand what P06_SetGlobals do. Could someone explain it to me, please?
And is there a way to see if you're in combat?

DannyRS

2013-02-05 12:17:24

From: Dormik
I dont understand what P06_SetGlobals do. Could someone explain it to me, please?
And is there a way to see if you're in combat?


Not yet, you dont need to call set globals, it is called in setupp06include or whatever its called,

As far as I know theres no easy way to tell if you are in combat? Other peoples health bars could be up etc

John

2013-02-05 19:11:27

From: DannyRS
Not yet, you dont need to call set globals, it is called in setupp06include or whatever its called,

As far as I know theres no easy way to tell if you are in combat? Other peoples health bars could be up etc


You can use pixel shift can't you?

DannyRS

2013-02-05 20:06:07

From: John
You can use pixel shift can't you?


very very unreliable, for training it would be ok, but for in the middle of a bunch of people or mobs, not too good

John

2013-02-05 20:20:27

From: DannyRS
very very unreliable, for training it would be ok, but for in the middle of a bunch of people or mobs, not too good


It would be fine if you set it to only check a part of your body(where you hold your sword or something) You would have to fine tune it though.

rj

2013-02-07 19:23:18

Genie random event solver:


Check if Hyde might exist:

Function FindHydeColors:Boolean;
var
tmpCTS, l, r:Integer;
HydeTPA:TPointArray;
begin
MouseSpeed:=15;
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.20, 0.21);
if FindColorsTolerance(HydeTPA, 5337207, 1, 1, 518, 359, 3) then
begin
Result := True;
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
//L := High(BankTPA);
end;
Result := False;
end;


Check if genie might exist:

Function FindGenieColors:Boolean;
var
tmpCTS, l, r:Integer;
GenieTPA:TPointArray;
begin
MouseSpeed:=15;
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.14, 1.04);
if FindColorsTolerance(GenieTPA, 6163466, 1, 1, 518, 359, 4) then
begin
Result := True;
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
//L := High(BankTPA);
end;
Result := False;
end;

Solve:

Function FindGenie: Boolean;
Var
tmpCTS,i, L,Counter: Integer;
ObjTPA: TPointArray;
ObjATPA: T2DPointArray;
X,Y,DMCount,Moves: Integer;
Begin
Moves:=0;
DMCount:=0;
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);

SetToleranceSpeed2Modifiers(0.14, 1.04);
FindColorsTolerance(ObjTPA, 6163466, 1, 1, 514, 338, 4);
SplitTPAWrap(ObjTPA, 10, ObjATPA);

SortATPASize(ObjATPA,True);
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);

DMCount:=RandomRange(3,5);
L := High(ObjATPA)
MarkTime(Counter);
For i := 0 To L Do
Begin
MiddleTPAEx(ObjATPA[i], X, Y);
Repeat Begin
Moves:=Moves+1;
mmouse(x, y, 1, 1);
Wait(RandomRange(400, 500));
If (P06_IsUpTextMultiCustom(['Talk To G','alk To Gen','k to Gen'])) Then
Begin
clickmouse2(mouse_Left);
Wait(RandomRange(1500, 5000));
Writeln('Solving genie random event');
Exit;
End;
End; Until (Moves > DMCount)
If (TimeFromMark(Counter) > 5000) Then
Begin
Break;
End;
End;
Result:=False;
End;

Mr hyde colors:
MR HYDE
COL 5337207
TOL 3
HUE MOD 0.20
SAT MOD 0.21

EDIT: I am yet to get a genie event, as soon as somebody gets one tell me if there is anything else to be added

DannyRS

2013-02-07 19:57:55

From: rjj95
Genie random event solver:


your colors are wrong, get the purple pants / light blue of genie :/

Dark Blue will be everywhere

rj

2013-02-07 20:41:59

From: DannyRS
your colors are wrong, get the purple pants / light blue of genie :/

Dark Blue will be everywhere


Will next time i see one

DannyRS

2013-02-07 21:50:00

From: rjj95
Will next time i see one


Aim for colors that Wont be present 99% of the time unless theres one of the randoms is up, hyde is hard to deal with I suppose, imagine we could multithread and constantly monitor for a message with your username in it :/

rj

2013-02-07 22:10:18

From: DannyRS
Aim for colors that Wont be present 99% of the time unless theres one of the randoms is up, hyde is hard to deal with I suppose, imagine we could multithread and constantly monitor for a message with your username in it :/


I thought pascal couldn't muilti thread or was that sarcasm?

John

2013-02-07 23:01:48

Sorry I haven't been any help guys, A lot of work as of late.

DannyRS

2013-02-07 23:02:25

From: rjj95
I thought pascal couldn't muilti thread or was that sarcasm?


Sarcasm related to the lape thread :p

Pascal can't multi thread without some ridiculous plugins as far as I know, Lape can more easily support it, but I think simba is being kept single threaded for now, if I understand tho Lape will be run from compiled code rather than the way we do it currently and compile execute line by line at runtime and checking the source,

So as far as I can see everything handled by scripts themselves should be faster when Lapes completely finished, I'm not really sure how it all works lol

imangry

2013-02-08 14:03:44

I'v just had a quick look, but whats the best way for walking on project rs?

DannyRS

2013-02-08 15:13:17

From: imangry
I'v just had a quick look, but whats the best way for walking on project rs?


TPA/DTM/ Deformed BMP(maybe?)

looking into this myself atm

rogan187

2013-02-08 19:15:46

[Hint] C:\Simba\Includes\P06Include/P06Include.Simba(611:3): Variable 'C' never used at line 610
Compiled successfully in 563 ms.
Successfully executed.


thats what im getting when i run this test script is that correct ? i have done the steps

rj

2013-02-08 19:34:08

From: rogan187
[Hint] C:\Simba\Includes\P06Include/P06Include.Simba(611:3): Variable 'C' never used at line 610
Compiled successfully in 563 ms.
Successfully executed.


thats what im getting when i run this test script is that correct ? i have done the steps

It's fine anytime it has [hint] it's just suggesting a variable wasn't used and won't effect the script

DannyRS

2013-02-08 21:42:44

From: rogan187
[Hint] C:\Simba\Includes\P06Include/P06Include.Simba(611:3): Variable 'C' never used at line 610
Compiled successfully in 563 ms.
Successfully executed.


thats what im getting when i run this test script is that correct ? i have done the steps


Like rjj mentioned, wont affect you at all, I must have accidentally left a variable somewhere it was no longer needed, just a minor mistake, everything will still work fine

Awkwardsaw

2013-02-09 13:45:00

For those of you with git, you can find it here.

Anyone who wants help update/ dev is welcome to be added as a collaborator

DannyRS

2013-02-09 14:46:39

From: Awkwardsaw
For those of you with git, you can find it here.

Anyone who wants help update/ dev is welcome to be added as a collaborator


Thanks for this :) will add to OP and get you my git username soon :p

voltag00

2013-02-09 19:13:06

could one of you guys please use team viewer or logmein to help me? I tried doing all of this but it isn't working.

rj

2013-02-09 19:28:26

From: voltage00
it isn't working.


Can't help you if you don't tell us whats not working

voltag00

2013-02-09 19:48:08

Can someone help me through team viewer or logmein please?

rj

2013-02-09 19:50:03

I'm not going to waste my team getting teamviewer just for you because you won't waste your time telling me your error.

DannyRS

2013-02-09 20:10:50

SPS P06 BETA Added!

Requesting tip's from @Coh3n to help me understand the math better so it's less of a "sps edit hack" and more of a sps for a PS

custom maps only obviously, download the edited SPS file and put it in the correct place (explained in OP), add my map image to SPS's "runescape_other", name it "TestrsSPS",

stand inside the east varrock bank and run a test


Program testP06;

{$I SRL/SRL.Simba}
{$I P06Include/P06Include.Simba}
{$I Sps/P06sps.Simba}

var
//IntCounter: Integer;
MyPath,MyPathBack: TPointArray;

//LOGIN INFO STUFF
Procedure P06_DeclarePlayer;
Begin
P06_PlayerName:='username';
P06_PlayerPass:='password';
End;

Procedure PollPos;
Var Done: Boolean;
Begin
Repeat
Begin
Writeln(toStr(SPS_GetMyPos));
Wait(1000+Random(50));
End;
Until Done;
End;

Begin
P06_DeclarePlayer;
SetupP06Include;
SPS_Setup(RUNESCAPE_OTHER, ['TestrsSPS']);
//SPS_Debug:=True;
ActivateClient;
Wait(1000);
If (Not P06_LoggedIn) Then
P06_LogInPlayer;
MyPath:=[Point(121, 87), Point(120, 80), Point(120, 73), Point(122, 66), Point(124, 59), Point(131, 59), Point(138, 60), Point(145, 61), Point(152, 61), Point(158, 62), Point(165, 63)]
MyPathBack:=[Point(179, 62), Point(172, 62), Point(162, 63), Point(152, 63), Point(142, 63), Point(135, 63), Point(128, 62), Point(120, 61), Point(119, 74), Point(120, 84), Point(121, 91), Point(121, 96), Point(121, 98)]
Writeln(toStr(SPS_GetMyPos));
SPS_WalkPath(MyPath);
SPS_WalkPath(MyPathBack);
//PollPos;
End.

Awkwardsaw

2013-02-09 20:46:21

nice, the beta worked for me so far :)

e: also, what all should be added to the include? I haven't came across anything that needed to be added so far.

DannyRS

2013-02-09 20:48:26

From: Awkwardsaw
nice, the beta worked for me so far :)

e: also, what all should be added to the include? I haven't came across anything that needed to be added so far.


The findflag function (Don't remember exact name) is all that I added for the sps edit to work, I think, but it comes along with a new DTM and stuff too obviously :p

rj

2013-02-09 20:49:57

ill map a fiew areas when i get the hang of photoshop

Awkwardsaw

2013-02-09 20:54:37

From: rjj95
ill map a fiew areas when i get the hang of photoshop


you can do it paint too :p

DannyRS

2013-02-09 20:58:27

From: Awkwardsaw
you can do it paint too :p


if you want to spend several days on a map that consists of like 5 screenshots then yea paint works too

Awkwardsaw

2013-02-09 21:10:59

From: DannyRS
if you want to spend several days on a map that consists of like 5 screenshots then yea paint works too


I've made a few maps using paint, within a half hour each. not too bad(considering it's paint)

rj

2013-02-09 21:17:23

From: Awkwardsaw
I've made a few maps using paint, within a half hour each. not too bad(considering it's paint)


Just spent 15 mins getting rid of edges of minimap, NTY

DannyRS

2013-02-09 21:22:24

From: Awkwardsaw
I've made a few maps using paint, within a half hour each. not too bad(considering it's paint)


yea it's doable but not ideal, removing player dots is hard too,

for example my soulwars script:

http://i.imgur.com/6iTHZA2.png
http://img607.imageshack.us/img607/9426/soulwarsmainallsps.png

try that in paint :/

rj

2013-02-09 22:08:39


Coh3n

2013-02-09 22:31:10

Sorry, Danny, I'm not sure what you're asking. :unsure:

If you want to know if SPS will work with a private server, I don't see why not. You just may need to update some functions to work with an older version of Runescape. I see you have a beta version working; but, I'm not sure what part you think you "hacked" to make it work. Please elaborate. :)

Sjoe

2013-02-09 22:36:28

From: rjj95


Use GIMP lol and follow SPS custom map making tutorials in the tut section

DannyRS

2013-02-09 22:37:25

From: Coh3n
Sorry, Danny, I'm not sure what you're asking. :unsure:

If you want to know if SPS will work with a private server, I don't see why not. You just may need to update some functions to work with an older version of Runescape. I see you have a beta version working; but, I'm not sure what part you think you "hacked" to make it work. Please elaborate. :)


Edit - how did you generate a world map, some kind of hook?

I just barely get how it works, but results are a bit messed up,

SPS_GetMyPos()
The X,Y seem to be returning wrong by 400 so I had to splice in


Result.X:=Result.X+400;
Result.Y:=Result.Y+400;

I know the crappy old interface meant lowering the size of gatherminimap, other than that I'm lost, but it works (altho no result returns 399,399 not -1,-1 lol)

// Edited For P06Include by DannyRS
// Author: marpis & SRL Community
function SPS_GetMyPos(): TPoint;
var
Minimap: TMufasaBitmap;
SmallMap: T3DIntegerArray;
t, FoundMatches: integer;
P: TPoint;
Searches: extended;
begin
Result := Point(-1, -1);

if (not SPS_IsSetup) then
begin
writeln('SPS ERROR: SPS_Setup was never called');
exit;
end;

if (not P06_LoggedIn) then
Exit;

if (SPS_Tolerance < 1.0) then
SPS_Tolerance := 600.0;

if (SPS_MatchesPercent = 0.0) then
SPS_MatchesPercent := 0.35;

Minimap := SPS_GatherMinimap();

t := getSystemTime();
SPS_FilterMinimap(Minimap);
//DrawBitmapDebugImg(Minimap.Index);
//DisplayDebugImgWindow(80, 80);

{$IFDEF SIMBAMAJOR990}
SetLength(SmallMap, 0); // Using this instead of SmallMap := [];
SPS_BitmapToMap(Minimap, SPS_Accuracy, SmallMap);
{$ELSE}
SmallMap := [];
SmallMap := SPS_BitmapToMap(Minimap, SPS_Accuracy);
{$ENDIF}

FoundMatches := SPS_FindMapInMap(P.x, P.y, SPS_AreaMaps, SmallMap, SPS_Tolerance);
Searches := ((Minimap.Width / SPS_Accuracy) * (Minimap.Height / SPS_Accuracy));
{
writeln('fx: '+toStr(p.x)+' ~ on area: '+toStr(P.X * SPS_Accuracy + (Minimap.Width / 2)));
writeln('fy: '+toStr(p.y)+' ~ on area: '+toStr(P.Y * SPS_Accuracy + (Minimap.Width / 2)));
writeln('matches: '+toStr(foundMatches));
writeln('searches: '+toStr(searches));
writeln('percent: '+toStr(FoundMatches / Searches));
}
if ((FoundMatches / Searches) > SPS_MatchesPercent) then
Result := SPS_LocalToGlobal(SPS_GetTopLeftCoords(SPS_Areas), // the top left of the total area
P.x * SPS_Accuracy + (Minimap.Width / 2),
P.y * SPS_Accuracy + (Minimap.Width / 2));
Result.X:=Result.X+400;
Result.Y:=Result.Y+400;
Minimap.Free;

t := (GetSystemTime - t);
if (SPS_Debug) then
Writeln('SPS_GetMyPos: Finished in '+ToStr(t)+' ms. Result = '+ToStr(Result));
end;

Coh3n

2013-02-09 23:31:23

How can you tell if the result is off if you don't have a world map to compare it to? What I would do is just use SPS_GetMyPos to create the path, that way you should always get the same result. Now that I think about it, you shouldn't have to change anything in SPS. All it does is compare the minimap to the map that's loaded (i.e. your custom map). With a custom map, it will return smaller numbers since the top left of the map is 0, 0.

The only reason SPS returns coords on the world map is because there are so many map pieces.

I created the world map using the runescape_surface_creator.simba file in sps/tools/. I don't think it's shipped with the updater, so you'll have to download the SPS source. It uses the in game world map to piece together a bunch of screenshots, then save it as the world map. I'm not sure how old your PS server is, though, so you may not have an in game world map.

DannyRS

2013-02-09 23:39:55

From: Coh3n
How can you tell if the result is off if you don't have a world map to compare it to? What I would do is just use SPS_GetMyPos to create the path, that way you should always get the same result. Now that I think about it, you shouldn't have to change anything in SPS. All it does is compare the minimap to the map that's loaded (i.e. your custom map). With a custom map, it will return smaller numbers since the top left of the map is 0, 0.

The only reason SPS returns coords on the world map is because there are so many map pieces.

I created the world map using the runescape_surface_creator.simba file in sps/tools/. I don't think it's shipped with the updater, so you'll have to download the SPS source. It uses the in game world map to piece together a bunch of screenshots, then save it as the world map. I'm not sure how old your PS server is, though, so you may not have an in game world map.


I made a custom area to test, in the custom folder, SPS_Setup(RUNESCAPE_OTHER,

the getpos I messed with is retuning, say, for example, -130,-130, when standing at 270,270 on the map

there's no high res 2006 world map out there ;(

Coh3n

2013-02-09 23:41:26

From: DannyRS
I made a custom area to test, in the custom folder, SPS_Setup(RUNESCAPE_OTHER,

the getpos I messed with is retuning, say, for example, -130,-130, when standing at 270,270 on the map
Hm, SPS shouldn't take into account the 400, 400 unless you named the map something like 3_2. What did you name the map?

DannyRS

2013-02-09 23:42:54

From: Coh3n
Hm, SPS shouldn't take into account the 400, 400 unless you named the map something like 3_2. What did you name the map?


Test06SPS, do any numbers in title affect it?

Coh3n

2013-02-09 23:47:49

From: DannyRS
Test06SPS, do any numbers in title affect it?
I just took a look at sps.simba and it turns out that will effect the calculation. It checks if there are 2 or more numbers in the file name (since all surface maps are named as such) and if there are, it'll calculate depending on what those numbers are. Try taking the numbers out of the file and see if it works.

DannyRS

2013-02-09 23:51:29

From: Coh3n
I just took a look at sps.simba and it turns out that will effect the calculation. It checks if there are 2 or more numbers in the file name (since all surface maps are named as such) and if there are, it'll calculate depending on what those numbers are. Try taking the numbers out of the file and see if it works.


Just tested it too, position is correct without numbers in name, will update the beta ;) ty for the help

Coh3n

2013-02-09 23:53:41

No problem, glad it worked. :) If you have any questions, feel free to ask (mention me in the post so I'm notified).

DannyRS

2013-02-10 03:32:16

UPDATED the sps file in OP to fix the above Bug me and Coh3n discussed, I gave rjj's flax map a try with the player dots and interface stuff removed, and it actually walked to the bank and back perfectly!

Walking in P06 just got a lot easier!!

Sneakdella

2013-02-10 04:02:35

Danny so I'm grasping the concept of SPS just a little bit. I'm still confused though… I couldnt spot a guide on SPS in the tutorials section either.

DannyRS

2013-02-10 04:10:32

From: Sneakdella
Danny so I'm grasping the concept of SPS just a little bit. I'm still confused though… I couldnt spot a guide on SPS in the tutorials section either.


Try http://villavu.com/forum/showthread.php?t=84360

Thats where I originally learned how to use SPS,

Bear in mind we're using a private server so use common sense when making a map, things in tutorials will differ very slightly, I gave an example a few posts back if you get stuck, give it a go ;)

Dormik

2013-02-10 05:40:47

I get:

[Error] C:\Simba\Includes\Sps/P06sps.Simba(393:11): Unknown identifier 'P06_FindMMFlag' at line 392

When I try to use your test run. (Varrock bank)
Never mind, I updated everything and it works now! Thanks!

DannyRS

2013-02-10 09:37:00

From: Dormik
I get:


When I try to use your test run. (Varrock bank)
Never mind, I updated everything and it works now! Thanks!


It's annoying theres no high res world map, so we have to make everything ourselves :(

But it works atleast!

Unknown identifiers will normally mean I had to add something to the original include to get something else to work and you have the previous version ;)

Coh3n

2013-02-10 10:46:52

From: Sneakdella
Danny so I'm grasping the concept of SPS just a little bit. I'm still confused though… I couldnt spot a guide on SPS in the tutorials section either.
The official SPS thread can be found here. Basically everything you need to know about SPS can be found there.

Sneakdella

2013-02-10 12:25:44

EDIT: Nvm

Fixed all my issues except for the fact that I think I built my map wrong. It's not clicking anywhere when I begin the program and no errors exist in the dialog box.

DannyRS

2013-02-10 13:46:40

From: Sneakdella
EDIT: Nvm

Fixed all my issues except for the fact that I think I built my map wrong. It's not clicking anywhere when I begin the program and no errors exist in the dialog box.


show us your map

Sneakdella

2013-02-10 13:58:22

EDIT: Still not working, just clicks once to get outside the bank and thats it. When I stand in front of a booth the mouse doesnt even move to the minimap to click.

Da map! Made it on GIMP

[ATTACH=CONFIG]19075[/ATTACH]

Here's the updated script that goes with it

The procedures I included it into is ToDaBank; and WalkToMine;


program EastVarrockMiner;
{$I SRL/SRL.Simba}
{$I P06Include/P06Include.Simba}
{$I Sps/P06sps.Simba}
// EAST VARROCK MINER v0.3
// BY SNEAKDELLA ~~ FIRST SCRIPT :)
// TO USE THIS SCRIPT YOU NEED SPS AND P06_INCLUDE
//
// -- INSTRUCTIONS --
// **START IN EAST VARROCK BANK FACING NORTH
//**STAND RIGHT IN FRONT OF THE LEFT BANK BOOTHS THAT ARE OPEN
// (See the pictue on the forums)
//
///
/// v0.3 UPDATE
/// ** Better walking method using SPS
/// Special Thanks to DannyRS, rrj95, Dormik for helping me with the scripts


const
ROCK_COLOR = 1910335; //change if needed to whatever rock you wish to mine this one is Iron.
BANK_ICONE = 5034473; //color of the bank $
RED_ROPE = 924553; // color of bank ropes
var
X, Y:Integer;
ClickedIcone1:Boolean;
tomine,tobank: tpointarray;

//Info on charactars below

Procedure P06_DeclarePlayer;
Begin
P06_PlayerName:='username';
P06_PlayerPass:='password';
End;
procedure pathways;
begin
tomine:=[Point(92, 106), Point(86, 76), Point(149, 75), Point(193, 94), Point(214, 136), Point(228, 171), Point(228, 215), Point(230, 257), Point(217, 299), Point(209, 310)]
tobank:=[Point(209, 310), Point(217, 299), Point(230, 257), Point(228, 215), Point(228, 171), Point(214, 136), Point(193, 94), Point(149, 75), Point(86, 76), Point(92, 106)]
end;
procedure ToggleRun;
begin
writeln('Toggling Run');
sleep(1500);
mouse(710,470,4,4,true);
wait(700 + random(200));
mouse(626,264,4,4,true);
mouse(647,170,4,4,true);
end;
Procedure WalkToMine;
begin
writeln('To the mine!');
SPS_WalkPath(tomine);
end;

procedure MineIron;
begin
if P06_InvEmpty then;
begin repeat
if findcolortolerance(X,Y,ROCK_COLOR,0,0,515,338,5) then
begin
MMouse(X,Y,5,5);
If (P06_IsUpTextMultiCustom(['Mine Rock','ine Rock', 'ne Rock'])) Then
ClickMouse2(mouse_left);
wait(7000 +random(200));
end;
until (P06_InvFull);
end;
end;

procedure ToDaBank;
begin
if P06_InvFull then
begin
SPS_WalkPath(tobank);
writeln('Walking to the bank');
if findcolortolerance(X,Y,BANK_ICONE,560,4,706,140,10) then
begin repeat
mouse(X,Y,4,4,true);
wait(6000+random(200));
ClickedIcone1:=true;
until(ClickedIcone1);
end;
mouse (179,277,1,1,true);
end;
end;

procedure FindBankk;
Begin
writeln('Finding the bank booth, based off the right side rope');
if findcolortolerance(X,Y,RED_ROPE,0,0,515,338,5) then
begin
Mouse(X,Y,5,5,true);
wait(3000 +random(200));
MMouse(225,162,5,5);
If (P06_IsUpTextMultiCustom(['Use Bank Booth','se Bank', 'Use Bank'])) Then
begin repeat
ClickMouse2(mouse_right);
wait(3000 +random(200));
mouse(226,200,5,5,true);
until (P06_BankScreen);

end else MMouse(256,189,5,5);
If (P06_IsUpTextMultiCustom(['Use Bank Booth','se Bank', 'Use Bank'])) Then
begin repeat
ClickMouse2(mouse_right);
wait(3000 +random(200));
mouse(266,214,5,5,true);
until (P06_BankScreen);

end else MMouse(3000,193,5,5);
If (P06_IsUpTextMultiCustom(['Use Bank Booth','se Bank', 'Use Bank'])) Then
begin repeat
ClickMouse2(mouse_right);
wait(7000 +random(200));
mouse(223,201,5,5,true);
until (P06_BankScreen);
end;
end;
end;
procedure IfNotInBank;
begin
if (Not P06_BankScreen) then
begin
writeln('Bot is not in the bank, finding the bank via symbol');
if findcolortolerance(X,Y,BANK_ICONE,560,4,706,140,10) then
begin repeat
mouse(X,Y,4,4,true);
wait(6000+random(200));
ClickedIcone1:=true;
until(ClickedIcone1);
if (ClickedIcone1) then
begin
FindBankk;
end;
end;
end;
end;
procedure PutItIn;
begin
writeln('Bot is sticking stuff into the bank');
If P06_BankScreen Then P06_Deposit(0, 27, True);
end;

begin
P06_DeclarePlayer;
SetupP06Include;
SPS_Setup(RUNESCAPE_OTHER, ['varrockbanktomine']);
ActivateClient;
If (Not P06_LoggedIn) Then
P06_LogInPlayer;
ToggleRun;
pathways;
WalkToMine;
MineIron;
ToDaBank;
FindBankk;
repeat
IfNotInBank;
until (P06_BankScreen);
PutItIn;
end.



Hexless

2013-02-10 14:34:54

From: DannyRS
Well if the client is blocking simba from seeing the colors correctly, then duno what else to suggest, let me know if it still doesn't work in the browser, and we can explore other possible causes ;)

Could you or anyone help me i keep getting needed comma heres a pic but i dont know where to put the comma (im new 2 coding)[ATTACH=CONFIG]19076[/ATTACH]

Sneakdella

2013-02-10 14:42:14

From: Hexless
Could you or anyone help me i keep getting needed comma heres a pic but i dont know where to put the comma (im new 2 coding)[ATTACH=CONFIG]19076[/ATTACH]



You're missing a parentheses.

{heres the correct one}

If P06_GetUpText ('Oak') then


I prefer the multicustom ones though, more accurate in my opinion.


{what I prefer}

If (P06_IsUpTextMultiCustom(['Oak','ak', 'Oa'])) Then

Hexless

2013-02-10 14:49:02

From: Sneakdella
You're missing a parentheses.

{heres the correct one}

If P06_GetUpText ('Oak') then


I prefer the multicustom ones though, more accurate in my opinion.


{what I prefer}

If (P06_IsUpTextMultiCustom(['Oak','ak', 'Oa'])) Then

Oh okay also i just got this Unexpected end of file at line 0
Compiling failed. do you know what it is?

Sneakdella

2013-02-10 15:04:41

From: Hexless
Oh okay also i just got this Unexpected end of file at line 0
Compiling failed. do you know what it is?



Read this. http://villavu.com/forum/showthread.php?t=44942

rj

2013-02-10 15:32:09

Nobody make a flax picker I'm going to start working on one

DannyRS

2013-02-10 15:51:12

From: Sneakdella
You're missing a parentheses.

If P06_GetUpText ('Oak') then


Will do nothing as far as I know, P06_GetUpText returns a string, doesn't take one

Will work but DON'T do it like this



If (P06_GetUpText='Oak') then

like you said, use something like


If (P06_IsUpTextMultiCustom(['down Oak','Oak', 'ak'])) Then

Janus

2013-02-10 17:51:07

Would it be easier to use the PTR server for creating maps for SPS since there is barely anyone around and you wouldn't need to get rid of the white dots. (Forgive me if I'm wrong i've just started learning about SPS!)

DannyRS

2013-02-10 18:27:11

From: Janus
Would it be easier to use the PTR server for creating maps for SPS since there is barely anyone around and you wouldn't need to get rid of the white dots. (Forgive me if I'm wrong i've just started learning about SPS!)

Yes thats what I do!

Sneakdella

2013-02-11 11:26:06

Now installing this is retard proof hopefully if my instructions aren't that bad.

[video=youtube;E3dfYdENGAU]http://www.youtube.com/watch?v=E3dfYdENGAU[/video]

DannyRS

2013-02-11 11:37:39

From: Sneakdella
Now installing this is retard proof hopefully if my instructions aren't that bad.


Wow nice ;) will help a lot of Simba noobs installing :)

imangry

2013-02-11 15:32:39

I have been trying for the last 30 minutes to get my willow cutter to bank.I can get it to walk to the bank but then i cannot seem to get it to banker i tried using colour and TPA's. But no success can anyone help me get the right colour or point me in a direction of how to do it? The bank im trying to do it with is Draynor

DannyRS

2013-02-14 09:09:34

From: imangry
I have been trying for the last 30 minutes to get my willow cutter to bank.I can get it to walk to the bank but then i cannot seem to get it to banker i tried using colour and TPA's. But no success can anyone help me get the right colour or point me in a direction of how to do it? The bank im trying to do it with is Draynor


Have you considered trying the SPS beta?

Janus

2013-02-14 14:20:56

Hey Danny,

On my thread you asked me to test ActivateClient for you, well it was working but lately it has simply been closing my client and causing errors so i'm guessing it's not working. Maybe you could make an P06_ActivateClient if you have the time?

DannyRS

2013-02-14 14:31:42

From: Janus
Hey Danny,

On my thread you asked me to test ActivateClient for you, well it was working but lately it has simply been closing my client and causing errors so i'm guessing it's not working. Maybe you could make an P06+ActivateClient if you have the time?


its a Simba command (windows os) not a script thing, you'll just have to manually make sure the client is visible after start :/

sleepyhead

2013-02-16 10:53:32

nvm got it

The Killer

2013-02-16 10:55:44

From: sleepyhead
not workin bro


That isn't helpful what so ever. At least explain what's "not workin" in detail so the developers of this include can figure out what's going wrong and how to fix it.

DannyRS

2013-02-16 12:14:39

From: sleepyhead
not workin bro


works for everyone else ^^ watch the setup vid / read, if you cant unzip and make folder's, your not ready to bot, and:

From: The Killer
That isn't helpful what so ever. At least explain what's "not workin" in detail so the developers of this include can figure out what's going wrong and how to fix it.

rj

2013-02-16 12:57:19

I got these for you incase your still doing random events dev:




I am also working on a function that will count colors above your head (count the red colors) and calculate your HP accordingly

DannyRS

2013-02-16 13:03:05

From: rjj95
I got these for you incase your still doing random events dev:

I am also working on a function that will count colors above your head (count the red colors) and calculate your HP accordingly


I'm still working on randoms yea :p gj, was trying to recompile smart for PS but I gave up

rj

2013-02-16 13:05:57

From: DannyRS
I'm still working on randoms yea :p gj, was trying to recompile smart for PS but I gave up


I looked at the source and couldn't understand it at all… maybe because I don't have much java experience :s

Also, I can't use my private private server maps were from like 2007, looked different

the elve age

2013-02-16 13:17:32

Good job boys.

rj

2013-02-16 13:39:13

Ok so far I got program to do it I just got to transform into a function/procedure:

Program testP06;
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}
{$I P06Include/P06Include.Simba}
Const
YourHealth = 10;
var
GreenP,RedP,MyHP:Integer;
Health,HealthPercent,AllP,HpPercentMissing,Missing_Health:Extended;
PercentHP:Extended;
Procedure ShowHealth;
Begin
if (RedP < 1) or (GreenP < 1) Then
Begin
Exit;
End;
AllP := (RedP + GreenP);
HpPercentMissing := (RedP/AllP);
Missing_Health := (MyHP*HpPercentMissing);
Health := ((MyHp) - (Missing_Health));
PercentHP := ((RedP/AllP)*100);
Writeln('I have about ' + ToStr(Health)+ ' HP left');
Writeln('Percent:' + ToStr(PercentHP));
End;
Procedure WriteColors;
Begin
Writeln('Green:' + IntToStr(GreenP));
Writeln('Red:' + IntToStr(RedP));
End;
Procedure CountColors;
Begin
GreenP := CountColorTolerance(65280,245,140,281,154,3);
RedP := CountColorTolerance(255,245,140,281,154,3);
End;
Begin
SetupP06Include;
ActivateClient;
Wait(500);
P06_MakeCompassNorth;
P06_MakeCameraAngleHigh;
MyHP := YourHealth;
CountColors;
WriteColors;
ShowHealth;
End.

Edit- Not making all those functions, they can be built in easily with the script, but feel free to add above one

Sawyer

2013-02-16 18:41:35

There is now SPS for '06 Scape?

DannyRS

2013-02-17 03:22:11

From: Sawyer
There is now SPS for '06 Scape?


Yup, I edited it to work for a PS ;)

Try it out, more of a BETA test atm, but I can't see too much wrong with it, will add a faster flag detection method later so it can travel paths faster and more efficiently

Sawyer

2013-02-17 08:03:12

Awesome! :) Maybe if jagex does bring back 07' Scape, this could possibly be used? Or would the normal SPS be used?

DannyRS

2013-02-17 08:34:03

From: Sawyer
Awesome! :) Maybe if jagex does bring back 07' Scape, this could possibly be used? Or would the normal SPS be used?


I believe this sps would work, maybe with tiny modifications, don't worry, all the work I have done here, I will do for 07 scape aswell ;)

Depending on how different it is from a private server, I bet most of this code will work there aswell, I think the game UI and such are simular if not the same between 06-07

Sawyer

2013-02-17 08:40:21

This would make scripting for the new-old runescape much easier. Thank you .

DannyRS

2013-02-17 08:44:18

From: Sawyer
This would make scripting for the new-old runescape much easier. Thank you .


Scar and srl were around back in 07, theres a bunch of old SRL stuff out there in the records somewhere (SRL3 Coh3n or someone mentioned?) I'll have a look for that one day,

But when I started P06 Include, it was a learning experience, 07 scape will be a mission ;) I have a better understanding after this, and will be a hell of a lot faster this time round

rj

2013-02-17 09:24:41

I'm going to abandon my hp detection method and use textwrap for stats to get the current hp

Shatterhand

2013-02-17 09:25:43

Reading HP is so easy on on old RS. :D
program Test;
{$I SRL/SRL.simba}
{$I SRL/SRL/misc/Debug.simba}



procedure SetBoxToBounds(var Box : TBox; X1,Y1,X2,Y2 : Integer);
begin
if (Box.x1 < X1) then Box.x1 := X1;
if (Box.x2 > X2) then Box.x2 := X2;
if (Box.y1 < Y1) then Box.y1 := Y1;
if (Box.y2 > Y2) then Box.y2 := Y2;
end;



procedure DebugTPA_ATPA(TPA: TPointArray; ATPA: Array of TPointArray; First : Integer);
var
BMP, Col, x, y, i, width, height: Integer;
TPABox : TBox;
begin

GetClientDimensions(width,height);
BMP := BitmapFromClient(0,0,width-1,height-1);
DrawTPABitmap(BMP,TPA,ClWhite);

for i:=0 to High(ATPA) do
begin
if i = First then
Col := ClRed
else
Col := ClPurple;

TPABox := GetTPABounds(ATPA[i]);
SetBoxToBounds(TPABox,0,0,width-1,height-1);

for x := TPABox.x1 to TPABox.x2 do
begin
FastSetPixel(BMP,x,TPABox.y1,Col)
FastSetPixel(BMP,x,TPABox.y2,Col)
end;
for y := TPABox.y1 to TPABox.y2 do
begin
FastSetPixel(BMP,TPABox.x1,y,Col)
FastSetPixel(BMP,TPABox.x2,y,Col)
end;
end;

DebugBitmap(BMP);
FreeBitmap(BMP);
end;



function GetHpPercent : Integer;
var
CombinedTPA, GreenTPA, RedTPA : TPointArray;
CombinedATPA, GreenATPA, FinalATPA : Array of TPointArray;
X1,Y1,X2,Y2, i,j,k, BoxWidth : Integer;
ExcludeBoxes : Array of TBox;
TempBox : TBox;
BadTPA : Boolean;
begin
Result := -1;

X1 := 232;
Y1 := 139;
X2 := 287;
Y2 := 163;

FindColorsTolerance(GreenTPA,65280,X1,Y1,X2,Y2,0);
FindColorsTolerance(RedTPA,255,X1,Y1,X2,Y2,0);

CombinedTPA := CombineTPA(GreenTPA,RedTPA);

if (High(CombinedTPA) > 0) then
begin

SplitTPAWrap(CombinedTPA,1,CombinedATPA);

SetArrayLength(ExcludeBoxes,0);
j := 0;
for i:=0 to High(CombinedATPA) do
begin
TempBox := GetTPABounds(CombinedATPA[i]);
BoxWidth := TempBox.x2-TempBox.x1;
if not (BoxWidth = 29) then
begin
SetArrayLength(ExcludeBoxes,j+1);
ExcludeBoxes[j] := TempBox;
end;
end;

SplitTPAWrap(GreenTPA,1,GreenATPA);

SetArrayLength(FinalATPA,0);
k := 0;
for i:=0 to High(GreenATPA) do
begin
BadTPA := False;
for j:=0 to High(ExcludeBoxes) do
if PointInBox(MiddleTPA(GreenATPA[i]),ExcludeBoxes[j]) then
BadTPA := True;
if not BadTPA then
begin
SetArrayLength(FinalATPA,k+1);
FinalATPA[k] := GreenATPA[i];
end;
end;

SortATPAFrom(FinalATPA,Point(260,151));

DebugTPA_ATPA(GreenTPA,FinalATPA,-1);

if (Length(FinalATPA) < 1) then Exit;

TempBox := GetTPABounds(FinalATPA[0]);
BoxWidth := TempBox.x2-TempBox.x1;

Result := Round(BoxWidth*100/29);

end;
end;



var
HPLevel, HPPerc : integer;

begin
ClearDebug;

HPLevel := 11;
repeat
HPPerc := GetHPPercent;
if (HPPerc = -1) then
Writeln('HP: cant find HP bar.')
else
Writeln('HP: ' + IntToStr(Round(HPLevel*HPPerc/100)));
until False;
end.
Reading percent from HP bar is not 100% accurate but it works fine.
It works only at highest camera angle.

rj

2013-02-17 09:41:35

From: Shatterhand
Reading HP is so easy on on old RS. :D
program Test;
{$I SRL/SRL.simba}
{$I SRL/SRL/misc/Debug.simba}



procedure SetBoxToBounds(var Box : TBox; X1,Y1,X2,Y2 : Integer);
begin
if (Box.x1 < X1) then Box.x1 := X1;
if (Box.x2 > X2) then Box.x2 := X2;
if (Box.y1 < Y1) then Box.y1 := Y1;
if (Box.y2 > Y2) then Box.y2 := Y2;
end;



procedure DebugTPA_ATPA(TPA: TPointArray; ATPA: Array of TPointArray; First : Integer);
var
BMP, Col, x, y, i, width, height: Integer;
TPABox : TBox;
begin

GetClientDimensions(width,height);
BMP := BitmapFromClient(0,0,width-1,height-1);
DrawTPABitmap(BMP,TPA,ClWhite);

for i:=0 to High(ATPA) do
begin
if i = First then
Col := ClRed
else
Col := ClPurple;

TPABox := GetTPABounds(ATPA[i]);
SetBoxToBounds(TPABox,0,0,width-1,height-1);

for x := TPABox.x1 to TPABox.x2 do
begin
FastSetPixel(BMP,x,TPABox.y1,Col)
FastSetPixel(BMP,x,TPABox.y2,Col)
end;
for y := TPABox.y1 to TPABox.y2 do
begin
FastSetPixel(BMP,TPABox.x1,y,Col)
FastSetPixel(BMP,TPABox.x2,y,Col)
end;
end;

DebugBitmap(BMP);
FreeBitmap(BMP);
end;



function GetHpPercent : Integer;
var
CombinedTPA, GreenTPA, RedTPA : TPointArray;
CombinedATPA, GreenATPA, FinalATPA : Array of TPointArray;
X1,Y1,X2,Y2, i,j,k, BoxWidth : Integer;
ExcludeBoxes : Array of TBox;
TempBox : TBox;
BadTPA : Boolean;
begin
Result := -1;

X1 := 232;
Y1 := 139;
X2 := 287;
Y2 := 163;

FindColorsTolerance(GreenTPA,65280,X1,Y1,X2,Y2,0);
FindColorsTolerance(RedTPA,255,X1,Y1,X2,Y2,0);

CombinedTPA := CombineTPA(GreenTPA,RedTPA);

if (High(CombinedTPA) > 0) then
begin

SplitTPAWrap(CombinedTPA,1,CombinedATPA);

SetArrayLength(ExcludeBoxes,0);
j := 0;
for i:=0 to High(CombinedATPA) do
begin
TempBox := GetTPABounds(CombinedATPA[i]);
BoxWidth := TempBox.x2-TempBox.x1;
if not (BoxWidth = 29) then
begin
SetArrayLength(ExcludeBoxes,j+1);
ExcludeBoxes[j] := TempBox;
end;
end;

SplitTPAWrap(GreenTPA,1,GreenATPA);

SetArrayLength(FinalATPA,0);
k := 0;
for i:=0 to High(GreenATPA) do
begin
BadTPA := False;
for j:=0 to High(ExcludeBoxes) do
if PointInBox(MiddleTPA(GreenATPA[i]),ExcludeBoxes[j]) then
BadTPA := True;
if not BadTPA then
begin
SetArrayLength(FinalATPA,k+1);
FinalATPA[k] := GreenATPA[i];
end;
end;

SortATPAFrom(FinalATPA,Point(260,151));

DebugTPA_ATPA(GreenTPA,FinalATPA,-1);

if (Length(FinalATPA) < 1) then Exit;

TempBox := GetTPABounds(FinalATPA[0]);
BoxWidth := TempBox.x2-TempBox.x1;

Result := Round(BoxWidth*100/29);

end;
end;



var
HPLevel, HPPerc : integer;

begin
ClearDebug;

HPLevel := 11;
repeat
HPPerc := GetHPPercent;
if (HPPerc = -1) then
Writeln('HP: cant find HP bar.')
else
Writeln('HP: ' + IntToStr(Round(HPLevel*HPPerc/100)));
until False;
end.
Reading percent from HP bar is not 100% accurate but it works fine.
It works only at highest camera angle.


I can just have the stat tab open and read the text and switch to inventory eat, and back to stat tab

DannyRS

2013-02-17 09:47:52

Yea but what could you be doing that needs 100% accuracy, just eat when theres more than a 50% red bar on screen I guess ;)

rj

2013-02-17 09:48:29

Using the text wouldn't be accurate? :(

Shatterhand

2013-02-17 09:53:57

From: DannyRS
Yea but what could you be doing that needs 100% accuracy, just eat when theres more than a 50% red bar on screen I guess ;)

Its not 100% accurate, that means the HP bar has some default values: 100, 89, 65, 52.. etc. If you have 99 HP level, the HP bar cant represent your current HP accurately.

rj

2013-02-17 09:59:41

From: Shatterhand
Its not 100% accurate, that means the HP bar has some default values: 100, 89, 65, 52.. etc. If you have 99 HP level, the HP bar cant represent your current HP accurately.


15 red pixels = 10% damage I figured out, the HP bar is 150 pixels large so 75 red pixels would be half hp :)

But I would rather read the text, seems to be more accurate

DannyRS

2013-02-17 10:01:55

From: rjj95
15 red pixels = 10% damage I figured out, the HP bar is 150 pixels large so 75 red pixels would be half hp :)

But I would rather read the text, seems to be more accurate


Yea accurate, but if you want to know when to eat for say, an autofighter, might aswell just use above head box,

And i knew what you meant shatter ;) nothing I can think of would need to know exactly what HP you were on anyway

rj

2013-02-17 10:08:26

Ima just use text, I can see it now releasing auto fighter: "HALP THEE BOT EATS WHEN IT'S NOT SUPPOSED TOO!!"

DannyRS

2013-02-17 10:42:57

From: rjj95
Ima just use text, I can see it now releasing auto fighter: "HALP THEE BOT EATS WHEN IT'S NOT SUPPOSED TOO!!"


Meh, either way will be fine lol

CHEATGOD

2013-02-17 13:58:39

What does this script actually do sir?

DannyRS

2013-02-17 14:11:54

From: CHEATGOD
What does this script actually do sir?


It's not a script, it makes it 100x easier to make scripts, basically a library

examples


CHEATGOD

2013-02-17 14:13:25

From: DannyRS
It's not a script, it makes it 100x easier to make scripts, basically a library


Thanks. Now I have to figure out how does one actually start making a script lol. BTW do you have a Skype on which I could talk with you?

DannyRS

2013-02-17 14:18:53

From: CHEATGOD
Thanks. Now I have to figure out how does one actually start making a script lol. BTW do you have a Skype on which I could talk with you?


http://villavu.com/forum/showthread.php?t=44942

can't really talk atm, but,

Skype:
DannyRS DannyRS

CHEATGOD

2013-02-17 14:21:27

From: DannyRS
http://villavu.com/forum/showthread.php?t=44942

can't really talk atm, but,

Skype:


Hope I added the right one lol. UK one.

CynicRus

2013-02-18 06:07:31

Support of the ProjectRS 06 include has been added to the my SPS Path maker.

Example of the generated script:

program Walker;
//The code was generated with the path generator for SPS version 2.5.8 by Cynic
//With Project RS 06 compabilty mode.
{$i SRL/srl.simba}
{$I P06Include/P06Include.Simba}
{$i sps/p06sps.simba}

var
//place your variables here
Status: string;

procedure P06DeclarePlayers;
begin
P06_PlayerName:='';
P06_PlayerPass:='';
end;

procedure toBank;
var
toBankVar: TPointArray;
begin
toBankVar:=[Point(332,366),Point(340,347),Point(346,335),Point(363,331),Point(361,305),Point(360,283),Point(358,259),Point(357,232),Point(357,208),Point(352,185),Point(344,159),Point(344,145),Point(341,121),Point(336,106),Point(314,103),Point(295,103),Point(269,103),Point(253,106),Point(228,106),Point(213,104),Point(201,105),Point(200,118),Point(198,131),Point(196,141)];
if SPS_WalkPath(toBankVar) then
Status := 'toBank'
else begin
Status :='Failed toBank';
WriteLn(status + '#Time Running:' +TimeRunning);
Logout;
TerminateScript;
end;
WriteLn(status + '#Time Running:' +TimeRunning);
end;

procedure toMine;
var
toMineVar: TPointArray;
begin
toMineVar:=[Point(196,136),Point(196,120),Point(196,111),Point(201,103),Point(228,105),Point(245,105),Point(264,107),Point(278,102),Point(294,103),Point(324,109),Point(330,125),Point(337,140),Point(337,164),Point(347,183),Point(368,204),Point(357,222),Point(356,252),Point(356,272),Point(356,285),Point(356,311),Point(356,324),Point(339,337),Point(336,358),Point(331,369)];
if SPS_WalkPath(toMineVar) then
Status := 'toMine'
else begin
Status :='Failed toMine';
WriteLn(status + '#Time Running:' +TimeRunning);
Logout;
TerminateScript;
end;
WriteLn(status + '#Time Running:' +TimeRunning);
end;

procedure SetupWalker;
begin
P06_DeclarePlayer;
SetupP06Include;
ActivateClient;
Wait(2054+ Random(2318));
If (Not P06_LoggedIn) Then
P06LoginPlayer;
Wait(857+ Random(353));
P06_MakeCameraAngleHigh;
P06_MakeCompassNorth;
SPS_Setup(RUNESCAPE_OTHER,['varrokMiner']);
end;

begin
SetupWalker;
toBank;
toMine;
end.

Cheers, Cynic.

DannyRS

2013-02-18 07:43:53

From: CynicRus
Support of the ProjectRS 06 include has been added to the my SPS Path maker.

Cheers, Cynic.


Ahh amazing, thanks Cynic :)

I'm sure alot of the SPS newcommers will find this really helpful and save them some time,

EDIT - found your thread, added link to OP and added you to contributors list :p, thanks again, glad to see we are all becoming more accepting towards private servers

rj

2013-02-19 19:56:22

How do I run the auto updater?

John

2013-02-19 19:58:23

From: rjj95
How do I run the auto updater?


From what I have seen, It runs itself.

rj

2013-02-20 19:44:55

Project2006 Stat chars, not sure if the red is the correct color, also is this anywhere close to correct?

Function P06_GetUpHpText: String;
Var
YellowT,FoundText: String;
Begin
YellowT:=GetTextAtExWrap(X1, Y1, X2, Y2, 0, 3, 1, 65535, 55, 'P06StatChars');
FoundText:=YellowT + '';
Result:=FoundText;
End;


Would I have to create a function like

Function P06_Hp: Boolean;
Var
MyHP:Integer;
Begin
Procedure SetKill;
Begin
Case LowerCase(FoundText) Of
'0': MyHP := 0;
'1': MyHP := 1;
'2': MyHP := 2;
'3': MyHP := 3;
'4': MyHP := 4;
'5': MyHP := 5;
'6': MyHP := 6;
'7': MyHP := 7;
'8': MyHP := 8;
'9': MyHP := 9;
'10': MyHP := 10;
End;
End;

To get the HP?

Btw i forgot 6,7,9

Coh3n

2013-02-20 19:49:53

rjj95, instead of returning a string in your getUpHpText, you can just do:

result := strToInt(foundText);
So there's no need for a conversion function. It can be done in one line. ;)

rj

2013-02-20 19:50:47

From: Coh3n
rjj95, instead of returning a string in your getUpHpText, you can just do:

result := strToInt(foundText);
So there's no need for a conversion function. It can be done in one line. ;)

:o ok thanks I'll have to test this but the server is offline ATM

Neodymium

2013-02-20 20:04:37

Instead of using a case statement, you should use StrToInt.
The reason behind this is that all the cases for each HP value would take up too many lines (~100 for all hp values).

function P06_GetStatsHP: Integer;
var
YellowT: string;
ValueHP: Integer;
begin
YellowT := GetTextAtExWrap(X1, Y1, X2, Y2, 0, 3, 1, 65535, 55, 'P06StatChars');
try
ValueHP := StrToInt(YellowT);
except
ValueHP := -1;
end;
Result := ValueHP;
end;
The try, except needs to be there in case the value we read in isn't a valid integer (not that SRL can't read correctly :)), it which case it will return -1. Otherwise you'd get an exception.
So, 'asdf' would return -1, '123' would return 123 and so on.

Edit: Wow, super late.

Edit 2: StrToIntDef version (after Danny's post below):

function P06_GetStatsHP: Integer;
var
YellowT: string;
begin
YellowT := GetTextAtExWrap(X1, Y1, X2, Y2, 0, 3, 1, 65535, 55, 'P06StatChars');
Result := StrToIntDef(YellowT, -1);
end;
Much shorter. :)

DannyRS

2013-02-21 01:33:00

I believe StrToIntDef or something doesn't throw an exception? Whatever I used in my autozealer in "GetWinningTeam" or something :p

Goodjob on the statchars Rjj, I'll add to OP later

unregistered user

2013-02-22 21:52:59

can someone tell me whats wrong with this?

[Error] C:\Simba\Includes\SRL/SRL/core/text.simba(791:13): Unknown identifier 'UpChars' at line 790

DannyRS

2013-02-22 21:55:06

From: unregistered user
can someone tell me whats wrong with this?

[Error] C:\Simba\Includes\SRL/SRL/core/text.simba(791:13): Unknown identifier 'UpChars' at line 790


re-install simba

P1nky

2013-02-23 07:40:25

Goodness… Though this was for 2007scape lol, its like 5-6 am here and had just written a script based off this include and had everything set up, fail. :X

DannyRS

2013-02-23 07:41:27

From: P1nky
Goodness… Though this was for 2007scape lol, its like 5-6 am here and had just written a script based off this include and had everything set up, fail. :X


I have an 07 version with the same P07_ prefix, if you want it,

All function names are exactly the same other than the 7, and everything works, I just havent released it yet incase SRL was going to release an official one

imangry

2013-02-23 08:24:50

From: DannyRS
Have you considered trying the SPS beta?


Sorry for the late reply in the end i got it working, i just couldnt find the colour of the banker. Anyway since 2007 is out i'l play that

DannyRS

2013-02-23 10:06:28

From: P1nky
Goodness… Though this was for 2007scape lol, its like 5-6 am here and had just written a script based off this include and had everything set up, fail. :X


Here you go @P1nky: http://villavu.com/forum/showthread.php?t=96863


From: imangry
Sorry for the late reply in the end i got it working, i just couldnt find the colour of the banker. Anyway since 2007 is out i'l play that


Np, same here I think :)

bdenizb

2013-02-23 16:35:59

Read your massegers :D danny!

Betweenuandme

2013-02-25 08:09:04


I get this when I run it.

DannyRS

2013-02-25 08:13:07

From: Betweenuandme

I get this when I run it.


You are not supposed to run it…

Is this private server officialy dead anyway?

From: bdenizb
Read your massegers :D danny!


Did I reply to you? My PM's is a sea of spam at the moment so going back to find any I missed is all but impossible

rj

2013-02-25 16:27:19

From: DannyRS
You are not supposed to run it…

Is this private server officialy dead anyway?



Did I reply to you? My PM's is a sea of spam at the moment so going back to find any I missed is all but impossible


Soulsplit 2006 will be coming out

DannyRS

2013-02-25 16:34:39

From: rjj95
Soulsplit 2006 will be coming out


Meh this might still work, they use same client AFAIK

kontempt

2013-02-25 16:40:06

I keep getting Unknown identifier 'P06_MouseBox'???

DannyRS

2013-02-25 16:44:10

From: kontempt
I keep getting Unknown identifier 'P06_MouseBox'???


You didn't install the include right, PLEASE NOTE THIS IS A PRIVATE SERVER INCLUDE, NOT 07Scape, 07Scape here: http://villavu.com/forum/showthread.php?t=96863

kontempt

2013-02-25 17:50:49

From: DannyRS
You didn't install the include right, PLEASE NOTE THIS IS A PRIVATE SERVER INCLUDE, NOT 07Scape, 07Scape here: http://villavu.com/forum/showthread.php?t=96863


Thank you i've updated that now, I'm also getting
[Error] C:\Simba\Includes\P07Include.Simba(57:3): Unknown identifier 'MMouse' at line 56
Compiling failed.
' MMouse(RandomRange(X1,X2),RandomRange(Y1,Y2),0,0); '

I'm very new too this sorry :(

DannyRS

2013-02-25 17:54:51

From: kontempt
Thank you i've updated that now, I'm also getting
[Error] C:\Simba\Includes\P07Include.Simba(57:3): Unknown identifier 'MMouse' at line 56
Compiling failed.
' MMouse(RandomRange(X1,X2),RandomRange(Y1,Y2),0,0); '

I'm very new too this sorry :(


you don't compile this include, you set it up like my example in a script,


{$I srl/srl.simba}

you need that in your script before you add this include

Sawyer

2013-02-25 18:06:47

I have everything compiling but it doesn't seem to be able to find uptext.

kontempt

2013-02-25 18:09:02

From: DannyRS
you don't compile this include, you set it up like my example in a script,


{$I srl/srl.simba}

you need that in your script before you add this include


All working fine, thank you for your help :)

DannyRS

2013-02-25 18:09:23

From: Sawyer
I have everything compiling but it doesn't seem to be able to find uptext.


Please post problems in their correct threads, drag the green target from simba onto the game client, it's designed for a browser, not smart, AND DON'T CALL SETUPSRL,

I'm botting right now using the same uptext as the Include, and it's working just fine

Sawyer

2013-02-25 18:15:01

I have drug the green target onto the client. It does not set compass to north either. Maybe I'm doing something wrong… I'll check the code.

DannyRS

2013-02-25 18:25:54

From: Sawyer
I have drug the green target onto the client. It does not set compass to north either. Maybe I'm doing something wrong… I'll check the code.


did you call SetupP07Include; ? the compass and angle functions will not work unless your mouse is on the client, and you have clicked atleast once, because your keypresses are being sent to windows and not the game client

rj

2013-02-25 19:15:31

Hey do you think this will work?

(*
RadialWalkTolerance
~~~~~~~~~~~~~~~~~~~

.. code-block:: pascal

function RadialWalkTolerance(Color: Integer; sRadial, eRadial: Variant; r, modX, modY, Tol: Integer): Boolean;

Same as RadialWalk, but with a tolerance.

.. note::

by Coh3n
Last modified: Jan. 08, 2012 by Coh3n

Example:

.. code-block:: pascal

while (RadialWalkTolerance(clRed, 25.5, 60.0, 50, -1, 2, 5)) do
WriteLn('Walking in a ''line''... with tolerance!');

*)


function P_07RadialWalk(TheColor: Integer; StartRadial, EndRadial: Variant; Radius, Xmod, Ymod: Integer): Boolean;
var
TPA: TPointArray;
I: Integer;
begin
Result := False;
if RadialWalkEx(tpa, P_07MMCX, P_07MMCY, TheColor, 0, StartRadial, EndRadial, Radius) then
for i := 0 to High(tpa) do
if MFNF(tpa[i].x, tpa[i].y, Xmod, Ymod) then
begin
P07_FFlag(10);
Result := True;
Exit;
end;
end;

function P07_RadialWalkTolerance(Color: Integer; sRadial, eRadial: Variant; r, modX, modY, Tol: Integer): Boolean;
var
TPA: TPointArray;
i, h: Integer;
begin
Result := False;

if RadialWalkEx(TPA, P07_MMCX, P07_MMCY, Color, Tol, sRadial, eRadial, r) then
begin
h := High(TPA);
for i := 0 to h do
if MFNF(TPA[i].x, TPA[i].y, modX, modY) then
begin
Result := WaitFunc(@Flag, 50, 500);
Exit;
end;
end;
end;

Edited some variables but idk if they are in 07 include

DannyRS

2013-02-25 19:28:59

You need to edit RadialWalkEx because that's where the juicy stuff happens, I can try and do it for you tomorrow if you want

rj

2013-02-25 19:44:38

From: DannyRS
You need to edit RadialWalkEx because that's where the juicy stuff happens, I can try and do it for you tomorrow if you want


I want to try and I'll tell you when I fail :d

DannyRS

2013-02-25 19:49:05

From: rjj95
I want to try and I'll tell you when I fail :d


Ok, PM me how it goes, dont bump this thread anymore :p, as this server is dead, so this include is more or less useless

rj

2013-02-25 20:10:52

You could still work on it for soulsplit 2006 which will be bigger

DannyRS

2013-02-25 20:12:55

From: rjj95
You could still work on it for soulsplit 2006 which will be bigger


Bigger than 07Scape :p unlikely, I'm focusing on that for now

Sawyer

2013-02-25 20:55:52

Wrong Section

andryaze

2013-02-28 15:25:46

Idk man, it doesn't work.

The 2 packages are in the correct folders but it doesn't compile.

DannyRS

2013-02-28 15:29:54

From: andryaze
Idk man, it doesn't work.

The 2 packages are in the correct folders but it doesn't compile.


:duh:

you don't compile this

andryaze

2013-03-01 12:50:53

From: andryaze
Idk man, it doesn't work.

The 2 packages are in the correct folders but it doesn't compile.

Lmao i'm not compiling your include.

I compile my own scripts + othe scripts. It doesn't work anywhere.

Heres a pic that all files are in the correct folders.

[ATTACH]19503[/ATTACH]

DannyRS

2013-03-01 12:52:59

From: andryaze
Lmao i'm not compiling your include.

I compile my own scripts + othe scripts. It doesn't work anywhere.

Heres a pic that all files are in the correct folders.



wrong thread, but what's the compile error?