Well i'm working on a power chopper lately and Its gotten a lot better. I have 2 main problems.
1. It keeps selecting the tree closest to the top left corner and keeps moving large distances.
2. Ever since about 15 minutes ago after it chops one tree it randomly stops doing anything. I really want to fix this before anything else cause I can't use the script at all :P
Any help would be appriciated
SCAR Code:
program Chopper;
{.include SRL/SRL/Misc/Smart.scar}
{.include srl/srl.scar}
//Just fill in your username,pass,nick and run,make sure you have an axe out and are near trees
//only drops inv slots 6-28
// and if u can't read whats before these comments it uses SMART O.o
var
clicks:integer;
procedure Login;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := 'username';
Players[0].Pass := 'password';
Players[0].Nick := 'nick';
Players[0].Active := True;
end;
procedure progressreport;
begin
Writeln('[]========================================[]');
Writeln('---------------->Power chopper<----------------');
Writeln(' Chopped ' + IntToStr(Clicks) + ' trees' + ' ');
Writeln('[]========================================[]');
Wait (1000)
end;
procedure randomlog;
begin
if (clicks) = 40 then
logout;
wait(60000 + random (120000));
login;
loginplayer
end;
procedure Chop;
var
x, y : integer;
Begin
If (LoggedIn) then
begin
if FindObjTPA(x,y,1583156,20,-1,7,7,15,['ree']) = true then
begin
repeat
Wait(2000 + Random(425));
Mouse(x,y,0,0,false);
Wait(200 + Random(225));
chooseoption('hop');
wait(400+ random (152));
until (FindBlackChatMessage('You swing your axe at the tree')) or (FindBlackChatMessage('You get some logs'))
Clicks := Clicks + 1;
If not (LoggedIn) then
exit;
end;
end;
end;
Procedure drop;
var
i: Integer;
Begin
If (LoggedIn) then
begin
Gametab(4);
For i := 6 to 28 do
If ExistsItem(i) then
DropItem(i);
If not (loggedin) then
exit;
end;
end;
Procedure Mainloop;
begin
smartSetup('mn3', False, True);
While Not (SmartReady) Do
Wait(100);
SetTargetDC(SmartGetDC);
If Not (LoggedIn) Then
While Not (SmartGetColor(386, 249) = 65535) Do
Wait(100);
SetupSRL;
Login;
ActivateClient;
LoginPlayer
If (InvFull) Then
drop;
Repeat
Chop;
Progressreport;
If (InvFull) Then
drop;
randomlog;
Until(false)
end;
begin
Mainloop;
end.
*Note that this is my first script thats been edited a few times so its nothing great :P