SRL Archive - OSR Help

I'm not understanding whats going wrong with this script.


imaloser

2011-12-28 16:26:38

So I'm trying to make a Maple power chopper and it was working at first until I started adding things to the script without bothering to compile and check for errors.

I'm new to scripting, Don't know jack shit about it but I'm very interested in trying to get into and I'm not about to stop. I've spent all day trying to figure out whats wrong with my script but no luck :/

program imalosersPCHOPPA;

//{$DEFINE SMART}
{$i SRL\SRL.scar}
{$i SRL\SRL\Misc\stats.simba}

Const
//SRL Stats
SRLStats_Username = '';
SRLStats_Password = '';
BreakEvery = 120;
Breakfor = 5;
NumbofPlayers= 1;
StartPlayer= 0;



Procedure DeclarePlayers;
var I:Integer;
Begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['XP', 'Gem', 'ostume', 'ithril', 'oal', 'une'];

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;


Function CheckAndClick(UpText, Option:String; X,Y:Integer; Rclick:Boolean):Boolean;
Begin
MMouse(x, y, 5, 5);
If WaitUptext(UpText, 1500+Random(500)) Then
Begin
Result:=True;
GetMousePos(x, Y);
If RClick Then
Begin
Mouse(x, y, 0, 0, False);
Result:= WaitOption(Option, 2000);
If Result Then FFlag(0);
End Else
Begin
Mouse(x, y, 0, 0, True);
Wait(100+Random(50));
FFlag(0);
End;
End;
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;
TerminateScript;
End;

Function ChopDown:Boolean;
Var
eX, eY, PlusOne, TreeCounter: Integer;
Begin
Plusone:= InvCount + 1;
If FindObjCustom(eX , eY, ['Chop', 'down', 'Maple', 'tree', 'p d'], [1517903, 3370627, 2111337], 3) Then
Begin
StatsGuise('Fk Yea, We found them Capitan!!');
GetMousePos(eX, eY);

Case Random(2) of
0: Mouse(eX, eY, 5, 5, True);
1: Begin
Mouse(eX, eY, 5, 5, False);
Wait(100+Random(100));
ChooseOption('Ch');
End;
End;

Repeat
MarkTime(TreeCounter);
Antiban;
Wait(100);
If InvCount=Plusone then
WriteLn('We got one');
Until (InvCount=Plusone) Or (TimeFromMark(TreeCounter) > 7000)

End;
End;

Begin

SetupSRL;
DeclarePlayers;
SetAngle(True);
Repeat
Chopdown;
Until(False);

End.

What it does when I run it is the mouse goes straight for the inventory icon and doesn't budge or move at all, If anyone can tell me what I did wrong and point out to me why my error didn't work you'd be helping me out a lot.

YoHoJo

2011-12-28 16:30:41

Try repacking tree colors and raising the tolerance too.
Does the statsguise ever even say 'fk ya we found it'? (check the taskbar/Simba and see if you see it telling you that)

imaloser

2011-12-28 16:33:18

From: YoHoJo
Try repacking tree colors and raising the tolerance too.
Does the statsguise ever even say 'fk ya we found it'? (check the taskbar/Simba and see if you see it telling you that)


[Hint] C:\Simba\Includes\SRL/SRL/core/gametab.scar(1607:3): Variable 'PREVIOUS' never used at line 1606
[Hint] (86:10): Variable 'Result' never used at line 85

I've done all that several times, It was working fine til I started throwing extra stuff in for antiban's. I was actually watching your video lol Part 1.
Reason why the tolerance is so low is because I was getting good colors off the maples and anything higher then 8 would make it go crazy for a good few seconds which like you said ain't good :p

YoHoJo

2011-12-28 16:42:48

Question still remains: does statsguise actually say anything about finding it or no?

And yeah I noticed that :).

imaloser

2011-12-28 17:20:39

Well when I run the script as I posted it statguise doesn't mention anything. The cursor goes straight for the inventory icon and doesnt move even when I try to move it myself it goes flying back to the inventory icon as if it were a baby whining for its mommas teets

imaloser

2011-12-28 19:36:17

I managed to get it like a fkin a baws, Now I'm just trying to make it a little better and a lot less spazy like Lol.