PDA

View Full Version : Massive RSPS include project



rj
12-23-2013, 12:06 AM
Massive RSPS include project



I am working on a big include that will be useful for multiple RSPS servers. I have to make it able to do most of the basic SRL functions for 317, 417, 508, 614, and 728 servers. This include uses some SRL5 functions, and some SRL6. It is further being optimised to utilize lape as much as possible to my knowledge.



Install instructions:

- Download SRLRSPS from https://github.com/officerBarbrady/srlRSPS
- Open up the .zip and copy the file named 'RSPS' into c:simba/includes
http://i.imgur.com/ig9lOXR.png
- Set the script interpreter to lape



Example script

{$I RSPS/srlRSPS.Simba}

var
myServer:_rsps_server;

begin
myServer := myServer.init(720, 'CloudIn');
writeln(myServer.getupText);
end.

function list


function string.startsWith(s:string):boolean;
function string.endsWith(s:string):boolean;
function string.size:integer;
function string.toArray:tstringarray;
function string.rand:string;
function string.toBoolean():boolean;
function string.toIntegerArray():TIntegerArray;
function string.toExtendedArray():TExtendedArray;
function string.toStringArray():TStringArray;
function string.contains(s:string):boolean;
function string.position(str:string):integer;
function string.removeEnd:string;
function GetSystemTime: LongWord; override;
procedure TerminateScript; override;
procedure ColorToleranceSpeed(cts : integer);
function getColorToleranceSpeed:Integer;
procedure SetColorspeed2Modifiers(huemodifier, saturationmodifier: Extended);
function _724_BankScreen: Boolean;
function _317_bankScreen:boolean;
procedure _317_closeBank();
function ss_getchat(line:integer):string;
function ss_getchat:tstringarray;overload;
function _317_getchat(line:integer;colors:tintegerArray):st ring;
function _rsps_server.getChatText(line:integer):string;
function _rsps_server.getChatText:tstringarray; overload;
function _rsps_server.chatTextExists(text:string):boolean;
function _rsps_server.chatTextExists(text:TStringArray):boo lean; overload;
function ss_getNpcText:array of chatOption;
function _rsps_server.clickNpcText(text:string):boolean;
function _rsps_server.clickNpcText(text:tstringarray):boole an; overload;
function getCurrentTab:integer;
function gameTab(tab:integer):boolean;
procedure openTab(tab:integer);
function getFriendName(index:integer):string;
function getFriendNames:TStringArray;
function getWeaponName:string;
function getTotalLevel:string;
function _317_getInterfaceTPA:TPointArray;
function _317_getInterfaceBounds:TBox;
function _317_interfaceOpen:boolean;
function _317_getInterfaceName:string;
function _317_getInterfaceDescription:string;
procedure _317_closeInterface;
function rsps_inventory.boxCenter(bx: TBox): TPoint;
function rsps_inventory.explodeBox(bx: TBox; rows, columns: integer): TBoxArray;
procedure rsps_inventory.setUp(b:tbox);
function rsps_inventory.slotFull(slot:Integer):Boolean;
function rsps_inventory.count:Integer;
function rsps_inventory.full:Boolean;
procedure rsps_inventory.interactItem(slot:Integer; Button:Integer);
function rsps_inventory.searchBitmap(BMPSearch, tol:Integer;click, cont:Boolean):Boolean;
function rsps_inventory.countBitmap(bmpSearch, tol:Integer):Integer;
function rsps_inventory.countDTM(DTMSearch:Integer):Integer ;
function rsps_inventory.searchDTM(DTMSearch:Integer;click, cont:Boolean;button:Integer):Boolean;
function rsps_inventory.searchDTM(DTMSearch:Integer;cont:Bo olean;button:Integer):Boolean; overload;
function rsps_inventory.searchDTM(DTMSearch:Integer;button: Integer):Boolean; overload;
function rsps_inventory.itemAmount(slot:integer):integer;
function rsps_inventory.totalItemAmount:Int64;
function rsps_inventory.DTMPosition(model:integer):integer;
function rsps_inventory.DTMPosition(model:integer):integer;
function rsps_inventory.getItemName(slot:integer):string;
Procedure rsps_setangleHigh();
function _rsps_server.findObject(Colors, tols:TintegerArray;hue,sat:TExtendedArray;dist, minLength:integer;uptext:tstringarray;Useuptext,ri ghtClick:boolean):boolean;
function _rsps_server.findObject(Color, tol:integer;hue,sat:Extended;dist, minLength:integer;uptext:tstringarray;Useuptext,ri ghtClick:boolean):boolean; overload;
function _rsps_server.findObject(Color, tol:integer;hue,sat:Extended;uptext:tstringarray): boolean; overload;
function ArrInStr(arrS: TStringArray; str: string): Boolean;
function BoxClosestPoint(p : TPoint; b : TBox) : TPoint;
function RandomPointBoxEx(p : TPoint; b : TBox; extraDist : integer) : TPoint;
function getPixelShift(b: TBoxArray; time: integer): TIntegerArray;
function getPixelShift(b: TBox; time: integer): integer; overload;
function getPixelShift(atpa: T2DPointArray; time: integer): TIntegerArray; overload;
function getPixelShift(tpa: TPointArray; t: integer): integer; overload;
function getPixelShiftAverage(b: TBoxArray; waitPerLoop, maxTime: integer): TIntegerArray;
function getPixelShiftAverage(b: TBox; waitPerLoop, maxTime: integer): integer; overload;
function getPixelShiftAverage(atpa: T2DPointArray; waitPerLoop, maxTime: integer): TIntegerArray; overload;
function getPixelShiftAverage(b: TPointArray; waitPerLoop, maxTime: integer): integer; overload;
function minimap.getText(b:tbox;colors:tintegerArray;font:s tring):integer;
function minimap.getHealth:integer;
function minimap.getPrayer:integer;
function minimap.getRun:integer;
function minimap.getCompassRadians: Extended;
function minimap.GetCompassAngleDegrees: Extended;
function minimap.runOn:boolean;
function minimap.runOff:boolean;
procedure minimap.setRun(turnOn:boolean);
procedure minimap.setRun(turnOn:boolean;energy:integer) overload;
function minimap.getDots(color, tol:integer;hmod, smod:extended):TPointarray; overload;
function minimap.countDots(color, tol:integer;hmod, smod:extended):integer
function GetMiniMapDotsIn(WhatDot: String; x1, y1, x2, y2: Integer): TPointArray;
procedure ss_MMToMS(var X, Y:Integer);
function ss_MMtoMsPoint(p:TPoint):TPoint;
procedure MMouse(x, y, rx, ry: integer);
procedure mmouse(x, y:Integer);overload;
function VariantIsBoolean(const v: Variant): Boolean;
procedure ClickMouse2(button: variant);
procedure Mouse(mousex, mousey, ranx, rany: Integer; button: variant);
procedure Mouse(mousex, mousey: Integer; button: variant);overload;
procedure Mouse(mousex, mousey: Integer; button: fnct_actionOptions);overload;
procedure Mouse(mousex, mousey: Integer)overload;
procedure MouseBoxEx(x1, y1, x2, y2: Integer; Dist,ClickType: Integer);
function isText(Text, theText: TStringArray): Boolean;
function ss_xpBarOpen:boolean;
function ss_getXpBarTPA:TPointArray;
function ss_getXpBarTotalString:string;
function ss_getXPBarTotal:integer;
function getAmountBox(b:TBox):integer;
function getSimpleText(Colors:TIntegerArray;x1, y1, x2, y2:integer;font:string):String;
function DebugTPA(Points: TPointArray; BmpName: string): Boolean;
function DebugATPA(aPoints: T2DPointArray; BmpName: string): Boolean;
function ss_getuptext:string;
function _525_getuptext():string;
function _525_GetChooseOptions(): Array of TOptions;
function _317_GetChooseOptions(): Array of TOptions;
Function _724_GetChooseOptions(): Array of TOptions;
function _rsps_server.ChooseOptionMulti(Texts: TStringArray; TextType: String; Action: fnct_ActionOptions): Boolean;
function _rsps_server.chooseOptionMulti(Txt: TStringArray): Boolean; overload;
function _rsps_server.chooseOption(Txt, TextType: string): Boolean;
function _rsps_server.chooseOption(Txt: String): Boolean; overload;
procedure TypeByte(k: Byte);
procedure TypeSend(Text: string; PressEnter: Boolean);
procedure TypeSend(Text: string);overload;
function LoadTextTPA(Text, Chars: string; var height: integer): TPointArray;
function FindTextTPAEx(Color,Tol,xs,ys,xe,ye : integer;var x,y : integer; Txt, Chars : string; Action :fnct_actionOptions ) : Boolean;
function FindTextTPA(Color, Tol, xs, ys, xe, ye: integer; Txt, Chars: string; Action: fnct_actionOptions): Boolean;
function _rsps_server.WaitOptionMulti(S: TStringArray; TextType: string; Action: fnct_ActionOptions; Time: Integer): Boolean;
function _rsps_server.IsUpTextMulti(Text: TStringArray): Boolean;
function _rsps_server.waitOptionMulti(S: TStringArray; Time: Integer): Boolean; overload;
function _rsps_server.waitOption(S: string; Time: Integer): Boolean; overload;
function _rsps_server.waitUpTextMulti(S: TStringArray; Time: Integer): Boolean;
function _rsps_server.IsUpText(UpText: string): Boolean;
function _rsps_server.waitUptext(S: string; Time: Integer): Boolean;
function WaitFunc(Func: function: Boolean; WaitPerLoop, MaxTime: Integer): Boolean;
procedure markTime(var t:Integer);
function timeFromMark(i:Integer):Integer;
function MsToTime(MS, TheType: Integer): string;
function TimeRunning: string;
function isClientReady(): boolean;
function waitClientReady(): boolean;
procedure _ps_smartInfo.setParams(roott, paramss:string;widthh, heightt:integer;pluginss:tstringarray);


functions to be added
-Suggestions?

spokas
01-04-2014, 01:35 PM
Send me your skype in pm i wanna get more info about this. :P

Hoodz
01-04-2014, 01:41 PM
-Possibility loading some servers in SMART if I can ever figure out how to/possible


its pretty easy but some servers (deviousPk, i know for sure) have their client obfuscated. so when i launch smart, the client loads but the script doesnt do anything. it has something to do with the canvas which is blocked

bg5
01-04-2014, 02:51 PM
its pretty easy but some servers (deviousPk, i know for sure) have their client obfuscated. so when i launch smart, the client loads but the script doesnt do anything. it has something to do with the canvas which is blocked

Have you tried it with Soulsplit or PKhonor? I tried it and failed - Souldsplit is forcing clientstub to resize and it throws exeption, PKHonor ,after it downloads cache just doesn't work. Although I was using old smart version, I'm not sure about SMART remote.

Hoodz
01-04-2014, 03:50 PM
Have you tried it with Soulsplit or PKhonor? I tried it and failed - Souldsplit is forcing clientstub to resize and it throws exeption, PKHonor ,after it downloads cache just doesn't work. Although I was using old smart version, I'm not sure about SMART remote.
let me check

edit: they both didnt work for me :(
but i used the srl-osr smartparams. maybe the srl-6 works

rj
01-04-2014, 04:03 PM
I have never been able to load any servers -.- then again I can't load RS3 on SMART with my current computer

Hoodz
01-04-2014, 04:17 PM
I have never been able to load any servers -.- then again I can't load RS3 on SMART with my current computer
can you load devious pk?

rj
01-04-2014, 04:33 PM
can you load devious pk?

nope

spokas
01-04-2014, 06:25 PM
Can you loud cloud in ?

rj
01-09-2014, 10:48 PM
Hearts 2 Pk: Selling d boots 5m ea!


GetChatboxText coming soon!
http://i.imgur.com/haLJwFT.png

Syntax
01-11-2014, 02:11 PM
Good luck Officer Barbrady, great member right here :)

rj
02-17-2014, 05:02 AM
Latest work


-Added GetXPBarTotal for Soulsplit
-Added Interface detection for 317 servers (includes getting interface name & description)

jstemper
05-27-2015, 01:29 AM
is this still viable? like could I use this if i wanted to? (for soulsplit)

KeepBotting
05-27-2015, 01:34 AM
is this still viable? like could I use this if i wanted to? (for soulsplit)

I'd assume most/all of the routines in the include are functional to some degree.

Omelette
08-08-2015, 06:26 AM
When I try running waitUpTextMulti, I get the error "Access violation."

I'm not sure why this happens, and I can't seem to find it anywhere on the forums.

Here's my dinky little test script:


program TestUpText;
{$I RSPS/srlRSPS.Simba}

var
Z:_rsps_server;

begin
ClearDebug;
MoveMouse(661, 229);
if Z.waitUpTextMulti(['Magic', 'agic'], 500) then
begin
wait(500);
WriteLn('Found that tree.');
end else
wait(500);
WriteLn('Nah, aint found me no trees.');
end.


Debug box:

Error: Access violation
Execution failed.


Any help will be much appreciated, thanks!

Starfox
03-20-2016, 04:12 PM
I am having problems having the RSPS SRL to find a bitmap on the TizenX client

I have this code:


program Bot;
{$I RSPS/srlRSPS.simba}

var
X, Y:Integer;
test:Integer;

If FindBitmapToleranceIn(test, X, Y, 522, 169, 764, 503, 5) then
begin
writeln('Found the bitmap!');
end else
writeln('No bitmap!');
end

procedure loadMaps
begin
test := BitmapFromString(26, 9, 'meJx1kl0KwkAQg72D+lJb1LWFOlC' +
'wSl88qbfVTFND8EeCzK6TbzODY9TXoVBj1EPfQOduB+F4v52m Swuh' +
'oFCrX82yoNg/npLuUcuVnClSMw09yZ+CQHTS0h4rGlfvj4C8zP5II' +
'OMlKgozLPGisJO07rDVURAvlJBeuqAcM37TJFx+0JBnWcKM0q MakJ' +
'349myatNQbn5QL1BJg0aN6lygc4f2elBYUXLKn1U+cVzTeiOa RfJn' +
'/CvQQ6JM21dr3BqYH9te1Uv2puHnP/AJYsqJh');
end

//loop function
begin
loadMaps;
FreeBitmap(test);
end.


I dont even get the else statement
Just says my bitmap doesnt exist

I have the x1, y1, x2, y2 correct.
I have messed with the tolerances even > 500 and still finds nothing.

jstemper
03-20-2016, 05:16 PM
I am having problems having the RSPS SRL to find a bitmap on the TizenX client

I have this code:


program Bot;
{$I RSPS/srlRSPS.simba}

var
X, Y:Integer;
test:Integer;

If FindBitmapToleranceIn(test, X, Y, 522, 169, 764, 503, 5) then
begin
writeln('Found the bitmap!');
end else
writeln('No bitmap!');
end

procedure loadMaps
begin
test := BitmapFromString(26, 9, 'meJx1kl0KwkAQg72D+lJb1LWFOlC' +
'wSl88qbfVTFND8EeCzK6TbzODY9TXoVBj1EPfQOduB+F4v52m Swuh' +
'oFCrX82yoNg/npLuUcuVnClSMw09yZ+CQHTS0h4rGlfvj4C8zP5II' +
'OMlKgozLPGisJO07rDVURAvlJBeuqAcM37TJFx+0JBnWcKM0q MakJ' +
'349myatNQbn5QL1BJg0aN6lygc4f2elBYUXLKn1U+cVzTeiOa RfJn' +
'/CvQQ6JM21dr3BqYH9te1Uv2puHnP/AJYsqJh');
end

//loop function
begin
loadMaps;
FreeBitmap(test);
end.


I dont even get the else statement
Just says my bitmap doesnt exist

I have the x1, y1, x2, y2 correct.
I have messed with the tolerances even > 500 and still finds nothing.

try this program Bot;
{$I RSPS/srlRSPS.simba}

var
X, Y:Integer;
test:Integer;

procedure BitmapTest;
begin
If FindBitmapToleranceIn(test, X, Y, 522, 169, 764, 503, 5) then
begin
writeln('Found the bitmap!');
end else
writeln('No bitmap!');
end

procedure loadMaps
begin
test := BitmapFromString(26, 9, 'meJx1kl0KwkAQg72D+lJb1LWFOlC' +
'wSl88qbfVTFND8EeCzK6TbzODY9TXoVBj1EPfQOduB+F4v52m Swuh' +
'oFCrX82yoNg/npLuUcuVnClSMw09yZ+CQHTS0h4rGlfvj4C8zP5II' +
'OMlKgozLPGisJO07rDVURAvlJBeuqAcM37TJFx+0JBnWcKM0q MakJ' +
'349myatNQbn5QL1BJg0aN6lygc4f2elBYUXLKn1U+cVzTeiOa RfJn' +
'/CvQQ6JM21dr3BqYH9te1Uv2puHnP/AJYsqJh');
end

//loop function
begin
loadMaps;
BitMapTest;
FreeBitmap(test);
end.

guerr
03-20-2016, 06:42 PM
@musta

seems like you forgot to actually call the procedure.

Starfox
03-20-2016, 09:19 PM
try this program Bot;
{$I RSPS/srlRSPS.simba}

var
X, Y:Integer;
test:Integer;

procedure BitmapTest;
begin
If FindBitmapToleranceIn(test, X, Y, 522, 169, 764, 503, 5) then
begin
writeln('Found the bitmap!');
end else
writeln('No bitmap!');
end

procedure loadMaps
begin
test := BitmapFromString(26, 9, 'meJx1kl0KwkAQg72D+lJb1LWFOlC' +
'wSl88qbfVTFND8EeCzK6TbzODY9TXoVBj1EPfQOduB+F4v52m Swuh' +
'oFCrX82yoNg/npLuUcuVnClSMw09yZ+CQHTS0h4rGlfvj4C8zP5II' +
'OMlKgozLPGisJO07rDVURAvlJBeuqAcM37TJFx+0JBnWcKM0q MakJ' +
'349myatNQbn5QL1BJg0aN6lygc4f2elBYUXLKn1U+cVzTeiOa RfJn' +
'/CvQQ6JM21dr3BqYH9te1Uv2puHnP/AJYsqJh');
end

//loop function
begin
loadMaps;
BitMapTest;
FreeBitmap(test);
end.

Now it gives me the else statement, but still will not locate my bitmap
Edit: Switched client display mode to "Software" and now it finds my bitmap fine, thanks guys

Starfox
03-21-2016, 01:03 PM
Does anyone know how I could possibly make my code wait until a certain procedure needs to be called?
Like I am AFKing, and then an interface pops up, I want it to click out of it.
So the bot needs to run constantly, until the interface pops up then this is where a bitmap finds it and closes out of it
Then continues to run and click out of interfaces.

Thanks

goodgamescript
03-22-2016, 09:56 PM
Does anyone know how I could possibly make my code wait until a certain procedure needs to be called?
Like I am AFKing, and then an interface pops up, I want it to click out of it.
So the bot needs to run constantly, until the interface pops up then this is where a bitmap finds it and closes out of it
Then continues to run and click out of interfaces.
Thanks
you could try something like or a combination of both. Depending on how you want to do it.


Function Findthing:boolean;
begin
if "find code here" then
Result:= true;
end;

procedure clickout;
begin
waitFunc(@Findthing,WaitPerLoop,maxtime);//example waitperloop = 300, maxtime 10000(10 sec)
if Findthing then
begin
//code here to close thing
end;

end;

begin //main loop
clickout;

end;



or



procedure clickout; forward;

procedure reset;
begin
clickout;
end;

Function Findthing:boolean;
begin
if "find code here" then
Result:= true;
end;

procedure clickout;
begin
repeat
wait(1000);
until(Findthing);

if Findthing then
begin
//code here to close thing
reset;
end;
end;

begin //main loop
clickout;

end;




edit: code should work.

links to check out.
the waitfunc (http://docs.villavu.com/srl-6/time.html)
Loops (https://www.youtube.com/watch?v=PjIE2nfhRT0&list=PLnHD8Bhe1x8U6ecAy8d8hXYnpcwovvXag&index=5)
creating basic functions (https://www.youtube.com/watch?v=MZQsHt8R29M&list=PLnHD8Bhe1x8U6ecAy8d8hXYnpcwovvXag&index=6)
Forwarding Functions/procedures (https://www.youtube.com/watch?v=sk7IBp04608&index=7&list=PLnHD8Bhe1x8U6ecAy8d8hXYnpcwovvXag)

Starfox
03-22-2016, 11:25 PM
you could try something like or a combination of both. Depending on how you want to do it.


Function Findthing:boolean;
begin
if "find code here" then
Result:= true;
end;

procedure clickout;
begin
waitFunc(@Findthing,WaitPerLoop,maxtime);//example waitperloop = 300, maxtime 10000(10 sec)
if Findthing then
begin
//code here to close thing
end;

end;

begin //main loop
clickout;

end;



or



procedure clickout; forward;

procedure reset;
begin
clickout;
end;

Function Findthing:boolean;
begin
if "find code here" then
Result:= true;
end;

procedure clickout;
begin
repeat
wait(1000);
until(Findthing);

if Findthing then
begin
//code here to close thing
reset;
end;
end;

begin //main loop
clickout;

end;




edit: code should work.

links to check out.
the waitfunc (http://docs.villavu.com/srl-6/time.html)
Loops (https://www.youtube.com/watch?v=PjIE2nfhRT0&list=PLnHD8Bhe1x8U6ecAy8d8hXYnpcwovvXag&index=5)
creating basic functions (https://www.youtube.com/watch?v=MZQsHt8R29M&list=PLnHD8Bhe1x8U6ecAy8d8hXYnpcwovvXag&index=6)
Forwarding Functions/procedures (https://www.youtube.com/watch?v=sk7IBp04608&index=7&list=PLnHD8Bhe1x8U6ecAy8d8hXYnpcwovvXag)
Thanks for the feedback!
Watching you youtube videos right now :p

rj
03-23-2016, 12:07 AM
Thanks for the feedback!
Watching you youtube videos right now :p

depending on the server you could do 317_closeInterface(I think thats what it's called? not sure)

ALLINSEO
01-27-2017, 01:10 PM
I am trying to run the basic default script you provided and I get the following errors:
[ERROR]
Exception in Script: Unknown compiler directives at 13:3
[ERROR]

I have been trying for hours following multiple guides on how to get SMART to work on a rsps from what I learned.

1. the server must use DirectX or OpenGL in order to use smart.
2. you may be able to load local html file that loads your jar applet.
3. may be able to use "smartCurrentTarget" in order to set client? (does not work when I try)

QUESTIONS
1. how do you test or know if they run DirectX or OpenGL.
2. I am not sure how to load this file. (I know how to make localhost:80 load)

SERVER
also the server im trying to run SMART on is PkHonor.
it would be nice to know if it is even possible on their server or should I give up.

HolyScripts
03-17-2017, 08:06 PM
very nice