SRL Archive - Archive

mat_de_b - SRL Member Application


mat_de_b

2011-06-13 11:19:11

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


Are you affilated in anyway with Jagex LTD?
No

Were you Referred to SRL?



What is your general programming knowledge?
Just Pascal (Scar/Simba)


Are you a member of any other communities?
I don't know what kind of communities this means but i guess RSBot etc.? in which case no, I'm not.


Tell us about yourself…
From: mat_de_b
Brother of the previous owner of this account, I'm Dominic de Beneducci rather than Mathew. I'm 16, I've played runescape for around 6/7 years i seriously started playing probably after the Aryan days. Made my first script perhaps 5 years ago. I pretty much script RS just for the challenge.

Details for the script below can be found here: http://villavu.com/forum/showthread.php?p=811940#post811940



Please show us one (or multiple) of your scripts.
program Firemaker;
{$DEFINE SMART}
{$i SRL/SRL.scar}
{$i Reflection/Reflection.simba}

Const
World = 36;
Members = True;
Signed = True;

Var
x, y, TotalLogs ,BreakLogs, WaitTime, Tol, Banker,Path,
StartTime, EXPGain, TimeRun, BreakTime : Integer;
State, LogType : String ;
Randoms : Boolean ;

procedure DeclarePlayers;
begin
LogType := 'Maple' ; // Logs, Oak, Willow, Maple, Yew, Magic. If I havent got your log leave it blank
Banker := 7907507 ;
Tol := 4
HowManyPlayers := 1;
CurrentPlayer := 0;
NumberOfPlayers(HowManyPlayers);

with Players[0] do
begin
Name := '3TimesAlady';
Pass := 'FooledMe3Times';
Nick := 'FML';
BoxRewards := ['amp','ash','unes','erbs'];
Active := True;
LampSkill := 'slayer';
Booleans[0] := True ; // True -Take Breaks, False- Don't (breaks don't work yet)
Integers[0] := 80000 ; // how many in Bank
Integers[1] := 30 ; // Break length in minutes (use a 2:1, work:break, ratio)
Integers[2] := 120 ; // Work Length in minutes
end;
end;

// Credits to BobboHobbo for below procedure

procedure PrintOnSmart(TP: TStringArray; Placement: TPoint; Colour, Shadow: integer);
var
mx, my, Pic, I, B, H, TPH, Numb: Integer;
TTP: TPointArray;
Canvas: TCanvas;
begin
SmartSetDebug(True);
GetClientDimensions(mx, my);
Pic := BitmapFromString(mx, my, '');
TPH := High(TP);
for I := 0 to TPH do
begin
TTP := LoadTextTPA(TP[i], SmallChars, H);
for B := 0 to High(TTP) do
begin
Numb := ((I + 1) * 13);
FastSetPixel(Pic, TTP[b].x + 1, TTP[b].y + Numb + 1, Shadow);
FastSetPixel(Pic, TTP[b].x, TTP[b].y + Numb, Colour);
end;
end;
Canvas := TCANVAS.Create;
Canvas.Handle := SmartGetDebugDC;
DrawBitmap(Pic, Canvas, Placement.x, Placement.y);
FreeBitmap(Pic);
end;

// Credits to BobboHobbo for below procedure

procedure DoSmartPrint;
begin
PrintOnSmart(['+^+^+ de Bs Log Burner +^+^+' ], Point(15, 30), 62207, 131072);
PrintOnSmart([
'State : '+State,
'',
'Burning : '+LogType,
'',
'Logs Burnt : '+IntToStr(TotalLogs),
'',
'EXP Made : '+IntToStr(TotalLogs*EXPGain),
'',
'EXP/Hour : '+IntToStr(Round(3600*(TotalLogs*EXPGain)/(TimeFromMark(StartTime)/1000 + 1))),
'This Break',
'',
'Time Running : '+MSToTime(TimeFromMark(TimeRun),1),
'',
''], Point(20, 60), 1959605, 131072)
end;

procedure ProgressReport;
begin
DoSmartPrint;
writeLn('======================');
writeLn('= de Bs Log Burner =');
WriteLn(' State : '+State);
writeLn(' Logs Burnt = '+IntToStr(TotalLogs));
writeLn(' EXP Made = '+IntToStr(TotalLogs*EXPGain));
writeLn(' EXP/Hour This Break = '+IntToStr(Round(3600*(TotalLogs*EXPGain)/(TimeFromMark(StartTime)/1000 + 1))));
WriteLn(' Time Running = '+MSToTime(TimeFromMark(TimeRun),1));
WriteLn(' '+TheTime);
writeLn('======================');
end;

function ToTheStart: TPointArray;
begin
SetLength(Result, 3);

Result[0] := Point(3429, 2891); //Bank
Result[1] := Point(3437, 2893); //Mid
Result[2] := Point(3446, 2895); //Start
end;

function ToTheBank: TPointArray;
begin
SetLength(Result, 3);

Result[0] := Point(3419, 2895); //End
Result[1] := Point(3423, 2893); //Mid
Result[2] := Point(3429, 2891); //Bank
end;

Function LogEXP: Integer ;
Begin
Case Lowercase(LogType) of
'logs': Begin
Result := 40 ;
End;

'oak': Begin
Result := 60 ;
End;

'willow': Begin
result := 90 ;
End;

'maple': Begin
Result := 135 ;
End;

'yew': Begin
Result := (2025/10) ;
End;

'magic': Begin
Result := (3038/10) ;
End;

'': Begin
result := 0
End;
End;
End;

Procedure StateFunc(Text: string);
Begin
State := '' + Text ;
ProgressReport;
End;

Procedure FindRandoms;
begin
If R_FindRandoms = True Then
Begin
StateFunc('In a Random')
R_FindRandoms;
Randoms := True;
End;
End;

Function FireHere: Boolean;
var Fire : TRSObject ;
Begin
FindRandoms;
If Randoms = True Then Exit;
Fire := GetInteractableAt(GetMyPos);
If Fire.ID = 2732 Then Result := True ;
If Fire = Null_RSObject Then Result := False ;
End;

Procedure OpenBanker;
Var Tries : integer ;
Begin
Tries := 0
Repeat
FindObj(x, y, 'anker', Banker, Tol);
Mouse(x, y, 0, 0, False);
Wait(300+Random(100));
Mouse(x, y+50, 5, 2, True);
Wait(1200);
Tries := Tries + 1 ;
Until((Bankscreen) or (Tries = 5));
End;

Procedure WithdrawLogs;
Begin
If DistanceFrom(Point(3429, 2891)) >= 2 Then
Begin
StateFunc('Not In Bank - Walking to bank');
WalkPath(ToTheBank);
End;
StateFunc('Withdrawing Logs');
FindRandoms;
If Not Bankscreen then
Begin
OpenBanker;
End;
R_DepositAllBut(590);
If Not ExistsItem(1) Then
Begin
Withdraw(1,0,1);
End;
Withdraw(0,0,0);
Randoms := False ;
End;


Procedure MoveToStart;
Begin
If Randoms = True Then Exit;
FindRandoms;
If Randoms = True Then Exit;
StateFunc('Moving To The Start') ;
MakeCompass('W');
SetAngle(True);
WalkPath(ToTheStart);
While IsMoving do
FindRandoms;
If Randoms = True Then Exit;
Wait(100);
End;

Procedure FindStart;
Begin
If Path > 2 Then Path := 1 ;
Case Path Of
1: WalkToTile(Tile(3446, 2895),0,0);

2: WalkToTile(Tile(3446, 2894),0,0);

End;
End;

Procedure MakeFire;
Var Log, TimeOut : integer ;
Start : TTile ;
Begin
If Randoms = True Then Exit;
FindRandoms;
If Randoms = True Then Exit;
StateFunc('Lighting Logs') ;
Log := 2 ;
TimeOut := 0 ;
Repeat
TimeOut := 0 ;
If FireHere Then
Begin
StateFunc('Fire In The Way Waiting') ;
Wait(10000+Random(2000));
MakeFire;
End;
Start := GetMyPos ;
Repeat
Repeat
If Not ExistsItem(Log) Then Log := Log + 1 ;
Until(ExistsItem(Log));
FindRandoms;
If Randoms = True Then Exit;
InvMouse(1,1);
Wait(250+Random(100));
InvMouse(Log,1);
Wait(1000+Random(100));
Until(Not ExistsItem(Log));
Repeat
FindRandoms;
If Randoms = True Then Exit;
Wait(500);
TimeOut := TimeOut + 500;
Until ((Not (GetMyPos = Start)) or (TimeOut = 20000));
Log := Log + 1 ;
TotalLogs := TotalLogs + 1 ;
BreakLogs := BreakLogs + 1 ;
ProgressReport;
Until(Log = 29);
Path := Path + 1
End;


Procedure MoveToBank;
Begin
StateFunc('Walking To The Bank') ;
FindRandoms;
MakeCompass('W');
SetAngle(True)
WalkPath(ToTheBank);
While IsMoving do
FindRandoms;
If Randoms = True Then Exit;
Wait(100);
End;



Procedure DomsLogout;
Begin
Logout;
ProgressReport;
TerminateScript;
End;


Procedure TakeABreak;
Var BreakLength : Integer ;
Begin
If (Players[CurrentPlayer].Booleans[0]) And ( TimeFromMark(BreakTime) > (Players[CurrentPlayer].Integers[2])*1000*60) Then
Begin
StateFunc('Taking a Break - ');
ProgressReport;
WaitTime := ((Players[CurrentPlayer].Integers[1])*1000*60)+(Random(30)*1000*60);
Logout;
MarkTime(BreakLength);
StateFunc('Taking a Break - Waiting for '+IntToStr(WaitTime/1000/60)+' Minutes');
ProgressReport;
Wait(WaitTime);
LogInPlayer;
MakeCompass('W');
SetAngle(True);
BreakLogs := 0 ;
FindRandoms;
BreakTime := 0 ;
MarkTime(BreakTime);
StartTime := 0 ;
MarkTime(StartTime);
End;
End;

Procedure Setup;
Begin
Smart_Members := MEMBERS;
Smart_Server := WORLD;
Smart_Signed := SIGNED;
SetupSRL;
WriteLn('SRL Setup');
DeclarePlayers;
LogInPlayer;
Wait(1000);
setRun(True);
SetAngle(True);
MakeCompass('W');
FindRandoms;
Path := 1
TotalLogs := 0 ;
BreakLogs := 0 ;
EXPGain := LogEXP ;
MarkTime(TimeRun);
StateFunc('Starting Up');
If Not TileOnMM(Point(3437, 2893)){Street} Then
Begin
StateFunc('Not In Right Part Of Nardah');
If DistanceFrom(Point(3437, 2893)){Street} <= 50 Then
Begin
StateFunc('Not In Right Part Of Nardah Trying To Move');
R_WebWalk(Point(3437, 2893));
While IsMoving do
Wait(100);
End
Else
Begin
StateFunc('Not In Nardah/Not Close Enough To Bank');
DomsLogout;
End;
End;
If DistanceFrom(Point(3429, 2891)) >= 3 Then
Begin
StateFunc('Not In Bank - Walking to bank');
WalkPath(ToTheBank);
End;
MarkTime(StartTime);
MarkTime(TimeRun);
MarkTime(BreakTime);
End;

begin
Setup;
Repeat
WithdrawLogs;
MoveToStart;
FindStart;
MakeFire;
MoveToBank;
ProgressReport;
TakeABreak;
Until (TotalLogs >= (Players[CurrentPlayer].Integers[0]));
StateFunc('Finished Work');
DomsLogout;
end.

Gu3st...

2011-06-13 11:36:56

I though you used to be an SRL member? Perhaps you requested it to be unmemberfied because it was your brother who got SRL membership?

Please post the code in code tags instead of Simba tags, there's some problems displaying code in Simba tags properly :/

You posted your username and password in the script. I changed it for you and PMed you the new password. Be more careful next time ;)

mat_de_b

2011-06-13 12:08:51

Seriously FML that is what like the 3rd time I've put my details on a public script this week…

I think someone noticed I wasn't my brother and took my off the members list? i was one yeah.

Thanks for the PW change :D

Rich

2011-06-13 12:18:12

Sorry, it's a no from me.

The script just seems too simple.
It doesn't really demonstrate good knowledge of colour - (D)DTMs, (A)TPAs, bitmaps etc.
Also, in your walking procedures there are no failsafes. You just hope that that one function call will do the job. When you use OpenBanker, although you limit the tries to five, nothing happens if it can't open the bank; it will act as though it's open. It's a similar story with failsafes throughout.

Sorry,
Richard.

mat_de_b

2011-06-13 12:30:02

So you recommend I redo and add fail safes that will exit the script?

Didn't realise the bank thing my bad. Pretty much all failsafes will lead to a changed state and 'DomsLogout;' procedure.

I shall add DTMs for the logs and tinderbox (removing relflection banking)

I'm i'm using reflection walking i cant really think of any use for TPA's any advice?

Cant think of any bitmap uses? any ideas?

I'm happy to get no's if they come with constructive criticism :D every little helps :D

Rich

2011-06-13 17:01:06

Just a heads up though; many users (including myself), don't like it when the scripts are changed mid app.

mat_de_b

2011-06-13 17:03:59

Oh no, I don't intend to change these things now, and the edit was only to remove my details. I'm just wondering about how i could use these techniques in this script (in the future) and in other scripts in the future. I suppose i'd be best off checking the tutorials section?

Flight

2011-06-13 21:36:20

This is off topic from the application itself, but what happens if you stand on an object that's not a fire?

Function FireHere: Boolean;
var Fire : TRSObject ;
Begin
FindRandoms;
If Randoms = True Then Exit;
Fire := GetInteractableAt(GetMyPos);
If Fire.ID = 2732 Then Result := True ;
If Fire = Null_RSObject Then Result := False ;
End;

Seems like if you're standing on a fire (only), it'll move, but if it's a marker plant, box trap, cannon, bird snare, flowers, then you'll just stand in that spot trying to light a fire? Correct me if I'm wrong, please.

MylesMadness

2011-06-13 22:16:46

So why didn't you just make a new account?

mat_de_b

2011-06-14 07:49:26

Easier to use one that was pre-made.

@Flight That is true yeah, I wasn't aware there were so many objects, to begin with fire was my main concern, obviously i could ask it to find an array of object ID's which if needed i might, however in over 24 hours total run time i've not had anyone do anything.

Flight

2011-06-14 09:00:55

I would suggest have it check if the object ID you're standing on is -1 (null), if so then go ahead and light, while anything else would tell you you're standing on an object. That will cover anything they throw at you. ;)

mat_de_b

2011-06-14 09:52:34

Flight , i'd considered that, but due to my limited knowledge on item ids/object ids' and interactables i would was worried that if i go over some ash that was there from my previous run it might interpret that as an unlightable area which would be a serious problem. I would prefer to have a list on unlightable objects and work from that rather than just saying if there's an object at all then move.