SRL Archive - OSR Help

What is my bonfire script doing wrong?


Wu-Tang Clan

2013-03-21 20:32:23

program FalBonfire;
{$Define SMART}
{$I SRL/SRL.Simba}
{$I Sps/Sps.Simba}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Pin :=''
Players[0].Active:=True;
end;

procedure Bank2Spot;
var
myPath:TPointArray;

begin
SetupSRL;
writeLn('Walking to the burning spot - SPS');
SPS_Setup(RUNESCAPE_SURFACE, ['8_7']);
myPath := [Point(3582, 3131), Point(3576, 3124), Point(3575, 3115), Point(3576, 3106)];
SPS_WalkPath(myPath);
end;

procedure Spot2Bank;
var
myPath:TPointArray;

begin
writeLn('Walking to the bank - SPS');
SPS_Setup(RUNESCAPE_SURFACE, ['8_7']);
myPath := [Point(3576, 3105), Point(3578, 3115), Point(3580, 3123), Point(3584, 3131)];
SPS_WalkPath(myPath);
end;

procedure Light;
begin
InvMouse(1, mouse_right)
WaitOption('ight', 500);
Wait(1500);
InvMouse(2, mouse_left);
MMouse(366,234,2,2); // Add logs to bonfire popup.
ClickMouse2(mouse_left);
Wait(50000);
Spot2Bank;
end;

procedure Bank;
var
t: integer;

begin
t := (getSystemTime + 10000);

repeat
OpenBankFast('fwb');
WriteLn('Opening the Falador East Bank');
until(bankScreen or pinScreen or (getSystemTime > t));

if (getSystemTime > t) then
begin
Bank2Spot;
end;

if(PinScreen) then
begin
InPin(Players[0].Pin);
end;

if (BankScreen) then
if InvCount > 0 then depositAll; // Just to empty out your pocket as a failsafe
MouseBankSlot(1, mouse_Right);
if (WaitOption('ithdraw-All', 500)) then
Writeln('Got logs');

if (invFull) then
CloseBank;
Bank2Spot;
end;

begin
SMART_FIXSPEED := True;
SRL_SixHourFix:= True;
SetupSRL;
DeclarePlayers;
LoginPlayer;

repeat
Bank;
Bank2Spot;
Light;
Spot2Bank;
until (false);
end.

Its a Falador west bank firemaking script. The thing is that it doesn't do anything, can someone tell me what I'm doing wrong? I'm new to scripting and was getting around to the skeleton of my script. Any help would be appreciated

Element17

2013-03-21 21:13:15

program FalBonfire;
{$Define SMART}
{$I SRL/SRL.Simba}
{$I Sps/Sps.Simba}


procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Pin :=''
Players[0].Active:=True;
end;

procedure paths; //renamed
var
path1, path2:TPointArray;

begin {Think this might be it....you don't need to call SetupSRL twice and try calling SPS in your mainloop}
{Just my little bit of info}
//SetupSRL;
writeLn('Walking to the burning spot - SPS');
//SPS_Setup(RUNESCAPE_SURFACE, ['8_7']);
path1 := [Point(3582, 3131), Point(3576, 3124), Point(3575, 3115), Point(3576, 3106)];
path2 := [Point(3576, 3105), Point(3578, 3115), Point(3580, 3123), Point(3584, 3131)];
//SPS_WalkPath(myPath);
end;

function WhereToGo(Which: string): boolean;
begin
case Lowercase(Which) of
'area1':
begin
paths;
if SPS_WalkPath(path1) then
//blah blah
end;
'area2':
begin
paths;
if SPS_WalkPath(path2) then
//blah blah
end;
end;


//blah blah

begin //end of script

SetupSRL;
//ClickNorth(SRL_ANGLE_HIGH);

sps_setup(runescape_surface,['8_7']);
writeln(sps_getmypos);
end.

Wrote this in browser so might not compile but that should help, also if you get -1,-1 sps position
then your paths are messed up.

Wu-Tang Clan

2013-03-22 17:19:37

From: Element17
program FalBonfire;
{$Define SMART}
{$I SRL/SRL.Simba}
{$I Sps/Sps.Simba}


procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Pin :=''
Players[0].Active:=True;
end;

procedure paths; //renamed
var
path1, path2:TPointArray;

begin {Think this might be it....you don't need to call SetupSRL twice and try calling SPS in your mainloop}
{Just my little bit of info}
//SetupSRL;
writeLn('Walking to the burning spot - SPS');
//SPS_Setup(RUNESCAPE_SURFACE, ['8_7']);
path1 := [Point(3582, 3131), Point(3576, 3124), Point(3575, 3115), Point(3576, 3106)];
path2 := [Point(3576, 3105), Point(3578, 3115), Point(3580, 3123), Point(3584, 3131)];
//SPS_WalkPath(myPath);
end;

function WhereToGo(Which: string): boolean;
begin
case Lowercase(Which) of
'area1':
begin
paths;
if SPS_WalkPath(path1) then
//blah blah
end;
'area2':
begin
paths;
if SPS_WalkPath(path2) then
//blah blah
end;
end;


//blah blah

begin //end of script

SetupSRL;
//ClickNorth(SRL_ANGLE_HIGH);

sps_setup(runescape_surface,['8_7']);
writeln(sps_getmypos);
end.

Wrote this in browser so might not compile but that should help, also if you get -1,-1 sps position
then your paths are messed up.


Seems to be working when I took out that SetupSRL- thanks a lot!