SRL Archive - OSR Help

Please Help


rytoke

2013-01-12 03:42:10

Can I get some help with the following?

[Hint] C:\Simba\Scripts\PowerChopper.simba(70:10): Variable 'Result' never used at line 69
[Error] C:\Simba\Scripts\PowerChopper.simba(126:40): Type mismatch at line 125
Compiling failed.

Program PowerChopper;

{$DEFINE SMART}
{$i SRL\SRL.simba}

Const
SRLStats_Username = '';// Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
BreakEvery = 120; //How Many Minutes To Break After
BreakFor = 5; //How Long To Break For
Version = '1.0b';
NumbOfPlayers= 1; //How many players are you using
StartPlayer= 0; //Player to start autoing with! (0 means first char)



Var
TooLong:Integer;

procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer :=StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players.BoxRewards := ['mote', 'otsume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];

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 StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;

Procedure Antiban;
Begin
Case Random(250) Of
0: Begin StatsGuise ('AntiBan') GameTab(tab_Stats) HoverSkill('Woodcutting', False) GameTab(28) End;
1: Begin StatsGuise ('AntiBan') SleepAndMoveMouse (7000 + Random(500)); End;
2: Begin StatsGuise ('AntiBan') GameTab(tab_Inv) ExamineInv; GameTab(28); End;
3: Begin StatsGuise ('AntiBan') RandomAngle(1); End;
4: Begin StatsGuise ('AntiBan') GameTab(Tab_Stats) Wait (3000 + Random(500)); GameTab(28); End;
5: Begin StatsGuise ('AntiBan') GameTab(tab_Stats) HoverSkill('random', False); GameTab(28); End;
End;
End;

Procedure FailSafe(Reason:String);
Begin
Players[CurrentPlayer].Loc:=Reason
Logout;
Stats_Commit;
Writeln(Reason);
TerminateScript;
End;

Function ChopDown:Boolean;
Var
seX, seY, PlusOne, TreeCounter: Integer;
Begin
MarkTime(TooLong);
FindNormalRandoms;
PlusOne:= InvCount +1;
//If FindObjCustom(seX, seY, ['Chop', 'down', 'p d'], [1128488, 1984576, 2510920, 2701360], 10) Then
Sex:=MSCX;
Sey:=MSCY;
If FindObjTPA(SeX, SeY, 2905438, 10, 1, 15, 60, 600, ['Cho']) Then
Begin
StatsGuise('Hooray, we found a tree!');
GetMousePos(Sex, Sey);
Case Random(2) Of
0: Mouse(SeX, SeY, 5, 5, True);
1: Begin
Mouse(SeX, SeY, 5, 5, False);
WaitOption('Chop', 500);
End;
End;

Flag;
MarkTime(TreeCounter);
If (TimeFromMark(TooLong) > 30000) Then
FailSafe('Could Not Find Tree');
Repeat
If (TimeFromMark(TooLong) > 30000) Then
FailSafe('Could Not Find Tree');
FindNormalRandoms;
StatsGuise('AntiBan and Waiting');
Antiban;
Wait(1000);
If InvCount=Plusone Then
Writeln('We Got One!');
Until (InvCount=Plusone) or (TimeFromMark(TreeCounter) > 5000)
End;
End;

Procedure DropLogs;
var
SeX, SeY, LogDTM, I:Integer;
SlotBox:TBox;
LogPattern:TIntegerArray;

Begin
MarkTime(TooLong);
LogDTM := DTMFromString('mbQAAAHicY2VgYFjNwsAwB4h3AvFWIF4IxBOZGBimA/FMIO4A4m4gtjHhB6pmRMH/GTABIxYMBgB4vwfV');
LogPattern:=[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];
For I:=0 To 27 Do
Begin
FindNormalRandoms;
StatsGuise('Dropping Log:' + IntToStr(I));
SlotBox:=InvBox(LogPattern);
If FindDTm(LogDTM,SeX,SeY,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
MouseItem (LogPattern,False);
ChooseOption ('Drop');
End;

End;
MarkTime(TooLong);
End;


begin
SetupSRL;
DeclarePlayers;
Repeat
ChopDown;
If InvFull Then
DropLogs;
Until(false);

end.

riwu

2013-01-12 03:51:12

Second parameter for MouseItem is an integer but you passed a Boolean to it. Use SRL integer constants: mouse_move, mouse_Left, move_Right.

rytoke

2013-01-12 04:01:42

They didn't work. :|
Still getting the same issue.

riwu

2013-01-12 04:28:53

What's the issue? Hint is not an error, it's simply because ur function result is unused.

YoHoJo

2013-02-04 03:54:44

This is the tutorial section, It's intended for Tutorials which help/teach users how to code.
I've moved it to the scripting help section for you, please use that next time.
Also it's also best to post all simba code in Simba tags when psoting so it's much easier to read.

[.Simba]
Program SimbaTags;
Begin
Writeln('Code goes in between these');
End;

^ Like that, but without the "." so


Program SimbaTags;
Begin
Writeln('Code goes in between these');
End;

Chris!

2013-02-04 04:46:13

Adding to what YoHoJo said, with the recent forum upgrade there is a new feature with the SIMBA tags!

Use [noparse]
[/noparse]! It adds line numbers to your code so it's easier to get help. Example:

program Oharroder;
{i SRL/srl.simba}

procedure Errors;
begin
RandomCode here; //Error starts here please help
end;

begin
Writeln('Well... SIMBA tags are pro?');
Errors;
end.

You get the point.