SRL Archive - OSR Help

I got it to do something!! and then it stopped...


cradlefatal

2013-02-26 13:55:54

okay my script compiles just fine it opens up smart and logs you in but when you are at the mines it does nothing and the mouse disapears can anyone tell me what i'm missing need to change around because no matter what I try to do change the color or the mouse speed every time I run it, it does the same thing
program new;
{$DEFINE SMART8}
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}
procedure DeclarePlayers;
begin
HowManyPlayers := 1; // This is set to the total amount of players (more on multiplayer later ;)), for now, just keep it set as 1
NumberOfPlayers(HowManyPlayers); // This is a procedure in SRL which sets up player arrays (also, more on that later), this will always be the same
CurrentPlayer := 0; // This is the player to start with; the first player will always be 0 (you'll find out when you learn all about arrays)

Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username; used for random event detection
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
end;

begin
ClearDebug;
SetupSRL;
DeclarePlayers; // Calls the procedure, you can't forget this!
LoginPlayer; // You want your player to login, right?
end.
const
//Credits to YoHoJo for an understandable tutorial video, and Solidone4 for the antiban
begin
Version = 1.0;
Rock = 'Coal'
//Start at Mining Spot with pickaxe wielded


End;

Procedure ProgressReport; Forward;

Var RockPattern: Array Of TIntegerArray;
Var TOres,TLoads,WeMined,StartTime,GemDTM:Integer;
Var RT, ChatBox, TExperiance, LastPainted:Integer;



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

procedure Antiban;
begin
Case Random(20000) Of

0:
begin
HoverSkill('Mining', False);
GameTab(Tab_Inv);
end;
1:
begin
PickUpMouse;
SleepAndMoveMouse(3000 + Random(500));
PickUpMouse;
end;
2: ExamineInv;
3:
begin
RandomAngle(SRL_ANGLE_HIGH);
SetAngle(SRL_ANGLE_HIGH);
end;
4:
begin
GameTab(Tab_Stats);
Wait(3000 + Random(500));
GameTab(Tab_Inv);
end;
5:
begin
HoverSkill('random', False);
GameTab(Tab_Inv);
end;

end;
end;

procedure FailSafe(Reason:String);
begin
Players [CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
ProgressReport;
TerminateScript;
end;
begin

procedure minecoal;
var x, y: integer;
begin
if FindObj(x, y, 'Coal' 'Min' 'oal' 'ine' 'Mine' 'rocks', 81316374,1974561,3160642, 35) then
begin
Mouse(x, y, 2, 2, false);
ChooseOption('Coal');
end;
end;





Function CheckAndClick(UpText:String; X,Y:Integer; RClick:String):Boolean;
Begin
MMouse(x, y, 5, 5);
If WaitUptext(UpText, 150) Then
Begin
Result:=True;
GetMousePos(x, y);

Case RClick Of

'R':
Begin
Mouse(x, y, 0, 0, False);
WaitOption('ine', 500);
//FFlag(3);
End;

'L':
Begin
Mouse(x, y, 0, 0,True);
//FFlag(3);
End;

End;
End;

End;










Smart_FixSpeed:=True;
SRL_SixHourFix:=True;
SetupSRL;
MouseSpeed:=30
DeclarePlayers;
StartTime:=GetSystemTime;
ProgXP;
BasicSetup;
TOres:=0;'
MarkTime(LastPainted);

FindNormRandoms;

StatsGuise(Players[CurrentPlayer].Nick + 'logging in'
LoginPlayer; if (SRL_Logs < 1) then SRL_Logs :=0;
Players[CurrentPlayer].Integers[82];=0;
Players[CurrentPlayer].Level[15]:=GetSkillLevel(Skill_Mining)
GameTab(Tab_Inv)
StatsGuise(Players[CurrentPlayer].Nick + 'Mining Lv' +IntToStr(Players[CurrentPlayer].Level[15]))
SetRun(True)
SetAngle(SRL_ANGLE_High);
FindNormalRandoms;
//Repeat;
//Until(False);
End.

x[Warrior]x3500

2013-02-26 14:01:39

tell me where your main loop is (i know where it is, but that is the error in which this is occurring, and i want you to be able to point it out).

cradlefatal

2013-02-26 14:12:15

ohhhhhhhhhhh i forgot to take out the //

cradlefatal

2013-02-26 14:13:23

sorry for the long reply went across the street to the store

x[Warrior]x3500

2013-02-26 14:15:20

its all good

begin
ClearDebug;
SetupSRL;
DeclarePlayers; // Calls the procedure, you can't forget this!
LoginPlayer; // You want your player to login, right?
end.

that is your main loop. as you can see, the only thing inside of it, is the loginplayer.

edit:
a main loop consists of a "begin" and a "end." (with a period!). only 1 main loop per script. whatever happens in the main loop, thats what will happen in the script.

cradlefatal

2013-02-26 14:16:35

well that made the mouse stay on the screen after my toon is logged in but it still doesn't move

cradlefatal

2013-02-26 14:19:00

and so if I want it to move the mouse then i just put in the minecoal function

x[Warrior]x3500

2013-02-26 14:20:53

(i slightly edited the post above)
also, basic structure of a script here is something like this:


program new;
{includes here}

{global variables/constants here}

{functions/procedures}

{main loop}


this structure helps others know exactly where everything is when trying to analyze/help you with code. and it also help you understand exactly where everything is inside our own code :)

one last thing, all the code at the bottom isnt in anything :/ so it shouldnt run

edit:
just confirmed. anything below the main loop is simply ignored by simba. so all those funtions wont even be registered.

cradlefatal

2013-02-26 14:32:07

i'm not sure what you mean what are global variables

x[Warrior]x3500

2013-02-26 14:37:22

oh, global vs local variables:

global variables are variables that can be used anywhere through out the script. they can be used in any function or your main loop.

local variables are variables that can only be used within the function that they are declared in.



program new;
{includes}
var // global vars here
i: integer; // a global var

procedure printI();
var //local vars right after you declare the procedure
a: integer; // a local var
begin
a:= 8;
writeln(tostr(i));
writeln(tostr(a));
end;

begin // <- main loop start
i:= 10;
printI();
end.

cradlefatal

2013-02-26 14:46:58

okay now i'm getting an error [Error] C:\Simba\Scripts\newminer.simba(19:1): Semicolon (';') expected at line 18
Compiling failed.


program new;
{$DEFINE SMART8}
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}



const
//Credits to YoHoJo for an understandable tutorial video, and Solidone4 for the antiban

Version = 1.0;
Rock = 'Coal'
//Start at Mining Spot with pickaxe wielded




Procedure ProgressReport; Forward;

Var RockPattern: Array Of TIntegerArray;
Var TOres,TLoads,WeMined,StartTime,GemDTM:Integer;
Var RT, ChatBox, TExperiance, LastPainted:Integer;

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

procedure Antiban;
begin
Case Random(20000) Of

0:
begin
HoverSkill('Mining', False);
GameTab(Tab_Inv);
end;
1:
begin
PickUpMouse;
SleepAndMoveMouse(3000 + Random(500));
PickUpMouse;
end;
2: ExamineInv;
3:
begin
RandomAngle(SRL_ANGLE_HIGH);
SetAngle(SRL_ANGLE_HIGH);
end;
4:
begin
GameTab(Tab_Stats);
Wait(3000 + Random(500));
GameTab(Tab_Inv);
end;
5:
begin
HoverSkill('random', False);
GameTab(Tab_Inv);
end;

end;
end;

procedure FailSafe(Reason:String);
begin
Players [CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
ProgressReport;
TerminateScript;
end;
begin

procedure minecoal;
var x, y: integer;
begin
if FindObj(x, y, 'Coal' 'Min' 'oal' 'ine' 'Mine' 'rocks', 81316374,1974561,3160642, 35) then
begin
Mouse(x, y, 2, 2, false);
ChooseOption('Coal');
end;
end;



Function CheckAndClick(UpText:String; X,Y:Integer; RClick:String):Boolean;
Begin
MMouse(x, y, 5, 5);
If WaitUptext(UpText, 150) Then
Begin
Result:=True;
GetMousePos(x, y);

Case RClick Of

'R':
Begin
Mouse(x, y, 0, 0, False);
WaitOption('ine', 500);
//FFlag(3);
End;

'L':
Begin
Mouse(x, y, 0, 0,True);
//FFlag(3);
End;

End;
End;

End;



procedure DeclarePlayers;
begin
HowManyPlayers := 1; // This is set to the total amount of players (more on multiplayer later ;)), for now, just keep it set as 1
NumberOfPlayers(HowManyPlayers); // This is a procedure in SRL which sets up player arrays (also, more on that later), this will always be the same
CurrentPlayer := 0; // This is the player to start with; the first player will always be 0 (you'll find out when you learn all about arrays)

Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username; used for random event detection
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
end;



begin
ClearDebug;
minecoal;
DeclarePlayers; // Calls the procedure, you can't forget this!
LoginPlayer; // You want your player to login, right?
Smart_FixSpeed:=True;
SRL_SixHourFix:=True;
SetupSRL;
MouseSpeed:=30
DeclarePlayers;
StartTime:=GetSystemTime;
ProgXP;
BasicSetup;
TOres:=0;'
MarkTime(LastPainted);

FindNormRandoms;

StatsGuise(Players[CurrentPlayer].Nick + 'logging in'
LoginPlayer; if (SRL_Logs < 1) then SRL_Logs :=0;
Players[CurrentPlayer].Integers[82];=0;
Players[CurrentPlayer].Level[15]:=GetSkillLevel(Skill_Mining)
GameTab(Tab_Inv)
StatsGuise(Players[CurrentPlayer].Nick + 'Mining Lv' +IntToStr(Players[CurrentPlayer].Level[15]))
SetRun(True)
SetAngle(SRL_ANGLE_High);
FindNormalRandoms;
Repeat;
Until(False);
End.

x[Warrior]x3500

2013-02-26 14:49:47

well reading the error, it says that you are missing a ; somewhere. a line should ahve been highlighted orange. in my experience, all you have to do is look at the line above that (rock = …) and fix that line. (compare to the version = … line)

cradlefatal

2013-02-26 14:52:50

okay I get a unknown identifier after fixing it at
procedure minecoal;
var x, y: integer;
begin
if FindObj(x, y, 'Coal' 'Min' 'oal' 'ine' 'Mine' 'rocks', 81316374,1974561,3160642, 35) then
begin
Mouse(x, y, 2, 2, false);
ChooseOption('Coal');
end;
end;

x[Warrior]x3500

2013-02-26 14:55:35

you should have changed that constant to Rock = 'Coal';

now. you will have more errors (your code before had a few errors, but u didnt get error messages because it was ignoring all the functions before).

the next error is further down the screen. look above the highlighted line, and tell me why there is a begin there. with all begins, you MUST have an end. and that begin isnt even in a function. it is causing the error.

the next error will be in your findObj() function. you are using multiple uptext, but it only wants 1 word for uptext. you are also using multiple colors, but it only wants one

cradlefatal

2013-02-26 14:59:05

oh ok ty

cradlefatal

2013-02-26 15:05:09

okay now I'm getting an unknown identifier I got the errors worked out and now i'm getting a unknown identifier [Error] C:\Simba\Scripts\newminer.simba(145:3): Unknown identifier 'BasicSetup' at line 144
Compiling failed.
program new;
{$DEFINE SMART8}
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}



const
//Credits to YoHoJo for an understandable tutorial video, and Solidone4 for the antiban

Version = 1.0;
Rock= 'Coal';
//Start at Mining Spot with pickaxe wielded




Procedure ProgressReport; Forward;

Var RockPattern: Array Of TIntegerArray;
Var TOres,TLoads,WeMined,StartTime,GemDTM:Integer;
Var RT, ChatBox, TExperiance, LastPainted:Integer;

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

procedure Antiban;
begin
Case Random(20000) Of

0:
begin
HoverSkill('Mining', False);
GameTab(Tab_Inv);
end;
1:
begin
PickUpMouse;
SleepAndMoveMouse(3000 + Random(500));
PickUpMouse;
end;
2: ExamineInv;
3:
begin
RandomAngle(SRL_ANGLE_HIGH);
SetAngle(SRL_ANGLE_HIGH);
end;
4:
begin
GameTab(Tab_Stats);
Wait(3000 + Random(500));
GameTab(Tab_Inv);
end;
5:
begin
HoverSkill('random', False);
GameTab(Tab_Inv);
end;

end;
end;

procedure FailSafe(Reason:String);
begin
Players [CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
ProgressReport;
TerminateScript;
end;


procedure minecoal;
var x, y: integer;
begin
if FindObj(x, y, 'Coal', 81316374, 35) then
begin
Mouse(x, y, 2, 2, false);
ChooseOption('Coal');
end;
end;



Function CheckAndClick(UpText:String; X,Y:Integer; RClick:String):Boolean;
Begin
MMouse(x, y, 5, 5);
If WaitUptext(UpText, 150) Then
Begin
Result:=True;
GetMousePos(x, y);

Case RClick Of

'R':
Begin
Mouse(x, y, 0, 0, False);
WaitOption('Coal', 500);
//FFlag(3);
End;

'L':
Begin
Mouse(x, y, 0, 0,True);
//FFlag(3);
End;

End;
End;

End;



procedure DeclarePlayers;
begin
HowManyPlayers := 1; // This is set to the total amount of players (more on multiplayer later ;)), for now, just keep it set as 1
NumberOfPlayers(HowManyPlayers); // This is a procedure in SRL which sets up player arrays (also, more on that later), this will always be the same
CurrentPlayer := 0; // This is the player to start with; the first player will always be 0 (you'll find out when you learn all about arrays)

Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username; used for random event detection
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
end;



begin
ClearDebug;
minecoal;
DeclarePlayers; // Calls the procedure, you can't forget this!
LoginPlayer; // You want your player to login, right?
Smart_FixSpeed:=True;
SRL_SixHourFix:=True;
SetupSRL;
MouseSpeed:=30
DeclarePlayers;
StartTime:=GetSystemTime;
BasicSetup;
TOres:=0;'
MarkTime(LastPainted);

FindNormRandoms;

StatsGuise(Players[CurrentPlayer].Nick + 'logging in'
LoginPlayer; if (SRL_Logs < 1) then SRL_Logs :=0;
Players[CurrentPlayer].Integers[82];=0;
Players[CurrentPlayer].Level[15]:=GetSkillLevel(Skill_Mining)
GameTab(Tab_Inv)
StatsGuise(Players[CurrentPlayer].Nick + 'Mining Lv' +IntToStr(Players[CurrentPlayer].Level[15]))
SetRun(True)
SetAngle(SRL_ANGLE_High);
FindNormalRandoms;
Repeat;
Until(False);
End.

x[Warrior]x3500

2013-02-26 15:17:40

well that's because there isn't a function in your script called basicSetup. you are trying to call a non-existent function

cradlefatal

2013-02-26 15:19:21

where do I find it at

x[Warrior]x3500

2013-02-26 15:20:49

idk. never heard of basicSetup. if you are copying and pasting from some tutorial, i would suggest looking there.

cradlefatal

2013-02-26 15:30:15

okay now i'm getting this [Error] C:\Simba\Scripts\newminer.simba(181:1): Unknown identifier 'FindNormRandoms' at line 180


program new;
{$DEFINE SMART8}
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}



const
//Credits to YoHoJo for an understandable tutorial video, and Solidone4 for the antiban

Version = 1.0;
Rock= 'Coal';
//Start at Mining Spot with pickaxe wielded




Procedure ProgressReport; Forward;

Var RockPattern: Array Of TIntegerArray;
Var TOres,TLoads,WeMined,StartTime,GemDTM:Integer;
Var RT, ChatBox, TExperiance, LastPainted:Integer;



procedure ProgressReport;
var Sec,Orerate,LoadRate:integer;
begin
SRLRandomsReport;
Stats_Commit;
Sec:= (1+((Getsystemtime-PlayerStartTime)/1000));
OreRate:=(3600*(TOres))/(Sec);
LoadRate:=(3600*(TLoads))/(Sec);
Writeln(' ');
Writeln ('/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\');

Writeln ('\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/');
Writeln('| Worked for '+ TimeRunning);
Writeln('| Mined '+IntToStr(TOres)+' ores at a rate of '+IntToStr(OreRate)+' per hour');
Writeln('| Mined '+IntToStr(TLoads)+' loads at a rate of '+IntToStr(LoadRate)+' per hour');
Writeln ('<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>');
end;





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

procedure Antiban;
begin
Case Random(20000) Of

0:
begin
HoverSkill('Mining', False);
GameTab(Tab_Inv);
end;
1:
begin
PickUpMouse;
SleepAndMoveMouse(3000 + Random(500));
PickUpMouse;
end;
2: ExamineInv;
3:
begin
RandomAngle(SRL_ANGLE_HIGH);
SetAngle(SRL_ANGLE_HIGH);
end;
4:
begin
GameTab(Tab_Stats);
Wait(3000 + Random(500));
GameTab(Tab_Inv);
end;
5:
begin
HoverSkill('random', False);
GameTab(Tab_Inv);
end;

end;
end;

procedure FailSafe(Reason:String);
begin
Players [CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
ProgressReport;
TerminateScript;
end;


procedure minecoal;
var x, y: integer;
begin
if FindObj(x, y, 'Coal', 81316374, 35) then
begin
Mouse(x, y, 2, 2, false);
ChooseOption('Coal');
end;
end;



Function CheckAndClick(UpText:String; X,Y:Integer; RClick:String):Boolean;
Begin
MMouse(x, y, 5, 5);
If WaitUptext(UpText, 150) Then
Begin
Result:=True;
GetMousePos(x, y);

Case RClick Of

'R':
Begin
Mouse(x, y, 0, 0, False);
WaitOption('Coal', 500);
//FFlag(3);
End;

'L':
Begin
Mouse(x, y, 0, 0,True);
//FFlag(3);
End;

End;
End;

End;



Procedure BasicSetup;
Begin
SetArrayLength(RockPattern,2);

RockPattern[0]:=[1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,24,28];
RockPattern[1]:=[1,5,9,13,17,21,25,26,22,18,14,10,6,2,3,7,11,15,19,23,27,28,24,20,16,12,8,4];
End;


procedure DeclarePlayers;
begin
HowManyPlayers := 1; // This is set to the total amount of players (more on multiplayer later ;)), for now, just keep it set as 1
NumberOfPlayers(HowManyPlayers); // This is a procedure in SRL which sets up player arrays (also, more on that later), this will always be the same
CurrentPlayer := 0; // This is the player to start with; the first player will always be 0 (you'll find out when you learn all about arrays)

Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username; used for random event detection
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
end;



begin
ClearDebug;
minecoal;
DeclarePlayers; // Calls the procedure, you can't forget this!
LoginPlayer; // You want your player to login, right?
Smart_FixSpeed:=True;
SRL_SixHourFix:=True;
SetupSRL;
MouseSpeed:=30
DeclarePlayers;
StartTime:=GetSystemTime;
MarkTime(LastPainted);

FindNormRandoms;

StatsGuise(Players[CurrentPlayer].Nick + 'logging in'
LoginPlayer; if (SRL_Logs < 1) then SRL_Logs :=0;
Players[CurrentPlayer].Integers[82];=0;
Players[CurrentPlayer].Level[15]:=GetSkillLevel(Skill_Mining)
GameTab(Tab_Inv)
StatsGuise(Players[CurrentPlayer].Nick + 'Mining Lv' +IntToStr(Players[CurrentPlayer].Level[15]))
SetRun(True)
SetAngle(SRL_ANGLE_High);
FindNormalRandoms;
Repeat;
Until(False);
End.

x[Warrior]x3500

2013-02-26 15:33:30

thats the the same error as before. same answer

cradlefatal

2013-02-26 15:35:59

i think i found it i forgot to past back the info for the login stuff lols im such an idiot

x[Warrior]x3500

2013-02-26 15:39:38

just takes a little bit of time to learn XD

cradlefatal

2013-02-26 15:39:56

i'm still getting the same error I have my procedure procedure
 DeclarePlayers;
begin
HowManyPlayers := 1; // This is set to the total amount of players (more on multiplayer later ;)), for now, just keep it set as 1
NumberOfPlayers(HowManyPlayers); // This is a procedure in SRL which sets up player arrays (also, more on that later), this will always be the same
CurrentPlayer := 0; // This is the player to start with; the first player will always be 0 (you'll find out when you learn all about arrays)

Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username; used for random event detection
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
end;





and the error is here




FindNormRandoms;

StatsGuise(Players[CurrentPlayer].Nick + 'logging in'
LoginPlayer; if (SRL_Logs < 1) then SRL_Logs :=0;
Players[CurrentPlayer].Integers[82];=0;
Players[CurrentPlayer].Level[15]:=GetSkillLevel(Skill_Mining)
GameTab(Tab_Inv)
StatsGuise(Players[CurrentPlayer].Nick + 'Mining Lv' +IntToStr(Players[CurrentPlayer].Level[15]))
SetRun(True)
SetAngle(SRL_ANGLE_High);
FindNormalRandoms;
Repeat;

x[Warrior]x3500

2013-02-26 15:52:36

take password out
edit:
and its in ur statusguise line.

cradlefatal

2013-02-26 15:59:07

its all good i got tired of changing my script so i changed my runescape pass incase i accedentally did that lols

x[Warrior]x3500

2013-02-26 16:00:12

i do that all the time . just gotta watch out because ppl will take ur account :/

cradlefatal

2013-02-26 16:00:32

its all good i changed my rs pass incase i accedentally did that what should I do with the statusguise?

x[Warrior]x3500

2013-02-26 16:05:36

either just get rid of it, or finish it off. its not a finished statement.