SRL Archive - Archive

Syntax - SRL Member Application


Syntax

2013-08-14 07:42:30

How Long have You Played Runescape?
6 Year(s)


Are you affilated in anyway with Jagex LTD?
No

Were you Referred to SRL?
Yes, Yohojo referred me.


What is your general programming knowledge?
HTML
CSS
XHTML
Javascript{ I am going to wrap up these languages by showcasing some websites I have developed for people (freelancing) from worst to best;
http://worc.com.au/index.html
http://www.driveshaftbalancingservices.com.au/
}


Ruby- I have made amplification and chargen scripts for booters using Ruby and have a fairly good knowledge of them.

Pascal- I have made scripts for Simba, I enjoy Pascal more than Java for example because it makes more sense :-)

Java- I have made scripts for other botting communities using java and I know how operators, switch statements, multiple classes and etc work and have worked with Java more than any other language.


Are you a member of any other communities?
Sythe
Hackforums
Powerbot
Epicbot


Tell us about yourself…
From: Syntax
My Association with computers started when I was around 9 years old, when I first found out about Runescape in 2006. I would play this game for 4 hours a day and It eventually got to the point where I realized I was spending time on Runescape that I would otherwise be spending with friends. So I found out about a site that sold Runescape bots and bought a few. They were NeXus bots which were really high quality. Since then I have been interested in the workings of computers. I quit Runescape around 2010, but I would buy membership for the sole reason of scripting bots in Java (most of it was copied and pasted back then shhh lol).

Currently I am in highschool, I have 5 TEE subjects and I am trying to get into university my subjects are;
Chemistry, Physics, Maths, English and Tech graphics
I am in my second last year of Highschool, year 11 and hence I am 16 years old.
Not much else to say, I enjoy sports and I am fairly chill.



Please show us one (or multiple) of your scripts.
{Made by Blakebn2011 from SRL Forums (Version: Public Release)
Credit goes to Riwu, Yohojo, Turpinator, Flight and the coders of the SRL
repository.
Thank you and happy botting}

program Herb_Identifier;
{$i SRL-OSR/SRL.Simba}
Var
DTM_Bank,DTM_Cookingpot, DTM_Herb, DTM_Pot:Integer;
Status:String;

Const
//SRL Stats
SRLStats_Username = '';
SRLStats_Password = '';
Amount = '27'; //No need to change this yet, until energy potion support

Procedure declarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := ''; //username
Pass := ''; //password
Nick := ''; //display name
Pin := ''; //bank pin
LampSkill := Skill_Agility;
WorldInfo := [];
Member := True;
Active := True;
end;
end;
procedure Antiban;
begin
if not loggedin then
exit;
case Random(70) of
9: RandomRClick;
26: HoverSkill('Agility', False);
35: PickUpMouse;
63: RandomMovement;
15: BoredHuman;
59: ExamineInv;
end;
end;

Procedure WriteStatus;
begin
if not loggedin then
exit;
Wait(400);
ClearDebug;
Writeln('Status:' + status);
end;

Procedure FreetheDTMs;
Begin
FreeDTM(DTM_Bank);
FreeDTM(DTM_Cookingpot);
FreeDTM(DTM_Herb);
FreeDTM(DTM_Pot);
end;

Procedure LoadDTM;
Begin
if not loggedin then
exit;
DTM_Bank := DTMFromString('mWAAAAHicY2FgYPjExMDwGYg/AvFXIL4MFDsPxDeA+CoQxwYyMlzcZwPH6IARDYMAAAWYDTs=');
DTM_Cookingpot := DTMFromString('mQwAAAHicY2ZgYGBkhmAOIP4E5H8D4s8gcUZGBn9VFgZDMUYGZMCIhIEAAKTnA7g=');
DTM_Herb := DTMFromString('mWAAAAHicY2FgYJjCxMAwC4j7mCBsM6CYERTrA7FhCSMDIyMCowNGNAwCAAx8A9k=');
DTM_Pot := DTMFromString('mbQAAAHicY2VgYIhgguB4II4C4jggdgKKWzNAaE8gdgXiBb6CDIyMjCgYG2DEgsEAAFlRBDM=');
end;
Function CheckInvCoins(): boolean;
var
x, y: integer;
begin
if not loggedin then
exit;
Writeln('Finding Coins in Inventory');
Result := false;
if FindColorTolerance(x, y, 1750752, MIX1, MIY1, MIX2, MIY2, 15) then
begin
Result := true;
Writeln('Found Coins in Inventory');
end;
end;

function IsInBank(): boolean;
var
Dist_To_Bank,c,b,t,u,Dist_To_Cookingpot:Integer;
begin
if not loggedin then
exit;
Status := 'Outside of the bank';
Result := false;
FindDTM(DTM_Bank, c, b, 524, 3, 762, 168);
FindDTM(DTM_Cookingpot, t, u, 524, 3, 762, 168);
Dist_To_Bank := Distance(c, b, 643, 83);
Dist_To_Cookingpot := Distance (t, u, 643, 83);
Writeln('Current Distance from Bank symbol:' + ToStr(Dist_To_Bank));
Writeln('Current Distance from Cookingpot symbol:' + ToStr(Dist_To_Cookingpot));
If (Dist_To_Bank <= 20) And
(Dist_To_Cookingpot <= 42) then
Begin
Status := 'Inside of the Bank';
Result := true;
end;
end;

function IsInIdentifer(): boolean;
var
c,b,o,p, Dist_To_Pot,Dist_To_Herb:Integer;
begin
if not loggedin then
exit;
Status := 'Outside of the identifier';
Result := false;
FindDTM(DTM_Herb, o, p, 524, 3, 762, 168);
FindDTM(DTM_Pot, c, b, 524, 3, 762, 168);
Dist_To_Herb := Distance(o, p, 643, 83);
Dist_To_Pot := Distance (c, b, 643, 83);
Writeln('Current Distance from Pot symbol:' + ToStr(Dist_To_Pot));
Writeln('Current Distance from Herb symbol:' + ToStr(Dist_To_Herb));
If (Dist_To_Herb <= 12) And
(Dist_To_Pot <= 36) then
Begin
Status := 'Inside of the identifier';
Result := true;
end;
end;


Function OpenBankBooth:Boolean;
var
TPA : TPointArray;
ATPA : T2DPointArray;
x, y, i, ii:Integer;
begin
if not loggedin then
exit;
Result:= False;
if BankScreen then
begin
Result:= True;
Writeln('Bank Found');
Exit;
end;
MakeCompass('W');
Wait(300); //screen settle
FindColorsTolerance(TPA, 2445165, 107, 9, 385, 283, 5);
ATPA := SplitTPAEx(TPA, 10, 10);
SortATPAFromFirstPoint(ATPA, Point(MSCX, MSCY));
ii := High(ATPA);
for i := 0 to ii do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 3, 3);
if WaitUpTextMulti(['ooth', 'ank boo'], 300) then
begin
Mouse(x, y, 0, 0, False);
Wait(200);
WaitOptionMultiEx(['ank', 'uickly'], 'all', ClickLeft, 200);
Flag;
Wait(2000 + Random(800));
if BankScreen then
begin
Result:= True;
Writeln('Bank Found');
Exit;
end;
end;
end;
end;
procedure WalkToBank;
begin
if not loggedin then
exit;
Setrun(true);
MakeCompass('n');
RadialWalkTolerance(6062216, 180, 176, 80, 1, 1, 10);
writeln('We are walking');
repeat
If IsMoving then
wait(600+RandomRange(100,80));
until not IsMoving;
end;
procedure WalkToIdentifer;
begin
if not loggedin then
exit;
Setrun(true);
MakeCompass('n');
RadialWalkTolerance(6062216, 352, 348, 80, 1, 1, 10);
writeln('We are walking');
repeat
If IsMoving then
wait(600+RandomRange(100,80));
until not IsMoving;
end;
Procedure DoPin;
begin
if not loggedin then
exit;
if PinScreen then
if (Players[CurrentPlayer].Pin <> '') then
InPin(Players[CurrentPlayer].Pin)
else
writeln('No pin given, logging out');
exit;
end;

Procedure get_herbs;
var
x, y:integer;
begin
if not loggedin then
exit;
if not IsInBank then
WalkToBank;
repeat
If IsMoving then
wait(600+RandomRange(100,80));
until not IsMoving;
Begin
Wait(200); //Sometimes there is a little lag
if FindDTM(DTM_Herb, x, y, MSX1, MSY1, MSX2, MSY2) then
else
writeln('Did not find the herbs');
Begin
Writeln('Found Herbs');
MMouse(x, y, 3, 3);
Mouse(x, y, 0, 0, false);
wait(300+randomrange(300,500));
WaitOption('raw X', 2000);
Wait(300+randomrange(100,200));
SendKeys(Amount, 20+randomrange(20,30), 20);
wait(200+randomrange(20,40));
SendKeys(Chr(13), 20, 10);
end;
end;
end;

procedure identify_herbs;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
X, Y, Z: Extended;
begin
if not loggedin then
exit;
if not IsInIdentifer then;
WalkToIdentifer;
repeat
If IsMoving then
wait(600+RandomRange(100,80));
until not IsMoving;
If CheckInvCoins then
else
begin
writeln('Please place at least 5400 coins in your inventory for one trip');
exit
end;
If not IsMoving and IsInIdentifer then
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.00, 0.34);
if not(FindColorsTolerance(arP, 12829642, MSX1, MSY1, MSX2, MSY2, 3)) then
begin
Writeln('Failed to find Zahur, PM Syntax or post on the thread');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);
Antiban;

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 50.06) and (X <= 57.81) and (Y >= 51.45) and (Y <= 59.94) and (Z >= 54.84) and (Z <= 64.40) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;

SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 10, 10);
arL := High(ararP);

for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if WaitUptext('ahur', 2000) then
Mouse(P.x, P.y, 0, 0, false);
WaitOption('enti', 2000);
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
begin
Writeln('No NPC found, maybe we are in a random?');
end;
end;
end;

begin
AddOnTerminate('FreetheDTMs');
SetupSRL;
DeclarePlayers;
LoginPlayer;
FreeTheDTMs;
LoadDTMs;
If Not IsInBank then
WalkToBank;
get_herbs;
Antiban;
CheckInvCoins;
If IsInBank then
WalkToIdentifer;
identify_herbs;
end.

Let me just mention what this script does, the script identifies UNIDs by a NPC in the desert called Zahur. He identifies them for 200gp each and the bank is within two buildings of the identifier.
This script isn't for identifying herbs in the inventory.

riwu

2013-08-14 08:08:18


Procedure FreetheDTMs;
Begin
if not loggedin then
exit;
FreeDTM(DTM_Bank);
FreeDTM(DTM_Cookingpot);
FreeDTM(DTM_Herb);
FreeDTM(DTM_Pot);
end;
Wouldn't you want to free the dtms even if you are not logged in ;)
Also FreetheDTMs() isn't called anywhere. (Probably best to use AddOnTerminate())


if FindColorTolerance(x, y, 1750752, MIX1, MIY1, MIX2, MIY2, 15) then
Result := true;
Writeln('Found Coins in Inventory');
'begin' and 'end' are needed to indicate the statement block, otherwise the final statement will always be executed.


Dist_To_Bank := Distance(c, b, 643, 83);
The variables c,b have the default value of 0. I presume you meant it to be x, y?


Is OpenBankBooth() made solely by you?



if FindDTM(DTM_Herb, x, y, MSX1, MSY1, MSX2, MSY2) then
else
Could be

if not FindDTM(DTM_Herb, x, y, MSX1, MSY1, MSX2, MSY2) then
for more straightforward flow.

Identify_herbs() looks like ACA-generated code, you should credit it in the source.


Overall, there are some areas that you can improve on (such as coding style, creating your own array manipulation methods etc). Your positive learning attitude is commendable though. Keep learning and you will be there in no time :)

Syntax

2013-08-14 08:37:27

From: riwu

Procedure FreetheDTMs;
Begin
if not loggedin then
exit;
FreeDTM(DTM_Bank);
FreeDTM(DTM_Cookingpot);
FreeDTM(DTM_Herb);
FreeDTM(DTM_Pot);
end;
Wouldn't you want to free the dtms even if you are not logged in ;)
Also FreetheDTMs() isn't called anywhere. (Probably best to use AddOnTerminate())


if FindColorTolerance(x, y, 1750752, MIX1, MIY1, MIX2, MIY2, 15) then
Result := true;
Writeln('Found Coins in Inventory');
'begin' and 'end' are needed to indicate the statement block, otherwise the final statement will always be executed.


Dist_To_Bank := Distance(c, b, 643, 83);
The variables c,b have the default value of 0. I presume you meant it to be x, y?


Is OpenBankBooth() made solely by you?



if FindDTM(DTM_Herb, x, y, MSX1, MSY1, MSX2, MSY2) then
else
Could be

if not FindDTM(DTM_Herb, x, y, MSX1, MSY1, MSX2, MSY2) then
for more straightforward flow.

Identify_herbs() looks like ACA-generated code, you should credit it in the source.


Overall, there are some areas that you can improve on (such as coding style, creating your own array manipulation methods etc). Your positive learning attitude is commendable though. Keep learning and you will be there in no time :)


Hey Riwu, thanks for leaving a reply.
Firstly I can't believe I forgot about the AddOnTerminate, I always add it when using DTMs this thread: http://villavu.com/forum/showthread.php?t=93319&highlight=AddOnTerminate (More specifically that script) will prove it.

simba]
Dist_To_Bank := Distance(c, b, 643, 83);

The variables c,b have the default value of 0. I presume you meant it to be x, y?

Sort of, I missed those in declaring variables.
OpenBankBooth is a procedure I found in a script of Turpinator's I believe (I have referenced at the top of the script).

Thank you for your reply Riwu, you have enlightened me. I should have checked the script before submitted.

Turpinator

2013-08-14 10:12:53

From: Syntax

OpenBankBooth is a procedure I found in a script of Turpinator's I believe (I have referenced at the top of the script).


That doesnt look like something i would have wrote. I always use CTS2 and never spiral color find.

Even though you wrote credit/etc at the top, if you copy a function/snippet, its always nice to note it on the function itself too so people can see exactly where it came from and dont have to guess.

Syntax

2013-08-15 07:44:29

Thanks for voting guys, guess it's a no. Mods feel free to archive.

Ashaman88

2013-08-15 08:10:58

From: Syntax
Thanks for voting guys, guess it's a no. Mods feel free to archive.


After 7 votes? It's hardly even started!

Syntax

2013-08-17 08:07:00

From: Turpinator
That doesnt look like something i would have wrote. I always use CTS2 and never spiral color find.

Even though you wrote credit/etc at the top, if you copy a function/snippet, its always nice to note it on the function itself too so people can see exactly where it came from and dont have to guess.


Hmm, just read this. I will go through my history and see where I adapted it from, might have been from a tutorial.
Thanks for the suggestion, and my apologies for adding you into the credits incorrectly.

King

2013-08-23 12:51:56

Function CheckInvCoins(): boolean;
var
x, y: integer;
begin
if not loggedin then
exit;
Writeln('Finding Coins in Inventory');
Result := false;
if FindColorTolerance(x, y, 1750752, MIX1, MIY1, MIX2, MIY2, 15) then
begin
Result := true;
Writeln('Found Coins in Inventory');
end;
end;

Does this work well if something other than the coins happens to be in the inventory? I didnt see it anywhere but I am assuming because you are identify herbs it is 07, correct? My only concern would be something such as a genie random even or something with a similar colour because you just use a colour tolerance instead of a DTM ect. I would generally stick to a DTM in the inventory just in case something else manages to find its way in there.

Also for the location finding such as this
  function IsInIdentifer(): boolean;
var
c,b,o,p, Dist_To_Pot,Dist_To_Herb:Integer;
begin
if not loggedin then
exit;
Status := 'Outside of the identifier';
Result := false;
FindDTM(DTM_Herb, o, p, 524, 3, 762, 168);
FindDTM(DTM_Pot, c, b, 524, 3, 762, 168);
Dist_To_Herb := Distance(o, p, 643, 83);
Dist_To_Pot := Distance (c, b, 643, 83);
Writeln('Current Distance from Pot symbol:' + ToStr(Dist_To_Pot));
Writeln('Current Distance from Herb symbol:' + ToStr(Dist_To_Herb));
If (Dist_To_Herb <= 12) And
(Dist_To_Pot <= 36) then
Begin
Status := 'Inside of the identifier';
Result := true;
end;
end;
would a third point being added into the mix help it be more accurate? Ive found triangulation better in my experience, I think it would show forethought for run time, but if it works, it works ;)


Function OpenBankBooth:Boolean;
var
TPA : TPointArray;
ATPA : T2DPointArray;
x, y, i, ii:Integer;
begin
if not loggedin then
exit;
Result:= False;
if BankScreen then
begin
Result:= True;
Writeln('Bank Found');
Exit;
end;
MakeCompass('W');
Wait(300); //screen settle // I would add a bit of randomness to this.
FindColorsTolerance(TPA, 2445165, 107, 9, 385, 283, 5); // I would add an If...then statement here to improve debug ability.
ATPA := SplitTPAEx(TPA, 10, 10); // Also adding else.. statements will give you the ability to have fail safes.
SortATPAFromFirstPoint(ATPA, Point(MSCX, MSCY));
ii := High(ATPA);
for i := 0 to ii do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 3, 3);
if WaitUpTextMulti(['ooth', 'ank boo'], 300) then
begin
Mouse(x, y, 0, 0, False);
Wait(200);
WaitOptionMultiEx(['ank', 'uickly'], 'all', ClickLeft, 200);
Flag;
Wait(2000 + Random(800));
if BankScreen then
begin
Result:= True;
Writeln('Bank Found');
Exit;
end;
end;
end;
end;

Another issue that I am seeing is a lack of fail safes after code like this
      if BankScreen then
begin
Result:= True;
Writeln('Bank Found');
Exit;
end;
end;
end;
end;
, what happens if it didnt find its way to the bank screen? It will bug out on you, so always good to have some else.. statements or backup in there.

Procedure get_herbs;
var
x, y:integer;
begin
if not loggedin then
exit;
if not IsInBank then
WalkToBank;
repeat
If IsMoving then
wait(600+RandomRange(100,80));
until not IsMoving;
Begin
Wait(200); //Sometimes there is a little lag// should have added randomness here as well
if FindDTM(DTM_Herb, x, y, MSX1, MSY1, MSX2, MSY2) then
else // Im not sure what was meant to be going on here, maybe change it to a "if not" and move the else under the writeln?
writeln('Did not find the herbs');
Begin
Writeln('Found Herbs');
MMouse(x, y, 3, 3);
Mouse(x, y, 0, 0, false);
wait(300+randomrange(300,500));
WaitOption('raw X', 2000);
Wait(300+randomrange(100,200));
SendKeys(Amount, 20+randomrange(20,30), 20);
wait(200+randomrange(20,40));
SendKeys(Chr(13), 20, 10);
end;
end;
end;

Maybe add a begin staement under NotIsInTheBank, so that it will perform all of those only when it is not at the bank ect? This is a straightforeward mainloop, but it could benefit from either some case statements or if then, this will ensure it can handle any problems that arrise, in its current state, if it fails to walk to the bank, combined with lack of otehr failsafes, it will fail.
begin
AddOnTerminate('FreetheDTMs');
SetupSRL;
DeclarePlayers;
LoginPlayer;
FreeTheDTMs;
LoadDTMs;
If Not IsInBank then
WalkToBank;
get_herbs;
Antiban;
CheckInvCoins;
If IsInBank then
WalkToIdentifer;
identify_herbs;
end.



Overall the script is okay, could use some work. However the attitude so far is great and a good sign! I am going to go read through some posts of yours, get a feel for you because I have never talked to you before. So for now, I am going to sit on my vote.

Keep up the attitude, it is a great benefit to have when being voted upon!