SRL Archive - Archive

Mr. Roboto - SRL Member Application


Mr. Roboto

2014-08-28 02:53:08

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


Are you affilated in anyway with Jagex LTD?
No

Were you Referred to SRL?



What is your general programming knowledge?
Java, C#, C++, C, Object Oriented programming & Design Patterns.


Are you a member of any other communities?
Nope.


Tell us about yourself…
From: Mr. Roboto
I am currently finishing my PhD in Computer Science. I should graduate if my advisor stops thinking of his students as slaves. I teach and build video games for a very small company. I love building and designing good software, plus I really love Design Patterns.

I started to play runescape back in classic. I stopped playing around 2005, but I return to play on and off sometimes. I botted a bit around 2012 but now I am more serious about botting the heck out of RS. I wrote a script in 30 mins or an hour after The Mayor encouraged me in the forums, so I thank him for that. [EDIT] I have kept working on the script after that.

A bit of personal information: I am in my late twenties. I live in USA. I consider myself respectful but easy going. I enjoy all sorts of music, but I mostly enjoy rock and blues or 80s. My favorite shows, in no particular order: It’s Always Sunny in Philly, Game of Thrones, Generation Kill, Rome, Lost, House, X-Files. (I guess I been watching a lot of TV lately lol).


I hope you consider my application.

Thanks,
Mr. Roboto



Please show us one (or multiple) of your scripts.
// You can download the script from the thread:

// https://villavu.com/forum/showthread.php?t=109817&p=1303571#post1303571

program MrRoboto_RD_ThievingCrafting;

{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{$I SPS/lib/SPS-RS3.Simba}


const
VERSION = '3.4';
isCRAFTER = true;

// In hours.
MIN_EXECUTION_TIME = 2;
MAX_EXECUTION_TIME = 5;

var
startXP : integer;
previousXPGained : integer;

uncutGem_DTM : integer;
cutGem_DTM : integer;

finalExecutionTime : integer;

// Log in.
procedure logIn()
begin
setLength(players, 1);
with players[0] do
begin
loginName := ''; // username
password := ''; // password
isActive := true;
isMember := true;
end
currentPlayer := 0;

end;


// Random handler.
procedure findRandoms();
begin
exitTreasure();
claimTicket();
end;


// Antiban.
procedure antiBan()
var
i: integer;
begin
i := random(1500);

writeLn('Starting Antiban.');

case i of
1..4 : boredHuman(true);
5..20: begin
hoverSkill(SKILL_THIEVING);
wait(gaussRangeInt(1500, 5000));
end;

21..23: mouseMovingObject();
24..34: sleepAndMoveMouse(randomRange(100, 6000));

35..45: begin
mouseOffClient(Random(4));
wait(randomRange(2000, 15000));
end;

46..50: wait(randomRange(1000, 2000));
51..63: pickUpMouse();

64..65: begin
powersScreen.open();
wait(randomRange(1000, 3000));
powersScreen.openTab(random(5 + 1));
wait(randomRange(2000, 4000));

if random(2) = 1
then powersScreen.openSubTab(random(2));

powersScreen.close();
end;

66..70: smallRandomMouse();
71..80: begin
hoverSkill(SKILL_CRAFTING);
wait(gaussRangeInt(1500, 5000));
end;
end;
end;


// Prints a report of the bot.
procedure progressReport()
var
PAD : integer;
xpGained : integer;
xpPerHour : integer;
begin
PAD := 42;

previousXPGained := xpGained;

xpGained := chatBox.getXP() - startXP;
xpPerHour := round(xpGained * 3600000.0 / getTimeRunning());

// Print proggy.
clearDebug();
writeLn('||----------------------------------------||');
writeLn(padR('|| Mr. Roboto - RD Thieving/Craft (Rev. ' + VERSION + ')', PAD) + '||');
writeLn(padR('||', PAD) + '||');
writeLn(padR('|| Time running: ' + msToTime(getTimeRunning(), TIME_SHORT), PAD) + '||');
writeLn(padR('|| Experience earned: ' + toStr(xpGained) + ' (' + toStr(xpPerHour) + ' PH)', PAD) + '||');
writeLn('||----------------------------------------||');
end;


procedure cleanUp()
begin
FreeDTM(uncutGem_DTM);
FreeDTM(cutGem_DTM);
end;


// Stops the script. Logs the reason for terminating.
procedure stopScript(exception : string)
begin
wait(randomRange(2000, 3000));
progressReport();
writeLn('');
writeLn('Termination reason: ' + exception);
writeLn('');
writeLn('Post all proggys on the thread if you want updates.');
writeLn('------------------------------------------');
writeLn('');
players[currentPlayer].logout();

cleanUp();
terminateScript();
end;


// Returns XP from the XP bar in the chatbox. Made by Ashaman88.
function TRSChatBox.getXP(): integer;
var
b: TBox;
s: String;
tpa : TPointArray;
atpa : T2DPointArray;
i,p: Integer;
begin
B := self.getBounds();
B.edit(+(b.x2-b.x1)-140, +10, -5, -94);

findColorsTolerance(TPA, 14013909, b, 4, colorSetting(2, 0.00, 0.00));

if length(TPA) < 2 then
begin
writeLn('chatBox.getXP(): No XP found!');
exit;
end;

ATPA := tpa.cluster(5);

B := atpa.getbounds();
B.edit(-2, -2, +2, +3);
S := replace(tesseractgettext(B.x1, B.y1, B.x2, B.y2, FILTER_SMALL_CHARS), ' ', '', [rfReplaceAll]);
P := pos('x', S);

if P > 0 then
result := strToIntDef(extractFromStr(copy(S, P, length(S)), numbers), 0)
else
result := strToIntDef(extractFromStr(S, numbers), 0);

//writeLn('chatBox.getXP(): XP found: ' + toStr(result));
end;


// Tries to unlock the safe.
procedure unlockSafe()
var
x, y : integer;
failCount : integer;
found : boolean;

begin
// Loop until a safe is found.
repeat

// Search for a safe.
if mainscreen.findObject(x, y, 10722709, 3, ['rack Wall safe'], MOUSE_MOVE)
then begin
mouse(x, y, -20, 20, MOUSE_LEFT);

// Antiban stuff.
findRandoms();
antiBan();

// Safe was found, so we can exit loop.
found := true;

end

// Check if we failed to find the safe too many times.
else if failCount >= 2
then begin
stopScript('[Failed too many times to find the safe]');
end

// Increment failCount.
else
failCount := failCount + 1;

// Loop condition.
until found = true;

end;


// Does the actual crafting of the gems.
procedure productionManager()
begin
if productionScreen.isOpen(3000)
then begin
productionScreen.selectBox(3); //whatever box
productionScreen.clickStart(); //click start

if progressScreen.isOpen(2000)
then repeat
wait(100);
antiBan(); //wait until cancel button is no longer up
until progressScreen.getButton() <> PROGRESS_BUTTON_CANCEL;
end;
end;


// Crafts what ever DTM is given. Useful for uncut gems and cut gems.
// Parameter is passed by reference.
procedure craftGems(var dtm : integer)
var
isDone : boolean;
x, y: integer;
begin
isDone := false;

// Repeat until done with all types of gems in bag.
repeat
if(findDTM(dtm, x, y, tabBackPack.getBounds()))
then begin
mouse(x, y, 5, 5, MOUSE_LEFT);

productionManager();

antiBan();

end

else
isDone := true;

until isDone = true;

end;


procedure setupDTMs()

begin
// DTM belongs to The Mayor.
uncutGem_DTM := DTMFromString('m1gAAAHic42JgYNjExMCwDYhXAvESJgh/JxTvAuLVUDkuIGYGYkYg5gZiMSDmBWJRIBaB0iBcISEINJUJB2aEs/8zEAcYicQIAABXaglk');

// First DTM by me.
cutGem_DTM := DTMFromString('m6wAAAHiclczNCkBgEIXhg5KSG2BhY2NngfwmFti4ZNfGG1+x5NTTnGlqfEmdK02YjRUDSuQoUKHF6NDRYMCCzVid+96jRrZHfLflhck1JesSxKnZH4e+x/rhlROkwwif');

end;


// Will put the character to rest(sit down). From The Mayor.
procedure TRSMinimap.rest();
var
p: TPoint;
begin
p := self.button[MM_BUTTON_RUN].center;

if (not self.isResting()) then
begin
mouseCircle(p.x, p.y, self.button[MM_BUTTON_RUN].radius, MOUSE_RIGHT);
chooseOption.Select(['Rest']);
end;
end;


// Checks HP and then rests the player.
procedure hpManager()
begin

// Check if HP is less than the numbers between 20 and 30.
if(actionbar.getHPPercent() < randomRange(40, 50))
then begin

minimap.rest();

wait(1000);
// Check if we are actually resting.
if(minimap.isResting() = false)
then stopScript('[Failed to rest]');

repeat
wait(randomRange(1000, 2000));
antiBan();

until actionbar.getHPPercent() > randomRange(80, 90);
end;
end;


// Will put the bot in break mode.
// TODO: return from break.
procedure breakSystem()
begin
if(getTimeRunning() > finalExecutionTime)
then stopScript('[Taking a break]');
end;


// Main.
begin
clearDebug();
//smartEnableDrawing := true;
setupSRL();

logIn();

if not isLoggedIn()
then begin
players[currentPlayer].login();
wait(randomRange(1500, 3000));
minimap.setAngle(MM_DIRECTION_NORTH);
findRandoms();
end;

setupDTMs();

mainscreen.setAngle(MS_ANGLE_HIGH);

// Calculate break time. 3600000 => 60*60*1000.
finalExecutionTime := randomRange(MIN_EXECUTION_TIME, MAX_EXECUTION_TIME) * 3600000;

// Store the xp you started with.
startXP := chatBox.getXP();

// Bot logic.
repeat
repeat
// Check if still loggedIn.
if not isLoggedIn()
then stopScript('[Logged out]');

// Check if we need a break.
breakSystem();

// Find randoms, just incase.
findRandoms();

// Start unlocking the safe.
unlockSafe();

// Print proggy.
progressReport();

// Heal if needed.
hpManager();

wait(randomRange(7550, 9013));

until tabBackPack.isFull();

if(isCRAFTER = True)
then begin
craftGems(uncutGem_DTM);

wait(randomRange(1200, 3000));
antiBan();
craftGems(cutGem_DTM);

// Check if bag is still full.
if(tabBackPack.isFull())
then stopScript('[Bag is still full, failed to craft]');

antiBan();

end

else
tabBackPack.dropItems(DROP_PATTERN_SNAKE);

until false;

end.

NKN

2014-08-28 07:08:22

I'm gonna have to vote no for a few reasons.

The main one is that you just aren't active enough.

Some other reasons are some small code things, such as

repeat
if(findDTM(dtm, x, y, tabBackPack.getBounds()))
then begin
mouse(x, y, 5, 5, MOUSE_LEFT);

productionManager();

antiBan();

end

else
isDone := true;
until(isDone);


If the DTM breaks and it finds cut gems, for example, then you'd have an infinite loop going.


Another thing is you use Mainscreen.findObject
This doesn't show that you have an advanced understanding of scripting which is needed to become an SRL Member.

Then just a small thing here:

procedure craftGems(var dtm : integer)

You don't need to write var infront of the variable unless you intend to modify it. I don't see you doing anything like that in the procedure so just do

procedure craftGems(dtm : Integer)



Don't get me wrong, you have some great things here such as comments and standards, but I'm going to need to see a little more advanced ability before I vote yes.

slacky

2014-08-28 07:55:52

Hmm.. I guess I can allow my self to vote Yes :smile:

Enslaved

2014-08-28 19:44:24

Sorry, No from me, The script looks way too basic, the only place you use any form of colour finding was


if mainscreen.findObject(x, y, 10722709, 3, ['rack Wall safe'], MOUSE_MOVE)


//And

if(findDTM(dtm, x, y, tabBackPack.getBounds()))

The only thing I thought was impressive was the exp finder… … Until I realised it was written by ashaman

// Returns XP from the XP bar in the chatbox. Made by Ashaman88.
function TRSChatBox.getXP(): integer;
var
b: TBox;
s: String;
tpa : TPointArray;
atpa : T2DPointArray;
i,p: Integer;
begin
B := self.getBounds();
B.edit(+(b.x2-b.x1)-140, +10, -5, -94);

findColorsTolerance(TPA, 14013909, b, 4, colorSetting(2, 0.00, 0.00));

if length(TPA) < 2 then
begin
writeLn('chatBox.getXP(): No XP found!');
exit;
end;

ATPA := tpa.cluster(5);

B := atpa.getbounds();
B.edit(-2, -2, +2, +3);
S := replace(tesseractgettext(B.x1, B.y1, B.x2, B.y2, FILTER_SMALL_CHARS), ' ', '', [rfReplaceAll]);
P := pos('x', S);

if P > 0 then
result := strToIntDef(extractFromStr(copy(S, P, length(S)), numbers), 0)
else
result := strToIntDef(extractFromStr(S, numbers), 0);

//writeLn('chatBox.getXP(): XP found: ' + toStr(result));
end;

My advice would be to try something that can reflect your skill level. It is not just about how well somethings work, it is also about the mathematical concepts, the flow logic (and some fancy dynamic graphics that makes it look good) that make a script good.


If 30 mins is what you value the Supreme Title of SRL member to be, I guess that explains it :)

Mr. Roboto

2014-08-29 03:24:02

From: NKN

Some other reasons are some small code things, such as

repeat
if(findDTM(dtm, x, y, tabBackPack.getBounds()))
then begin
mouse(x, y, 5, 5, MOUSE_LEFT);

productionManager();

antiBan();

end

else
isDone := true;
until(isDone);


If the DTM breaks and it finds cut gems, for example, then you'd have an infinite loop going.


Another thing is you use Mainscreen.findObject
This doesn't show that you have an advanced understanding of scripting which is needed to become an SRL Member.

Then just a small thing here:

procedure craftGems(var dtm : integer)

You don't need to write var infront of the variable unless you intend to modify it. I don't see you doing anything like that in the procedure so just do

procedure craftGems(dtm : Integer)



Don't get me wrong, you have some great things here such as comments and standards, but I'm going to need to see a little more advanced ability before I vote yes.


I am passing by reference the DTM so that it doesn't make a copy of the variable's content inside of the procedure when it is called. I wanted to save memory.

I'll recheck my logic for the if statement. However, I think that if it fails to find the DTM then it will exit the loop because of the else making

isDone := true;

so I don't think it's an endless loop.


From: Enslaved


If 30 mins is what you value the Supreme Title of SRL member to be, I guess that explains it :)



I might have worded my paragraphs above wrong; I was thinking about changing it earlier today before I read your post. I meant that the initial version of the script took 30 mins. I have worked on it more after that.

I do thank you both for posting; even if it is a No, I still feel your post are better than just a No without knowing why. Thanks.

From: slacky
Hmm.. I guess I can allow my self to vote Yes :smile:


Thank you.

Clarity

2014-08-29 03:39:01

From your posts and material, I get the sense that you have the talent and ability to learn how to script more in-depth than this. Looks like this app is moving towards no, but I certainly see you being fine in your next app with a more complex script. Keep up the unique content :)

superuser

2014-08-29 05:44:43

Yes!

Press Play

2014-08-29 05:47:29

From: Clarity
From your posts and material, I get the sense that you have the talent and ability to learn how to script more in-depth than this. Looks like this app is moving towards no, but I certainly see you being fine in your next app with a more complex script. Keep up the unique content :)

+1, 100% agree with this.

Basically, we want to see a more advanced script (that we know you're capable of). Some things to include are more advanced colour-finding with TPA/ATPAs; best used in custom object finding functions. I'm going to chuck a yes vote based on your mature attitude. Everyone keeps learning once accepted into SRL Members.

The Mayor

2014-08-29 07:20:55

From: Mr. Roboto
However, I think that if it fails to find the DTM then it will exit the loop because of the else making

isDone := true;

so I don't think it's an endless loop.


He means that if you somehow end up with another item in your backpack that matches the gem DTM (a false positive) then you would be in an infinite loop.



I'm voting no because:

  • We [normally] have quite strict requirements with how you deal with colour finding (seeing as we use colour for everything). In the past relying purely on findObj was a no vote. We like to see that you understand how to use and manipulate TPAs. Yes SRL6's findObject uses TPAs under the hood, but it doesn't count as it doesn't demonstrate your ability.
  • There are a few thing throughout your script. No need to output the dtm in this procedure; you only use it as an input parameter: procedure craftGems(var dtm : integer)
  • Considering you are finishing your PhD in comp sci I think you can pick up these things in no time :)
  • It looks like you came back 20 days ago from a long break, and got enough posts for junior. I would have voted yes if you were a bit more active and you had contributed more.

slacky

2014-08-29 07:51:55

From: The Mayor

I'm voting no because:
  • …
  • There are a few thing throughout your script. No need to output the dtm in this procedure; you only use it as an input parameter: procedure craftGems(var dtm : integer)

He is passing it by Reference, he is not "outputting" it, he is simply avoiding a unneeded copy. This is to save memory (does not make a copy), and avoid some overhead (doesn't require copy call). But considering he is not changing it, a constant (reference) would be better suited. But as he is only passing an Integer, which represents the `ID` of the DTM (held by Simba), it's not that useful, but I could say it's still better then passing by value.

Whereas if you pass by value, you will be making a copy each time you call the function (causing some unneeded overhead), but only a soft copy (will be pointing to the same mem until changed).

Turpinator

2014-08-29 08:28:41

From: slacky
But as he is only passing an Integer, which represents the `ID` of the DTM (held by Simba), it's not that useful, but I could say it's still better then passing by value.


slacky beat me to the 'weirdness' of a dtm. but think. we define DTMs as integers… so you think somehow that DTM structure (Main Point, sub points, and colors) is stored in a simple type?


(i say 'you' but i dont mean you specifically. like everyone. :))

The Mayor

2014-08-29 08:40:59

From: slacky
He is passing it by Reference, he is not "outputting" it, he is simply avoiding a unneeded copy. This is to save memory (does not make a copy), and overhead (doesn't require copy call). But considering he is not changing it, a constant (reference) would be better suited. But as he is only passing an Integer, which represents the `ID` of the DTM (held by Simba), it's not that useful, but I could say it's still better then passing by value.

Whereas if you pass by value, you will be making a copy each time you call the function (causing some unneeded overhead), but only a soft copy (will be pointing to the same mem until changed).


If that's the case, it's strange I've never seen anyone do it that way before. Maybe I'm just too noob :p

Mr. Roboto

2014-08-29 17:24:29

From: The Mayor
He means that if you somehow end up with another item in your backpack that matches the gem DTM (a false positive) then you would be in an infinite loop.

I'm voting no because:

  • We [normally] have quite strict requirements with how you deal with colour finding (seeing as we use colour for everything). In the past relying purely on findObj was a no vote. We like to see that you understand how to use and manipulate TPAs. Yes SRL6's findObject uses TPAs under the hood, but it doesn't count as it doesn't demonstrate your ability.
  • There are a few thing throughout your script. No need to output the dtm in this procedure; you only use it as an input parameter: procedure craftGems(var dtm : integer)
  • Considering you are finishing your PhD in comp sci I think you can pick up these things in no time :)
  • It looks like you came back 20 days ago from a long break, and got enough posts for junior. I would have voted yes if you were a bit more active and you had contributed more.


I agree with the long break and not being active enough considering my account is from 2012. I believe I had 30+ posts before I came back from the break though. Also thanks for explaining the false positive, which makes sense; I need to fix that ASAP.


From: superuser
Yes!


Thank you.

From: Press Play
+1, 100% agree with this.

Basically, we want to see a more advanced script (that we know you're capable of). Some things to include are more advanced colour-finding with TPA/ATPAs; best used in custom object finding functions. I'm going to chuck a yes vote based on your mature attitude. Everyone keeps learning once accepted into SRL Members.


I’ll definitely check out TPA/ATPAs.

From: slacky
He is passing it by Reference, he is not "outputting" it, he is simply avoiding a unneeded copy. This is to save memory (does not make a copy), and avoid some overhead (doesn't require copy call). But considering he is not changing it, a constant (reference) would be better suited. But as he is only passing an Integer, which represents the `ID` of the DTM (held by Simba), it's not that useful, but I could say it's still better then passing by value.

Whereas if you pass by value, you will be making a copy each time you call the function (causing some unneeded overhead), but only a soft copy (will be pointing to the same mem until changed).


From: Turpinator
slacky beat me to the 'weirdness' of a dtm. but think. we define DTMs as integers… so you think somehow that DTM structure (Main Point, sub points, and colors) is stored in a simple type?

(i say 'you' but i dont mean you specifically. like everyone. :))


Thank you very much. I am glad you two understand my madness :D

Daniel

2014-08-29 23:48:56

From: slacky
He is passing it by Reference, he is not "outputting" it, he is simply avoiding a unneeded copy. This is to save memory (does not make a copy), and avoid some overhead (doesn't require copy call).


It wouldn't copy the entire DTM data structure any way.

slacky

2014-08-30 07:57:32

From: Daniel
It wouldn't copy the entire DTM data structure any way.

Yeah, I mentioned that it was only a soft copy in the last sentence :)

The Mayor

2014-08-30 17:48:07

From: slacky
Yeah, I mentioned that it was only a soft copy in the last sentence :)


[OFFTOPIC]

I'm intrigued by this whole thing. Can you give an example of when passing something by reference would be useful? I'd prefer a runescape example if possible!

[/OFFTOPIC]

slacky

2014-08-30 19:00:34

From: The Mayor
[OFFTOPIC]
I'm intrigued by this whole thing. Can you give an example of when passing something by reference would be useful? I'd prefer a runescape example if possible!
[/OFFTOPIC]

"passing something by reference":
- It's often just a more efficient way of passing the data between methods.
To clear it up a bit more, in Lape: const / constref (>=Simba 1.1RC), var and the out (tho only goes out) all pass by reference.

I can't come up with any examples, now. Just make a forum thread, I don't like to go off topic.

Mr. Roboto

2014-08-31 00:11:24

From: slacky
"passing something by reference":
- It's often just a more efficient way of passing the data between methods.
To clear it up a bit more, in Lape: const / constref (>=Simba 1.1RC), var and the out (tho only goes out) all pass by reference.

I can't come up with any examples, now. Just make a forum thread, I don't like to go off topic.


Without going too off topic either.

constref
was exactly what I was looking for, but I think that only works on a few Pascal compilers. If you know C++ it would look like this:


// constant integer and passing the address of x.
void foo(const int &x)

The Mayor

2014-09-15 06:30:24

@Daniel @Justin

Daniel

2014-09-15 07:18:00

Hey Mr. Roboto,

It unfortunately looks like you won't be getting in this time. :( Heed what other SRL Members have suggested to improve your chances next time!

You may apply again in two weeks or any later date when you're ready :)