Log in

View Full Version : Need Help Finding an Error on my First Script



in flames 57xx
02-14-2012, 01:51 PM
Well basically here's my error. Instead of just hovering to one tree and saying "we found a tree", it instead hovers over a tree, then another, and another... eventually going onto different colors (like the Runescape client frames and stuff), and then just spazzes out and leaves the window and goes to my start button and gets stuck there.


program Chopps;
//{$DEFINE SMART}
{.include SRL\SRL.simba}
{.Include SRL\SRL\Misc\Debug.simba}

Const
SRLStats_Username = ''; // Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
BreakEvery = 120;
Breakfor = 5;
Version = '1.0';
NumbOfPlayers= 1; //How many players are you using
StartPlayer= 0; //Player to start auoting with! (0 means first char)




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

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
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(192) Of
0: HoverSkill('Mining', False);
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;

Function CheckAndClick(X,Y:Integer):Boolean;
Begin
MMouse(x, y, 5, 5);
{Wait(100 + Random(50));
If CountUpColor('B', 41, 5, 86, 24, 70, 140) Then}
If WaitUpTextMulti(['Mine','ine'], 150) Then
Begin
Result:=True;
GetMousePos(x, y);
Mouse(x, y, 0, 0,True);
Wait(100+Random(50));
FFlag(0);
End;
End;

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

Function ChopDown: BooLean;
Var
x, y: Integer;

Begin
//FindObjCustom(x, y, ['att', 'ack'], [123456, 345678], 5);
if FindObjCustom(x, y, ['Chop', 'down'], [1055001 , 1911853, 1845288, 1252379 ], 15) Then
WriteLn('Yea i found a tree');
End;



Begin

SetupSRL;
DeclarePlayers;
//Repeat
Chopdown;
//Until(False);

End.











And this is the debug box:


Hint] (72:10): Variable 'Result' never used at line 71
Compiled successfully in 858 ms.
SRL Compiled in 15 msec
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.

Help please and thank you :P <3

in flames 57xx
02-15-2012, 02:49 AM
Still needing help :/..

Paradoxium
02-16-2012, 03:20 AM
it goes everywhere because you commented out the define smart...and your using Yohojos tut!!! its real good isnt it :D but here look you gotta Click on it when it finds it, btw also make everything its wc not mining lol. There is a lot of other 'stuff' in there that you are not using and some you dont really need. What I learned is that if I dont really know what it is doing...I just cant use it lol. Remember, you can put antiban in there but if you dont put it in the main loop(the begin and end. at the bottom) it wont do it.try this, i cleaned it up a bit but did not test it, Enjoy!

program Chopps;
//{$DEFINE SMART}
{.include SRL\SRL.simba}
{.Include SRL\SRL\Misc\Debug.simba}

Const
SRLStats_Username = ''; // Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
BreakEvery = 120;
Breakfor = 5;
Version = '1.0';
NumbOfPlayers= 1; //How many players are you using
StartPlayer= 0; //Player to start auoting with! (0 means first char)




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

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
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(192) Of
0: HoverSkill('Woodcutting', False); //changed from wc to mining
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;

{Function CheckAndClick(X,Y:Integer):Boolean;
Begin
MMouse(x, y, 5, 5);
{Wait(100 + Random(50));
If CountUpColor('B', 41, 5, 86, 24, 70, 140) Then //commented out because what you really want to do is just click
If WaitUpTextMulti(['Mine','ine'], 150) Then //you could use this but you also could just bring it down to your Chopdown
Begin
Result:=True;
GetMousePos(x, y);
Mouse(x, y, 0, 0,True);
Wait(100+Random(50));
FFlag(0);
End;
End; }

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

Function ChopDown: BooLean;
Var
x, y: Integer;

Begin
//FindObjCustom(x, y, ['att', 'ack'], [123456, 345678], 5);
if FindObjCustom(x, y, ['hop', 'own'], [1055001 , 1911853, 1845288, 1252379 ], 15) Then //this should checkUptext(you dont want the full words because simba doesnt do capitalized letters) and find the color(i dont use this so im not sure)
MMouse(x,y,0,0); //this will move mouse to the x and y coor of where color was found
ClickMouse(x,y,mouse_left); //this will click the left button on the mouse where the x and y were found
WriteLn('Yea i found a tree');
End;



Begin

SetupSRL;
DeclarePlayers;
//Repeat
Chopdown;
//Until(False);

End.