Log in

View Full Version : help with first script



i p0t u drop
01-29-2012, 12:47 PM
If someone can help me with my first script. Please reply!


program mineNdrop;

{.include/SRL/SRL.simba}
{.include SRL/SRL/Misc/SMART.simba}
{.include SRL\SRL.simba}
{.Include SRL\SRL\Misc\Debug.simba}

procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; //Username
Players[0].Pass := ''; //Password
Players[0].Nick := ''; //4 character Nickname for you character
Players[0].Active := True;
Players[0].Pin := ''; //Pin, leave blank if none
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;

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

Procedure Antiban;
Begin
Case Random(192) Of
0: HoverSkill('Mining', False); //skill
1: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500)); End;
2: ExamineInv;
3: RandomAngle(1);
4: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv); End;
5: HoverSkill('random', False);
End;
End;

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

Function CheckAndClick(UpText:String; X, Y:Integer; Stronger:Boolean):Boolean;
Begin
MMouse(x, y, 5, 5);
If WaitUptext (UpText, 5000) Then
Begin
GetMousePos(x, y);
If Stronger Then
Begin
Mouse(X, Y, 0, 0, False);
Result:=WaitOption('tta', 3000)
End Else
Begin
Mouse(x, y, 0, 0, True);
Wait (100+Random(50));
FFlag(0);
End;
End;
End;

Function Powermining:Boolean;
Var
X, Y, PlusOne, OreCounter: Integer;
Begin
plusone:=InvCount +1;
If FindObjCustom(X, Y, ['Mine', 'Rocks'], [7895165 , 9605785, 8684938, 7039856], 15) Then
WriteLn('we found tin');
GetMousePos(x, Y);

Case Random(2) Of
0: Mouse(X, Y, 8, 8, True);
1: Begin
Mouse(X, Y, 8, 8, False);
WaitOption('Mine', 500);
End;
End;

Repeat
MarkTime (OreCounter);
Antiban;
Wait(100);
If InvCount=Plusone Then
Writeln('We got one');
Until (InvCount=Plusone) Or (TimeFromMark(OreCounter) > 7000)
End;







Begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
MakeCompass('N');
//SetAngle[True];
Repeat
Powermining;
Until(false);
end.

[Hint] (68:10): Variable 'Result' never used at line 67
Compiled successfully in 530 ms.

when i compile i get error saying

Jhangir
01-29-2012, 02:54 PM
Post the script and your problem first

i p0t u drop
01-29-2012, 03:19 PM
there u go

Hero
01-29-2012, 03:23 PM
That isn't an error. You are getting that because you are not utilizing the result line since you are using a function. You should use that as a procedure instead.


procedure PowerMining;
Var
X, Y, PlusOne, OreCounter: Integer;
Begin
plusone:=InvCount +1;
If FindObjCustom(X, Y, ['Mine', 'Rocks'], [7895165 , 9605785, 8684938, 7039856], 15) Then
WriteLn('we found tin');
GetMousePos(x, Y);

Case Random(2) Of
0: Mouse(X, Y, 8, 8, True);
1: Begin
Mouse(X, Y, 8, 8, False);
WaitOption('Mine', 500);
End;
End;

Repeat
MarkTime (OreCounter);
Antiban;
Wait(100);
If InvCount=Plusone Then
Writeln('We got one');
Until (InvCount=Plusone) Or (TimeFromMark(OreCounter) > 7000)
End;

i p0t u drop
01-29-2012, 03:33 PM
i change procedure from function then just start getting bunch of errors

Supertrent1
01-29-2012, 03:46 PM
i change procedure from function then just start getting bunch of errors

Then just leave it. The worst that will happen is you get a hint every time you run your script. The script will function fine even with result not being used.