SRL Archive - OSR Help

Was just testing my script, and it won't compile


Imagine

2012-02-19 10:30:59

I was just trying to test in parts…

program New;
{$i SRL\SRL.simba}
// {$DEFINE SMART}


/////// Credits to YohoJo
Const
SERVER = 61; // Enter "0" to pick a random server.
MEMBERS = False; // Set to True if using a RS-Members account. False if F2P.
SRLStats_Username = ''; // Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
NumbOfPlayers= 1; //How many players are you using
StartPlayer= 0; //Player to start auoting with! (0 means first char)

///////
procedure DeclarePlayers; //Credits to YoHoJo
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'oins'];

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
Active := True;
end;

end;
///////
Var NCowsK, TXP:Integer;
///////
procedure StatsGuise(wat:String); //Credits to YoHoJo
begin
Status(wat);
Disguise(wat);
end;


function FoundCow:Boolean;
var
x, y: Integer;
begin
FindObjCustom(x, y, ['ack Co', 'ttack C'], [2896690, 6719385, 13620696, 728612], 20) then

WriteLn('Hooray, we found a cow!')
end;

begin
SetupSRL;
DeclarePlayers;
// repeat
FoundCow();
// until(false);
end.

At line 64, which is my FindObjCustom line, it says that there was an identifier expected. I'm not quite sure what to do :/.

begginer

2012-02-19 10:33:37

Please post on pastebin this. I'll try to help later as I am on my phone now.

RISK

2012-02-19 10:35:33

function FoundCow:Boolean;
var
x, y: Integer;
begin
FindObjCustom(x, y, ['ack Co', 'ttack C'], [2896690, 6719385, 13620696, 728612], 20) then

WriteLn('Hooray, we found a cow!')
end;

You need an 'if' before your 'FindObjCustom' if you are trying to make an if .. then. If you are not trying to do that, you need to remove the 'then' at the end of it. Changing it to this:
function FoundCow:Boolean;
var
x, y: Integer;
begin
FindObjCustom(x, y, ['ack Co', 'ttack C'], [2896690, 6719385, 13620696, 728612], 20);

WriteLn('Hooray, we found a cow!');
end;

Or this for an if .. then:
function FoundCow:Boolean;
var
x, y: Integer;
begin
if FindObjCustom(x, y, ['ack Co', 'ttack C'], [2896690, 6719385, 13620696, 728612], 20) then
begin
WriteLn('Hooray, we found a cow!');
end;
end;

laakerules

2012-02-19 10:37:45

From: Imagine
I was just trying to test in parts…

program New;
{$i SRL\SRL.simba}
// {$DEFINE SMART}


/////// Credits to YohoJo
Const
SERVER = 61; // Enter "0" to pick a random server.
MEMBERS = False; // Set to True if using a RS-Members account. False if F2P.
SRLStats_Username = ''; // Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
NumbOfPlayers= 1; //How many players are you using
StartPlayer= 0; //Player to start auoting with! (0 means first char)

///////
procedure DeclarePlayers; //Credits to YoHoJo
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'oins'];

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
Active := True;
end;

end;
///////
Var NCowsK, TXP:Integer;
///////
procedure StatsGuise(wat:String); //Credits to YoHoJo
begin
Status(wat);
Disguise(wat);
end;


function FoundCow:Boolean;
var
x, y: Integer;
begin
FindObjCustom(x, y, ['ack Co', 'ttack C'], [2896690, 6719385, 13620696, 728612], 20) then

WriteLn('Hooray, we found a cow!')
end;

begin
SetupSRL;
DeclarePlayers;
// repeat
FoundCow();
// until(false);
end.

At line 64, which is my FindObjCustom line, it says that there was an identifier expected. I'm not quite sure what to do :/.




You forgot the if, i fixed it up a bit and added some stuff. Found below! :)

program New;
{$i SRL\SRL.simba}
// {$DEFINE SMART}


/////// Credits to YohoJo
Const
SERVER = 61; // Enter "0" to pick a random server.
MEMBERS = False; // Set to True if using a RS-Members account. False if F2P.
SRLStats_Username = ''; // Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
NumbOfPlayers= 1; //How many players are you using
StartPlayer= 0; //Player to start auoting with! (0 means first char)

///////
procedure DeclarePlayers; //Credits to YoHoJo
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'oins'];

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
Active := True;
end;

end;
///////
Var NCowsK, TXP:Integer;
///////
procedure StatsGuise(wat:String); //Credits to YoHoJo
begin
Status(wat);
Disguise(wat);
end;


function FoundCow:Boolean;//Changed up this function to work like a babe now! :P
var
x, y: Integer;
begin
if FindObjCustom(x, y, ['ack Co', 'ttack C'], [2896690, 6719385, 13620696, 728612], 20) then
Wait(987);
If InFight then
Repeat
WriteLn('Hooray, we found a cow!')
Wait(1);
Until (Not InFight);
end;

begin
SetupSRL;
DeclarePlayers;
// repeat
FoundCow();
// until(false);
end.



Edit: LOL, well why i was typing stuff into the simba box for a fixup and addative to the script risk beat me! :P Good Job risk :)

Imagine

2012-02-19 11:01:05

^ Thanks both of you. It ran, but I couldn't find a way to exit the program because I must have set the colors up wrong.

I tried using the esc key but that didn't work.

Is there any way to kill the program?

And also, what would the most defining color for a cow be? :/

RISK

2012-02-19 11:04:14

You could try using SMART instead, like this:
program new;
{$i SRL/SRL/MISC/SMART.simba}
{$i SRL/SRL.simba}

const
WORLD = 35;
MEMBERS = False;

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

with Players[0] do
begin
Name := '';
Pass := '';

Active := True;
end;
end;

procedure MainLoop;
begin
end;

procedure Setup;
begin
SMART_Server := WORLD;
SMART_Members:= MEMBERS;

SetupSRL;
DeclarePlayers;
LoginPlayer;
SetAngle(SRL_ANGLE_HIGH);
ClearDebug;


end;

begin
Setup;
end.

This is the script skeleton I use. It will enable SMART and won't change the world each time you run the script. Allowing you to script with SMART active instead of having to deal with the standard Runescape client.

Imagine

2012-02-19 11:06:19

I do have smart, but the problem there was that it takes a long time to startup smart and log in each time :/

Does SMART adapt to script changes, or must you close and re-start SMART?

RISK

2012-02-19 11:07:47

SMART will 'Adapt' to the changes you do in your script, yes. I'm scripting my fishing guild script right now with SMART and I'm doing a lot of changes. It works fine with each change. You just have to run the script again.
As I said with my skeleton example, it won't reset each time you run the script.

By the way, a cow's defining color would be the darker of it, right?

Imagine

2012-02-19 11:11:52

I'm going to try using the darker part of it, I'll update this to let you know how it goes.

EDIT:

And if my account is F2P, what do I change the

SMART_Members:= MEMBERS;

to?

RISK

2012-02-19 11:13:28

Why not PM me? In case I or someone else doesn't see this thread.

E: Change the option at the top of the skeleton 'MEMBERS = False' depending on what you want. True = Members, False = Non-members.

Imagine

2012-02-19 11:31:09

Now it is complaining that it needs an identifier at line 57, but it was fine before…

program New;
{$i SRL\SRL.simba}
{$DEFINE SMART}



/////// Credits to YohoJo
Const
SERVER = 61; // Enter "0" to pick a random server.
MEMBERS = False; // Set to True if using a RS-Members account. False if F2P.
SRLStats_Username = ''; // Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
NumbOfPlayers= 1; //How many players are you using
StartPlayer= 0; //Player to start auoting with! (0 means first char)
WORLD = 35;

///////
procedure DeclarePlayers; //Credits to YoHoJo
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'oins'];

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
Active := True;
end;

end;
///////
Var NCowsK, TXP:Integer;
///////
procedure StatsGuise(wat:String); //Credits to YoHoJo
begin
Status(wat);
Disguise(wat);
end;

//////
procedure Setup;
begin
SMART_Server := WORLD;
SMART_Members:= MEMBERS;

SetupSRL;
DeclarePlayers;
LoginPlayer;
SetAngle(SRL_ANGLE_HIGH);
ClearDebug;
//////

Function FoundCow:Boolean;
var
x, y: Integer;
begin
if FindObjCustom(x, y, ['ack Co', 'ttack C'], [2896690, 6719385, 13620696, 728612], 20) then

WriteLn('Hooray, we found a cow!')
end;

begin
Setup;
// repeat
FoundCow();
// until(false);
end.

RISK

2012-02-19 11:32:16

You have no 'end' at the end of the 'Setup' procedure.
procedure Setup;
begin
SMART_Server := WORLD;
SMART_Members:= MEMBERS;

SetupSRL;
DeclarePlayers;
LoginPlayer;
SetAngle(SRL_ANGLE_HIGH);
ClearDebug;
end;