SRL Archive - OSR Help

Help Creating First Script


Mikkoz99

2013-04-04 11:12:34

Hello. I am trying to create a script, but I can't run it.
Here's the code:

Program VarrockIronMiner;
{$DEFINE SMART}
{$I SRL-OSR/SRL.simba}
{$I SPS/sps-osr.simba}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := ''; //Your Runescape username goes right here.
Players[0].Pass := ''; //Your Runescape password goes right here.
Players[0].Active := True;
Players[0].Pin := ''; //Bank PIN
Players[0].Nick := ''; //In-Game-Name
end;

begin
SetupSRL();
procedure MineIron;
var x, y: integer;
begin
if FindObj(x, y, 'in', 2964321, 10) then
begin
Mouse(x, y, 0, begin
SetupSRL();0, true);
ChooseOption('ine');
wait(1500+random(1000));
end;
end;


procedure WalkToBank;
begin
if (InvFull) then
begin
MakeCompass(180);
SPS_AnyAngle := True;
SPS_Setup(runescape_surface, ['12_7']);
SetRun(True)
SPS_WalkPath([Point(187, 386), Point(195, 322),Point(194, 257), Point(176, 193),Point(161, 166), Point(118, 167),Point(61, 166), Point(43, 166),Point(44, 194), Point(44, 200)]);
end;
end;


procedure BankIron;
begin
WriteLn('Looking for bank.');
if FindBank('veb') then
begin
WriteLn('We have found the bank.');
if OpenBank('veb', False, True) then
begin
WriteLn('Banking…');
DepositAll;
CloseBank;
end;
end;
end;


procedure WalkToMine;
begin
MakeCompass(180);
SPS_AnyAngle := True;
SPS_Setup(runescape_surface, ['12_7']);
SetRun(True)
SPS_WalkPath([Point(43, 165), Point(109, 165),Point(165, 165), Point(182, 204),Point(196, 259), Point(196, 323),Point(198, 385), Point(173, 400),Point(173, 408)]);
end;


procedure AntiBan;
begin
if (not(LoggedIn))then
Exit;
case Random(8) of
0:
end;
begin
HoverSkill('Mining', false);
wait(1500+Random(150));
end;
begin
MakeCompass('N');
wait(25+random(100));
MakeCompass('S');
wait(30+random(110));
MakeCompass('N');
end.

I get the error:
[Error] C:\Users\Mikkoz\Desktop\VarrockIronMiner.simba(22:3): Identifier expected at line 21
Compiling failed.

Mikkoz99

2013-04-04 11:18:02

And this is for oldschool.

zNerve

2013-04-04 11:19:22

You need an end; after SetupSRL; I believe

Haxz

2013-04-04 11:20:11

begin
SetupSRL();
procedure MineIron;

Without an end; , you started writing another new procedure.

Better to do SetupSRL in mainloop.
Mouse function in MineIron procedure is wrong.
There's another SetupSRL in MineIron procedure.
I think you don't have to do SPS_Setup twice if its the same map.
I think you messed up the case in your Antiban procedure.
Your mainloop is the below, means it should only do this.

begin
MakeCompass('N');
wait(25+random(100));
MakeCompass('S');
wait(30+random(110));
MakeCompass('N');
end.

Sorry if I'm wrong, better let the experts teach you :p

Mikkoz99

2013-04-04 11:30:10

Ok, I fixed the SetupSRL thing and now it looks like this:

Program VarrockIronMiner;
{$DEFINE SMART}
{$I SRL-OSR/SRL.simba}
{$I SPS/sps-osr.simba}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := ''; //Your Runescape username goes right here.
Players[0].Pass := ''; //Your Runescape password goes right here.
Players[0].Active := True;
Players[0].Pin := ''; //Bank PIN
Players[0].Nick := ''; //In-Game-Name
end;

begin
SetupSRL();
end;

procedure MineIron;
var x, y: integer;
begin
if FindObj(x, y, 'in', 2964321, 10) then
begin
Mouse(x, y, 0, 0, true);
ChooseOption('ine');
wait(1500+random(1000));
end;
end;


procedure WalkToBank;
begin
if (InvFull) then
begin
MakeCompass(180);
SPS_AnyAngle := True;
SPS_Setup(runescape_surface, ['12_7']);
SetRun(True)
SPS_WalkPath([Point(187, 386), Point(195, 322),Point(194, 257), Point(176, 193),Point(161, 166), Point(118, 167),Point(61, 166), Point(43, 166),Point(44, 194), Point(44, 200)]);
end;
end;


procedure BankIron;
begin
WriteLn('Looking for bank.');
if FindBank('veb') then
begin
WriteLn('We have found the bank.');
if OpenBank('veb', False, True) then
begin
WriteLn('Banking…');
DepositAll;
CloseBank;
end;
end;
end;


procedure WalkToMine;
begin
MakeCompass(180);
SPS_AnyAngle := True;
SPS_Setup(runescape_surface, ['12_7']);
SetRun(True)
SPS_WalkPath([Point(43, 165), Point(109, 165),Point(165, 165), Point(182, 204),Point(196, 259), Point(196, 323),Point(198, 385), Point(173, 400),Point(173, 408)]);
end;


procedure AntiBan;
begin
if (not(LoggedIn))then
Exit;
case Random(8) of
0:
end;
begin
HoverSkill('Mining', false);
wait(1500+Random(150));
end;
begin
MakeCompass('N');
wait(25+random(100));
MakeCompass('S');
wait(30+random(110));
MakeCompass('N');
end.

and I get this error:
[Error] C:\Users\Mikkoz\Desktop\VarrockIronMiner.simba(22:4): period ('.') expected at line 21
Compiling failed.

Mikkoz99

2013-04-04 11:50:46

The first version I made was this (I think it's better but it doesn't work either):

Program VarrockIronMiner;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$I SPS/sps-osr.simba}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := ''; //Your Runescape username goes right here.
Players[0].Pass := ''; //Your Runescape password goes right here.
Players[0].Active := True;
Players[0].Pin := ''; //Bank PIN
Players[0].Nick := ''; //In-Game-Name
end;


procedure MineIron;
var x, y: integer;
begin
if FindObj(x, y, 'in', 2964321, 10) then
begin
Mouse(x, y, 0, 0, true);
ChooseOption('ine');
wait(1500+random(1000));
end;
end;


procedure WalkToBank;
begin
if (InvFull) then
begin
SetupSRL;
SPS_Setup(runescape_surface07, ['12_7']);
ToBank := [Point(187, 386), Point(195, 322),
Point(194, 257), Point(176, 193),
Point(161, 166), Point(118, 167),
Point(61, 166), Point(43, 166),
Point(44, 194), Point(44, 200)];
SPS_WalkPath(ToBank);
end;
procedure BankIron;
begin
WriteLn('Looking for bank.');
if FindBank('veb') then
begin
WriteLn('We have found the bank.');
if OpenBank('veb', False, True) then
begin
WriteLn('Banking…');
DepositAll;
CloseBank;
end;
end;
end;


procedure WalkToMine;
begin
WriteIn('Walking back to East Mine.');
begin
SetupSRL;
SPS_Setup(RUNESCAPE_SURFACE07, ['12_7']);
ToMine := [Point(43, 165), Point(109, 165),
Point(165, 165), Point(182, 204),
Point(196, 259), Point(196, 323),
Point(198, 385), Point(173, 400),
Point(173, 408)];
SPS_WalkPath(ToMine);
end;


procedure AntiBan;
begin
if (not(LoggedIn))then
Exit;
case Random(8) of
0:
begin
HoverSkill('Mining', false);
wait(1500+Random(150));
end;
1: PickUpMouse;
2:
begin
MakeCompass('N');
wait(25+random(100));
MakeCompass('S');
wait(30+random(110));
MakeCompass('N');
end;
end;
end.



Ian

2013-04-04 11:51:51

From: Mikkoz99
Ok, I fixed the SetupSRL thing and now it looks like this:

and I get this error:
[Error] C:\Users\Mikkoz\Desktop\VarrockIronMiner.simba(22:4): period ('.') expected at line 21
Compiling failed.


Try to use Simba tags when posting script, it makes it easier to read :)


Program VarrockIronMiner;
{$DEFINE SMART}
{$I SRL-OSR/SRL.simba}
{$I SPS/sps-osr.simba}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := ''; //Your Runescape username goes right here.
Players[0].Pass := ''; //Your Runescape password goes right here.
Players[0].Active := True;
Players[0].Pin := ''; //Bank PIN
Players[0].Nick := ''; //In-Game-Name
end;

procedure MineIron;
var x, y: integer;
begin
if FindObj(x, y, 'in', 2964321, 10) then
begin
Mouse(x, y, 0, 0, true);
ChooseOption('ine');
wait(1500+random(1000));
end;
end;


procedure WalkToBank;
begin
if (InvFull) then
begin
MakeCompass(180);
SPS_AnyAngle := True;
SPS_Setup(runescape_surface, ['12_7']);
SetRun(True)
SPS_WalkPath([Point(187, 386), Point(195, 322),Point(194, 257), Point(176, 193),Point(161, 166), Point(118, 167),Point(61, 166), Point(43, 166),Point(44, 194), Point(44, 200)]);
end;
end;


procedure BankIron;
begin
WriteLn('Looking for bank.');
if FindBank('veb') then
begin
WriteLn('We have found the bank.');
if OpenBank('veb', False, True) then
begin
WriteLn('Banking...');
DepositAll;
CloseBank;
end;
end;
end;


procedure WalkToMine;
begin
MakeCompass(180);
SPS_AnyAngle := True;
SPS_Setup(runescape_surface, ['12_7']);
SetRun(True)
SPS_WalkPath([Point(43, 165), Point(109, 165),Point(165, 165), Point(182, 204),Point(196, 259), Point(196, 323),Point(198, 385), Point(173, 400),Point(173, 408)]);
end;


procedure AntiBan;
begin
if (not(LoggedIn))then
Exit;
case Random(8) of
0:begin
HoverSkill('Mining', false);
wait(1500+Random(150));
MakeCompass('N');
wait(25+random(100));
MakeCompass('S');
wait(30+random(110));
MakeCompass('N');
end;
end; //This end is to end your case statement
end; //I changed this from a period to a semicolon because you only use a period for the end of your Main Loop.

//Below is your main loop, it is what will actually be executed :)
begin
repeat
MineIron
AntiBan;
until(InvFull);
WalkToBank;
BankIron;
WalkToMine;
end.

I tried to piece a mainloop together from your procedures, you'll probably need to change it to your needs though :)

Mikkoz99

2013-04-04 11:55:39

Thanks !!! I don't get any errors, but SMART doesn't load either:/ Any suggestions? I tried to change SMART at the beginning to SMART8
EDIT: I get this: Compiled successfully in 359 ms.
From: BMWxi
Try to use Simba tags when posting script, it makes it easier to read :)


Program VarrockIronMiner;
{$DEFINE SMART}
{$I SRL-OSR/SRL.simba}
{$I SPS/sps-osr.simba}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := ''; //Your Runescape username goes right here.
Players[0].Pass := ''; //Your Runescape password goes right here.
Players[0].Active := True;
Players[0].Pin := ''; //Bank PIN
Players[0].Nick := ''; //In-Game-Name
end;

procedure MineIron;
var x, y: integer;
begin
if FindObj(x, y, 'in', 2964321, 10) then
begin
Mouse(x, y, 0, 0, true);
ChooseOption('ine');
wait(1500+random(1000));
end;
end;


procedure WalkToBank;
begin
if (InvFull) then
begin
MakeCompass(180);
SPS_AnyAngle := True;
SPS_Setup(runescape_surface, ['12_7']);
SetRun(True)
SPS_WalkPath([Point(187, 386), Point(195, 322),Point(194, 257), Point(176, 193),Point(161, 166), Point(118, 167),Point(61, 166), Point(43, 166),Point(44, 194), Point(44, 200)]);
end;
end;


procedure BankIron;
begin
WriteLn('Looking for bank.');
if FindBank('veb') then
begin
WriteLn('We have found the bank.');
if OpenBank('veb', False, True) then
begin
WriteLn('Banking...');
DepositAll;
CloseBank;
end;
end;
end;


procedure WalkToMine;
begin
MakeCompass(180);
SPS_AnyAngle := True;
SPS_Setup(runescape_surface, ['12_7']);
SetRun(True)
SPS_WalkPath([Point(43, 165), Point(109, 165),Point(165, 165), Point(182, 204),Point(196, 259), Point(196, 323),Point(198, 385), Point(173, 400),Point(173, 408)]);
end;


procedure AntiBan;
begin
if (not(LoggedIn))then
Exit;
case Random(8) of
0:begin
HoverSkill('Mining', false);
wait(1500+Random(150));
MakeCompass('N');
wait(25+random(100));
MakeCompass('S');
wait(30+random(110));
MakeCompass('N');
end;
end; //This end is to end your case statement
end; //I changed this from a period to a semicolon because you only use a period for the end of your Main Loop.

//Below is your main loop, it is what will actually be executed :)
begin
repeat
MineIron
AntiBan;
until(InvFull);
WalkToBank;
BankIron;
WalkToMine;
end.

I tried to piece a mainloop together from your procedures, you'll probably need to change it to your needs though :)

Mikkoz99

2013-04-04 12:00:00

Ok, got it to load SMART… Not logging in automatically.

Mikkoz99

2013-04-04 12:01:32

The script is still not working, when I start it it opens up a new SMART but doesn't log in.. And if I login manually and then Enable SMART it doesn't do anything. :/

Haxz

2013-04-04 12:13:54

Because you didn't do SetupSRL and declareplayers in your mainloop.

Mikkoz99

2013-04-04 12:15:41

Oh thanks, will try now.

Mikkoz99

2013-04-04 12:24:52

Still not working? It mutes and then just nothing

Program VarrockIronMiner;
{$DEFINE SMART}
{$I SRL-OSR/SRL.simba}
{$I SPS/sps-osr.simba}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := '@gmail.com'; //Your Runescape username goes right here.
Players[0].Pass := ''; //Your Runescape password goes right here.
Players[0].Active := True;
Players[0].Pin := ''; //Bank PIN
Players[0].Nick := ''; //In-Game-Name
end;

procedure MineIron;
var x, y: integer;
begin
if FindObj(x, y, 'in', 2964321, 10) then
begin
Mouse(x, y, 0, 0, true);
ChooseOption('ine');
wait(1500+random(1000));
end;
end;


procedure WalkToBank;
begin
if (InvFull) then
begin
MakeCompass(180);
SPS_AnyAngle := True;
SPS_Setup(runescape_surface, ['12_7']);
SetRun(True)
SPS_WalkPath([Point(187, 386), Point(195, 322),Point(194, 257), Point(176, 193),Point(161, 166), Point(118, 167),Point(61, 166), Point(43, 166),Point(44, 194), Point(44, 200)]);
end;
end;


procedure BankIron;
begin
WriteLn('Looking for bank.');
if FindBank('veb') then
begin
WriteLn('We have found the bank.');
if OpenBank('veb', False, True) then
begin
WriteLn('Banking...');
DepositAll;
CloseBank;
end;
end;
end;


procedure WalkToMine;
begin
MakeCompass(180);
SPS_AnyAngle := True;
SPS_Setup(runescape_surface, ['12_7']);
SetRun(True)
SPS_WalkPath([Point(43, 165), Point(109, 165),Point(165, 165), Point(182, 204),Point(196, 259), Point(196, 323),Point(198, 385), Point(173, 400),Point(173, 408)]);
end;


procedure AntiBan;
begin
if (not(LoggedIn))then
Exit;
case Random(8) of
0:begin
HoverSkill('Mining', false);
wait(1500+Random(150));
MakeCompass('N');
wait(25+random(100));
MakeCompass('S');
wait(30+random(110));
MakeCompass('N');
end;
end; //This end is to end your case statement
end; //I changed this from a period to a semicolon because you only use a period for the end of your Main Loop.

//Below is your main loop, it is what will actually be executed :)
begin
DeclarePlayers
SetupSRL
repeat
MineIron
AntiBan;
until(InvFull);
WalkToBank;
BankIron;
WalkToMine;
end.

Mikkoz99

2013-04-04 12:25:54

Whoops- left my accout details in :D

Mikkoz99

2013-04-04 12:35:31

YES! FINALLY logged in!

Mikkoz99

2013-04-04 12:47:59

Trying to make it walk, doesn't work.
It does do antiban :)

Mikkoz99

2013-04-04 13:04:00

I need help to make it walk…. Lol :/
This is the procedure to go to mine:

procedure WalkToMine;
begin
MakeCompass(180);
SPS_AnyAngle := False;
SPS_Setup(runescape_surface, ['12_7']);
SetRun(True)
myPath := ([Point(43, 165), Point(109, 165),Point(165, 165), Point(182, 204),Point(196, 259), Point(196, 323),Point(198, 385), Point(173, 400),Point(173, 408)]);
SPS_WalkPath(myPath);
end;
Halpppp
EDIT: Now that I got it to mine, it also mines copper :/ I tried changing the color.

Ian

2013-04-04 15:13:35

From: Mikkoz99
I need help to make it walk…. Lol :/
This is the procedure to go to mine:

procedure WalkToMine;
begin
MakeCompass(180);
SPS_AnyAngle := False;
SPS_Setup(runescape_surface, ['12_7']);
SetRun(True)
myPath := ([Point(43, 165), Point(109, 165),Point(165, 165), Point(182, 204),Point(196, 259), Point(196, 323),Point(198, 385), Point(173, 400),Point(173, 408)]);
SPS_WalkPath(myPath);
end;
Halpppp
EDIT: Now that I got it to mine, it also mines copper :/ I tried changing the color.


Those coordinates are way to small, they should be near the thousands. You probably made the path from one of the map sections in the runescape_surface folder. This time, make the path using the entire map (It's at the bottom of the runescape_surface folder.)

Mikkoz99

2013-04-05 00:34:16

Ohthhanks, I used the map 12_7

Mikkoz99

2013-04-05 01:12:17


procedure WalkToMine;
begin
SPS_AnyAngle := True;
SPS_Setup(runescape_surface, ['12_7','12_8']);
SetRun(True)
SPS_WalkPath([Point(4842, 2980), Point(4850, 2967), Point(4866, 2967), Point(4884, 2966), Point(4909, 2965),
Point(4935, 2967), Point(4959, 2970), Point(4975, 2990), Point(4979, 3019), Point(4994, 3074), Point(5000, 3133),
Point(4995, 3187), Point(4974, 3200)]);
end;
Nope.

Mikkoz99

2013-04-05 10:28:14

I still need help to make it walk… anyone?
I tried Mat's SPS Walking (Path?) Guide but I get errors using that, I guess it's because it is for EOC.
EDIT: I'm re-creating the script and now it mines just Iron perfectly :)
I will try to add walking, then banking :D

Mikkoz99

2013-04-05 19:54:03

Finally got it working ! yay
I use SPS for walking