Jump to content
RSBud

Classic 2007 RS Bot - Error In Loop?

Recommended Posts

I don't get it. I've made 4 versions of this bot on my server, and this one, its the most I've ever given into a script..

 

I used all the skills I' had learned on scar.. I don't know much.

 

The ERROR: It works for about idk... It makes about 14 pots every 1.52 mins, It made over 7k Pots before it messed up and ran away from its target botting area... When I went on there and ran back to the spot, it started working like normal again... And I let it go for an hour and it continued the whole time, flawlessly..

 

WTF

 

Is it possible to code like a anti-run method?

here's my code if there's any problems please tell!

 

program PathToOverloads;

var
o,a,r,rs,m,s,d,x,y: Integer;


procedure StartScript;
begin
Wait(300);
o := 0;
a := 0;
r := 0;
rs := 0;
m := 0;
s := 0;
d := 0;
end;

procedure OpenBank;
begin
 if(FindColor(x,y,15724015,0,0,516,337)) then
  begin
   MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
   Wait(50+random(10));
   ClickMouse(x, y, False);
   Wait(72+random(15));
   MoveMouseSmoothEx(x+random(2),y+40,20,40,45,25,20);
   Wait(20+random(15));
   ClickMouse(x+random(2),y+40,True);
   Wait(1730+random(500));
 end;
end;

procedure DumpBank;
begin
 Wait(1500+random(300));
 if FindColor(x, y, 4578368, 379, 290, 411, 312) then
  begin
   MoveMouseSmoothEx(x, y+random(2),20,40,45,25,20);
   Wait(600+random(25));
   ClickMouse(x, y, True);
  end;
end;

procedure Extreme_ABanking; //Super-Attack Pot Withdraw
begin
 WriteLn('You have made: '+IntToStr(a*14)+'Extreme Attacks');
 Wait(300+random(600));
 if FindColor(x, y, 13848397, 31, 78, 72, 118) then
  begin
   MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
   Wait(30+random(15));
   ClickMouse(x, y+random(5), False);
   Wait(300+random(20));
   MoveMouseSmoothEx(x, y+90+random(2),20,40,45,25,20);
   Wait(45+random(10));
   ClickMouse(x, y+90+random(2), True);
   Wait(3500+random(20));
   SendKeysSilent('14'+chr(13));
   Wait(45+random(5));
   Writeln('14 Attack_Potions to turn to Extremes!');
  end;
end;

procedure Extreme_AHBanking;   //Attack_Herb to mix
begin
 Wait(300+random(600));
 if FindColor(x, y, 2775318, 77, 80, 114, 106) then
  begin
   MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
   Wait(30+random(15));
   ClickMouse(x, y+random(5), False);
   Wait(300+random(20));
   MoveMouseSmoothEx(x, y+90+random(2),20,40,45,25,20);
   Wait(45+random(10));
   ClickMouse(x, y+90+random(2), True);
   Wait(3500+random(50));
   SendKeysSilent('14'+chr(13));
   Wait(45+random(5));
   Writeln('14 Herbs to turn to Extremes!');
   a := a + 1;
  end;
end;

procedure CloseBank;
begin
 Wait(600);
 MoveMouseSmoothEx(487, 27+random(2),20,40,45,25,20);
 Wait(300+random(600));
 ClickMouse(487, 27, True);
end;

procedure MakePots;
begin
 Wait(985);
 MoveMouseSmoothEx(663, 336+random(2),20,40,45,25,20);
 Wait(230+random(15));
 ClickMouse(662+random(2), 337, True);
 Wait(50+random(20));
 MoveMouseSmooth(620, 343);
 Wait(90+random(2000));
 ClickMouse(620, 342, True);
 Wait(300);
 MoveMouseSmoothEx(260+random(5),423+random(3),20,40,45,25,20);
 Wait(1785+random(78));
 ClickMouse(260, 425, False);
 Wait(564+random(10));
 MoveMouseSmoothEx(260, 425+53,20,40,45,25,20);
 Wait(1000+random(100));
 ClickMouse(260, 477, True);
 Wait(47000+random(10000));
 Writeln('Made 14 Pots!');
end;

procedure Extreme_SBanking; //Sujper_Strength Withdraw
begin
WriteLn('You have made: '+IntToStr(s*14)+'Extreme Strengths');
 Wait(300+random(600));
 if FindColor(x, y, 13553360, 123, 80, 159, 111) then
  begin
   MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
   Wait(30+random(15));
   ClickMouse(x, y+random(5), False);
   Wait(300+random(20));
   MoveMouseSmoothEx(x, y+90+random(2),20,40,45,25,20);
   Wait(45+random(10));
   ClickMouse(x, y+90+random(2), True);
   Wait(3500+random(50));
   SendKeysSilent('14'+chr(13));
   Wait(45+random(5));
   Writeln('14 Strength_Potions to turn to Extremes!');
  end;
end;

procedure Extreme_SHBanking;   //Strength-Herb Withdraw
begin
 Wait(300+random(600));
 if FindColor(x, y, 609545, 165, 80, 205, 106) then
  begin
   MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
   Wait(30+random(15));
   ClickMouse(x, y+random(5), False);
   Wait(300+random(20));
   MoveMouseSmoothEx(x, y+90+random(2),20,40,45,25,20);
   Wait(45+random(10));
   ClickMouse(x, y+90+random(2), True);
   Wait(3500+random(50));
   SendKeysSilent('14'+chr(13));
   Wait(45+random(5));
   Writeln('14 Herbs to turn to Extremes!');
   s := s + 1;
  end;
end;

procedure Extreme_DBanking;//Defense(super) Pot Withdraw
begin
 WriteLn('You have made: '+IntToStr(d*14)+'Extreme Defences');
 Wait(300+random(600));
 if FindColor(x, y, 3451083, 213, 80, 246, 111) then
  begin
   MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
   Wait(30+random(15));
   ClickMouse(x, y+random(5), False);
   Wait(300+random(20));
   MoveMouseSmoothEx(x, y+90+random(2),20,40,45,25,20);
   Wait(45+random(10));
   ClickMouse(x, y+90+random(2), True);
   Wait(3500+random(50));
   SendKeysSilent('14'+chr(13));
   Wait(45+random(5));
   Writeln('14 Defence_Potions to turn to Extremes!');
  end;
end;

procedure Extreme_DHBanking;   //Defense-Herb Withdraw
begin
 Wait(300+random(600));
 if FindColor(x, y, 4937737, 255, 80, 291, 106) then
  begin
   MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
   Wait(30+random(15));
   ClickMouse(x, y+random(5), False);
   Wait(300+random(20));
   MoveMouseSmoothEx(x, y+90+random(2),20,40,45,25,20);
   Wait(45+random(10));
   ClickMouse(x, y+90+random(2), True);
   Wait(3500+random(50));
   SendKeysSilent('14'+chr(13));
   Wait(45+random(5));
   Writeln('14 Herbs to turn to Extremes!');
   d := d + 1;
  end;
end;

procedure Extreme_MBanking; //Magic Pot Withdraw
begin
 WriteLn('You have made: '+IntToStr(M*14)+'Extreme Magics');
 Wait(300+random(600));
 if FindColor(x, y, 12162391, 301, 80, 335, 111) then
  begin
   MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
   Wait(30+random(15));
   ClickMouse(x, y+random(5), False);
   Wait(300+random(20));
   MoveMouseSmoothEx(x, y+90+random(2),20,40,45,25,20);
   Wait(45+random(10));
   ClickMouse(x, y+90+random(2), True);
   Wait(3500+random(50));
   SendKeysSilent('14'+chr(13));
   Wait(45+random(5));
   Writeln('14 Magic_Potions to turn to Extremes!');
  end;
end;

 procedure Extreme_MHBanking;   //Magic-Herb Withdraw
begin
 Wait(300+random(600));
 if FindColor(x, y, 4144964, 345, 80, 378, 106) then
  begin
   MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
   Wait(30+random(15));
   ClickMouse(x, y+random(5), False);
   Wait(300+random(20));
   MoveMouseSmoothEx(x, y+90+random(2),20,40,45,25,20);
   Wait(45+random(10));
   ClickMouse(x, y+90+random(2), True);
   Wait(3500+random(50));
   SendKeysSilent('14'+chr(13));
   Wait(45+random(5));
   Writeln('14 Ground_Mud_Runes to turn to Extremes!');
   m := m + 1;
  end;
end;

procedure Extreme_RBanking; //Range Pot Withdraw
begin
 WriteLn('You have made: '+IntToStr(r*14)+'Extreme Ranges');
 Wait(300+random(600));
 if FindColor(x, y, 13872968, 388, 80, 421, 118) then
  begin
   MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
   Wait(30+random(15));
   ClickMouse(x, y+random(5), False);
   Wait(300+random(20));
   MoveMouseSmoothEx(x, y+90+random(2),20,40,45,25,20);
   Wait(45+random(10));
   ClickMouse(x, y+90+random(2), True);
   Wait(3500+random(50));
   SendKeysSilent('14'+chr(13));
   Wait(45+random(5));
   Writeln('14 Ranging_Potions to turn to Extremes!');
  end;
end;

procedure Extreme_RHBanking;   //Ranging-Herb withdraw(grenwalls)
begin
 Wait(300+random(600));
 if FindColor(x, y, 1188650, 434, 80, 467, 106) then
  begin
   MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
   Wait(30+random(15));
   ClickMouse(x, y+random(5), False);
   Wait(300+random(20));
   MoveMouseSmoothEx(x, y+90+random(2),20,40,45,25,20);
   Wait(45+random(10));
   ClickMouse(x, y+90+random(2), True);
   Wait(3500+random(50));
   SendKeysSilent('14'+chr(13));
   Wait(45+random(5));
   Writeln('14 Grenwall_Spikes to turn to Extremes!');
   r := r + 1;
  end;
end;

procedure Extreme_RSBanking; //Energy Withdraw
begin
 WriteLn('You have made: '+IntToStr(rs*14)+'Special Restores');
 Wait(300+random(600));
 if FindColor(x, y, 10181053, 37, 116, 69, 148) then
  begin
   MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
   Wait(30+random(15));
   ClickMouse(x, y+random(5), False);
   Wait(300+random(20));
   MoveMouseSmoothEx(x, y+90+random(2),20,40,45,25,20);
   Wait(45+random(10));
   ClickMouse(x, y+90+random(2), True);
   Wait(3500+random(50));
   SendKeysSilent('14'+chr(13));
   Wait(45+random(5));
   Writeln('14 Super_Energy_Poitns to turn to Extremes!');
  end;
end;

  procedure Extreme_RSHBanking;   //Special-Restore Herb Withdraw
begin
 Wait(300+random(600));
 if FindColor(x, y, 1690551, 85, 128, 109, 146) then
  begin
   MoveMouseSmoothEx(x,y+random(0),20,40,45,25,20);
   Wait(30+random(15));
   ClickMouse(x, y+random(5), False);
   Wait(300+random(20));
   MoveMouseSmoothEx(x, y+90+random(2),20,40,45,25,20);
   Wait(45+random(10));
   ClickMouse(x, y+90+random(2), True);
   Wait(3500+random(50));
   SendKeysSilent('14'+chr(13));
   Wait(45+random(5));
   Writeln('14 Papaya_Fruit to turn to Extremes!');
   rs := rs + 1;
  end;
end;

procedure StartScriptLoop; //Scriptloop
begin
StartScript;
 repeat
  OpenBank;
    DumpBank;
     Wait(300);
      Extreme_ABanking;
       Extreme_AHBanking;
        CloseBank;
         MakePots;
 Until(a > 100);
 repeat //StrenghExtremes
  OpenBank;
   DumpBank;
    Wait(300);
     Extreme_SBanking;
      Extreme_SHBanking;
       CloseBank;
        MakePots;
 Until(s > 100);
 repeat //DefenceExtremes
 OpenBank;
  DumpBank;
   Wait(300);
    Extreme_DBanking;
     Extreme_DHBanking;
      CloseBank;
       MakePots;
 Until(d > 100);
 repeat //MagicExtremes
 OpenBank;
  DumpBank;
   Wait(300);
    Extreme_MBanking;
     Extreme_MHBanking;
      CloseBank;
       MakePots;
 Until(m > 100);
 repeat //RaningExtremes
 OpenBank;
  DumpBank;
   Wait(300);
    Extreme_RBanking;
     Extreme_RHBanking;
      CloseBank;
       MakePots;
 Until(r > 100);
 repeat //SpecialRestores
  OpenBank;
   DumpBank;
    Wait(300);
     Extreme_RSBanking;
      Extreme_RSHBanking;
       CloseBank;
        MakePots;
 Until(rs > 100);
end;

begin
repeat
StartScriptLoop;
Until(o > 100);
WriteLn('You have made: '+IntToStr(a*14)+'Extreme Attacks');
WriteLn('You have made: '+IntToStr(s*14)+'Extreme Strengths');
WriteLn('You have made: '+IntToStr(d*14)+'Extreme Defences');
WriteLn('You have made: '+IntToStr(m*14)+'Extreme Magics');
WriteLn('You have made: '+IntToStr(r*14)+'Extreme Ranges');
WriteLn('You have made: '+IntToStr(rs*14)+'Special Restores');
end.

 

THANKS!

Link to comment
Share on other sites

fail safes are golden, make sure you have one to log off if it cant find whatever. And dang you got enough repeats in there? Maybe look into SPS? It might be that after a while it just wont find the color, or SCAR gets mad, I doubt it though. Like do if can't find bank, log off. Maybe one of your color finds on there gets messed up? You can use this method to debug your script.

 

Also, Welcome to the Scar Divi forums.

Edited by LordJashin
Link to comment
Share on other sites

Can anyone help me come up with a decent failsafe? I need it to run back, you see.. In my script if it dosnt find the certain color begining a precedure it simple skips to the next precedure:

 

AKA. OpenBank (cant find bnaker) goes to CloseBank, cant find bank, goes to makepots or w.e. ect.

Edited by RSBud
Link to comment
Share on other sites

Can anyone help me come up with a decent failsafe? I need it to run back, you see.. In my script if it dosnt find the certain color begining a precedure it simple skips to the next precedure:

 

AKA. OpenBank (cant find bnaker) goes to CloseBank or w.e. ect.

 

You can use the Exit statement. Example:

 

[sCAR]if FindColor(...) then begin

 

end else begin

exit; //exit the procedure

end;

[/sCAR]

 

or you can use this method:

 

[sCAR]

procedure Banking;

begin

repeat

if findColor(....) then begin

 

end else begin

break; //Break the loop and go to //Do something

end;

until false;

//Do something

end;[/sCAR]

Link to comment
Share on other sites

You can use the Exit statement. Example:

 

[sCAR]if FindColor(...) then begin

 

end else begin

exit; //exit the procedure

end;

[/sCAR]

 

or you can use this method:

 

[sCAR]

procedure Banking;

begin

repeat

if findColor(....) then begin

 

end else begin

break; //Break the loop and go to //Do something

end;

until false;

//Do something

end;[/sCAR]

 

 

Yes, yes.. Although these methods are good, I rather find something a little more dynamic..

I will use the exit procedure though, but that's only if the failsafe fails to run back to botting area.....

Which I hope I can come up with or, something.. Thanks for the help though!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...