SRL Archive - OSR Help

Agility Problem


xtrapsp

2012-02-18 14:53:33

Hey guys,

So I've been trying to make a colour bot (All coded by me :))

program GnomeAgil;

// {$DEFINE SMART}
{$i SRL\SRL.simba}

Const
SRLStats_Username = '';
SRLStats_Password = '';
BreakEvery = 120;
BreakFor = 5;
NumbOfPlayers= 1;
StartPlayer= 0;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; //Runescape Username
Players[0].Pass := ''; //Runescape Password
Players[0].Nick := ''; //3-4 letters that you will recognise
Players[0].Member := True; //Are you a member?
Players[0].Active := True; //Not sure what this means... I saw it on other scripts
Players[0].Pin := ''; //Bank Pin
Players[0].BoxRewards := ['Xp', 'mote', 'ostume','ssence'];

end;

Procedure StatsGuise(wat:String); // Thanks YoHoJo
Begin
Status(wat);
Disguise(wat);
End;

Function FindLog:Boolean;
Var
x, Y: Integer;
Begin
//FindObjCustom(x, y, ['att', 'ack'], [123456, 345678], 5);
If FindObjCustom(x , y, ['wal', 'k', 'acro'], [798802 , 865370], 0) Then
Begin
Writeln('Yay, Theres the first obstacle found');
GetMousePos(x, y);
Case Random(1) Of
0: Mouse(x, y, 5, 5, True);
End;
End;
End;

Function Net:Boolean;
Var
x, Y: Integer;
Begin
//FindObjCustom(x, y, ['att', 'ack'], [123456, 345678], 5);
If FindObjCustom(x,y, ['Cli', 'mb o', 'ver'], [724498 , 1713454], 0) Then
Begin
Writeln('Yay, Theres the Second obstacle found');
GetMousePos(x, y);
Case Random(1) Of
0: Mouse(x, y, 5, 5, True);
1: Begin
Mouse(x, y, 3, 3, False);
wait(100+Random(10));
ChooseOption('climb');
End;
End;
End;
End;

Function UpTreeBranch:Boolean;
Var
x, Y: Integer;
Begin
//FindObjCustom(x, y, ['att', 'ack'], [123456, 345678], 5);
If FindObjCustom(x,y, ['Cli', 'Tree', 'Bra'], [3827842 ,1190970 ], 5) Then
Begin
Writeln('Yay, Theres the Third obstacle found');
GetMousePos(x, y);
Case Random(1) Of
0: Mouse(x, y, 5, 5, True);
1: Begin
Mouse(x, y, 3, 3, False);
wait(100+Random(10));
ChooseOption('climb');
End;
End;
End;
End;

Function BalanceRope:Boolean;
Var
x, Y: Integer;
Begin
//FindObjCustom(x, y, ['att', 'ack'], [123456, 345678], 5);
If FindObjCustom(x,y, ['Walk', 'On', 'k On'], [ 5931168 ,5272206 ], 5) Then
Begin
Writeln('Yay, Theres the Fourth obstacle found');
GetMousePos(x, y);
Case Random(1) Of
0: Mouse(x, y, 5, 5, True);
End;
End;
End;

Function DownTreeBranch:Boolean;
Var
x, Y: Integer;
Begin
//FindObjCustom(x, y, ['att', 'ack'], [123456, 345678], 5);
If FindObjCustom(x,y, ['Cli', 'Tree', 'Bra', 'Down'], [1720146 ,1522251 ], 5) Then
Begin
Writeln('Yay, Theres the Fifth obstacle found');
GetMousePos(x, y);
Case Random(1) Of
0: Mouse(x, y, 5, 5, True);
1: Begin
Mouse(x, y, 3, 3, False);
wait(100+Random(10));
ChooseOption('climb');
End;
End;
End;
End;

Function Netsecond:Boolean;
Var
x, Y: Integer;
Begin
//FindObjCustom(x, y, ['att', 'ack'], [123456, 345678], 5);
MakeCompass(RandomRange(20,60));
If FindObjCustom(x,y, ['Cli', 'Tree', 'Bra', 'Down'], [1720146 ,1522251 ], 5) Then
Begin
Writeln('Yay, Theres the Fifth obstacle found');
GetMousePos(x, y);
Case Random(1) Of
0: Mouse(x, y, 5, 5, True);
1: Begin
Mouse(x, y, 3, 3, False);
wait(100+Random(10));
ChooseOption('climb');
End;
End;
End;
Begin
End;
End;


begin
SetupSRL;
DeclarePlayers;
Repeat
FindLog;
MakeCompass(75 + random(30));
Net;
UpTreeBranch;
BalanceRope;
DownTreeBranch;
NetSecond;
Until(false);
End.

The problem I'm having is… if I remove
    UpTreeBranch;
BalanceRope;
DownTreeBranch;
NetSecond;

it works fairly well, I don't really know what I'm doing wrong? It's miss clicking etc a lot

I know I'm not a good coder. So please cut me some slack

Gucci

2012-02-29 23:09:11

Is the misclicking happening while your moving? In that case you might want to use some wait times. and how come everything as a function and not a procedure?

Runescape Pro

2012-02-29 23:52:37

Im making an advanced gnome course runner so i could help you. Maybe we can talk voer skype/msn/aim?

Er1k

2012-03-01 00:22:22

always use functions for anything that might fail. you will be sorry if you don't.

Gucci

2012-03-01 01:12:44

From: nosaj.421
always use functions for anything that might fail. you will be sorry if you don't.


Oh i see