SRL Archive - OSR Help

Its coming along nicely but still I'm having battle of the errors


cradlefatal

2013-02-25 23:30:33

this is what I have so far I am making a coal truck miner this is the error that I get i've tried putting semicolons everywhere it tells me but it doesn't do any good
[Error] C:\Simba\Scripts\newminer.simba(21:1): Semicolon (';') expected at line 20
Compiling failed.
program new;
{$DEFINE SMART8}
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}

Const

//Credits to will become up to date when script is in working order so I can find all the people that helped me and give them credits
Version = 1.0;
Rock = 'Coal'
//Start at Mining Spot with pickaxe wielded
begin`
Procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
for i := 0 to 1-1 do
Players[i].BoxRewards := ['Mining'];

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Active := True;
Integers[1] := 4; //1=BrightCopper,2=DarkCopper,3=Tin,4=Iron.
Integers[2] := 4; //Seconds to try mining rock before clicking another.
End;
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;

Function CheckAndClick(UpText:String; X,Y:Integer; RClick:String):Boolean;
Begin
MMouse(x, y, 1, 1);
If WaitUptext(UpText, 5) Then
Begin
Result:=True;
GetMousePos(x, y);
End;
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;

Function MineCoalrock:Boolean;
Var
x,y: Integer;
Begin
If FindObjCustom(x, y, ['mine', 'Coal', 'e l s'], [2039840] ,2) then;
Begin
StatsGuise('We Found The Rock');
End;

End;
Begin


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.

Runehack123

2013-02-25 23:51:36

Seems straightforward:
[Error] C:\Simba\Scripts\newminer.simba(21:1): Semicolon (';') expected at line 20
Somewhere along line 20 it's finding an error.

Common error help:
http://villavu.com/forum/showthread.php?t=82793

I recommend looking at a script in the public section for inspiration. Why not my firemaker? Here's the link ;)
http://villavu.com/forum/showthread.php?t=96231
Just use the player record from that and see if that fixes things for you.

cradlefatal

2013-02-26 00:30:42

thank you I finally figured it out that I had everything in the wrong area of the script I now have it clicking close to the mines I just need to figure out a way to make it ignore colors but its coming along nicely

Runehack123

2013-02-26 00:39:00

No problem :) Good job on getting it to work!
Use these for better colour finding…
http://docs.villavu.com/simba/scriptref/tpa.html

Here is a TuT that explains it…
http://villavu.com/forum/showthread.php?t=49067

And here is the ACA tool used to create functions like that…
http://villavu.com/forum/showthread.php?t=26944
(Better to make your own though of course. Be sure to give credit if you use the function creator. It's great for finding colours, hue, sat, tol values!)

This will help you make object finding even more accurate! :) It's a lot to take in, but if you understand some of the basics it can really improve your script accuracy and reliability.