Guest User

Untitled

a guest
Nov 14th, 2011
791
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 9.62 KB | None | 0 0
  1. //J-PowerMine 1.2.1b
  2. //JaminB
  3.  
  4. //Instructions: Set Client to safemode and set screen sizing to fixed. Position character in a rock cluster and hit run. EDIT THE VALUES WITH SPECIFIED IN THE ---EDIT THESE VALUES-- Section.
  5.  
  6. //WARNING THIS SCRIPT IS WILL DROP EVERYTHING IN INVENTORY PLEASE EQUIP PICK. OTHER OPTIONS WILL BE ADDED SOON\\
  7.  
  8. program DeclarePlayers;
  9. {$i srl/srl/misc/smart.scar} // This is how we include SMART; it HAS to be included BEFORE SRL!
  10. {$i srl/srl.scar}
  11.  
  12. //***************************EDIT THESE VALUES***************************\\
  13. const
  14. MINING_GOAL=1000; //<-------CHANGE THIS VALUE FOR HOW MANY YOU WANT TO MINE.
  15. STARTING_LEVEL=72;   //<-------CHANGE THIS TO YOUR CURRENT MINING LEVEL
  16. ORE_TYPE='coal';
  17.  
  18. var
  19. Current:Integer;
  20. Keeper:Integer;
  21. Experience:Integer;
  22. Base:Integer;
  23. WaitTime:Integer;
  24. Xp:Integer; //the amount of experience based on ore type.
  25.  
  26. procedure DeclarePlayers;
  27. begin
  28.   HowManyPlayers := 1; //LEAVE ALONE
  29.   NumberOfPlayers(HowManyPlayers); //LEAVE ALONE
  30.   CurrentPlayer := 0; //LEAVE ALONE
  31.  
  32.   Players[0].Name := 'ENTERUSERNAME HERE'; // Username                                          }========================
  33.   Players[0].Pass := 'ENTERPASSWORD HERE'; // Password                                              }CHANGE THE VALUES INSIDE
  34.   Players[0].Nick := 'ENTE'; // First four letters of 'Ingame username'                   }
  35.   Players[0].Active := True; // DON'T EDIT THIS ONE                                       }    THE '       '
  36.   Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin              }========================
  37. end;
  38.  
  39. //*************************************************************************\\
  40.  
  41. procedure AssignGlobal;
  42. begin
  43.   Current:=0;
  44.  
  45.   Experience:=0;
  46.   Base:=0;
  47.   WaitTime:=(Base+Random(2013));
  48. end;
  49.  
  50. procedure Antirandom;
  51. begin
  52.   FindNormalRandoms; // Whenever this is called, the script will check to see if your character is in a random event
  53.   FindNonInventoryRandoms//Checks for non-inventory random events
  54.  
  55.   LampSkill := 'mining';
  56. end;
  57.  
  58. procedure Antiban;
  59. begin
  60.   case Random(157) of // Random(60) generates a random integer from 0 to 59
  61.     10: RandomRClick;
  62.     20: HoverSkill('Mining', False);
  63.     30: PickUpMouse;
  64.     40: RandomMovement;
  65.     50: BoredHuman;
  66.     59: ExamineInv;
  67.     60: ArrangeInv;
  68.   end;
  69. end;
  70.  
  71. procedure CheckLost; //If the bot can't find ore it will attempt to locate a mining symbol on the map and mine there.
  72. var
  73. current,fails,x,y: Integer;
  74. begin
  75. if FindColor(x, y, 8355710, 562, 7, 697, 150) AND
  76.   FindColor(x, y, 1260388, 562, 7, 697, 150) then
  77.   begin
  78.     Mouse(x+Random(11), y+Random(6), Random(3), Random(4),True);
  79.     Wait(5000+Random(2432));
  80.   end
  81. end;
  82.  
  83. procedure SetMineSpeed; //based on the level you set above this determines how often to click a new rock.
  84. var
  85.   level: integer;
  86. begin
  87.   level:=STARTING_LEVEL;
  88.   if(level<15) then
  89.   begin
  90.     Base := 12000;
  91.     writeln('Your mining speed has been set to an appropiate speed for a level: ' + IntToStr(STARTING_LEVEL));
  92.   end;
  93.   if(level>=15) AND (level<=20) then
  94.   begin
  95.     Base := 10000;
  96.   end;
  97.   if(level>=21) AND (level<=26) then
  98.   begin
  99.     Base := 8000;
  100.   end;
  101.   if(level>=27) AND (level<=33) then
  102.   begin
  103.     Base := 6000;
  104.   end;
  105.   if(level>=34) AND (level<=40)then
  106.   begin
  107.     Base := 5000;
  108.   end;
  109.   if(level>=41) AND (level<=49) then
  110.   begin
  111.     Base := 4000;
  112.   end;
  113.   if(level>=50) AND (level<=60) then
  114.   begin
  115.     Base := 3000;
  116.   end;
  117.   if(level>=61) AND (level<=75) then
  118.   begin
  119.     Base := 2000;
  120.   end;
  121.  
  122.   if(level>75) then
  123.   begin
  124.     Base := 1000;
  125.   end;
  126.   writeln('Your mining speed has been set to an appropiate speed for a level: ' + IntToStr(STARTING_LEVEL)+'. J-PowerMiner will click a new rock about every '+IntToStr(Base/1000)+' seconds.');
  127. end;
  128.  
  129. procedure Leave; //Once finished the script will terminate.
  130. begin
  131. TerminateScript
  132. writeln('Finished');
  133. end;
  134.  
  135. procedure Unstucker;
  136. begin
  137.   if (Keeper>5) then
  138.       begin
  139.       Mouse(524,24,6,6,true) // position the compass north
  140.       KeyDown(38);
  141.       Wait(RandomRange(500,1000));
  142.       KeyUp(38);
  143.       wait(Random(600));
  144.       Mouse(617,130,6,6,true) // click another place on the map
  145.       Keeper:=0;
  146.       end;
  147. end;
  148.  
  149. //IronRockFinder searches for rocks in an area and if they are available clicks them\\
  150. procedure IronRockFinder;
  151.   var
  152.   current,fails,x,y: Integer;
  153.   randomColor,color:LongInt;
  154.   begin
  155.     current:=Random(11); //drops before full.
  156.     randomColor:=(2503511-Random(2))
  157.     fails:=0;
  158.  
  159.   repeat
  160.     if (FindColorTolerance(x, y, randomColor, 4, 4, 515, 337,2)    OR
  161.     (FindColorTolerance(x, y, randomColor, 4, 4, 515, 337,1))) then
  162.  
  163.  
  164.     begin
  165.       Xp:=35; //sets the value of the experince gained per ore to 35.
  166.       Wait(WaitTime+2);
  167.       MMouse(x, y, Random(6), (7));
  168.       wait(400+Random(200))
  169.       writeln(GetUpText);
  170.       if (IsUpText('Mine')) then
  171.       begin
  172.         writeln('Clicking On Iron');
  173.         WaitTime:=(Base+(random(2313)));
  174.         randomColor:=(2503511+Random(2))
  175.         Antiban;
  176.         color:=(GetColor(x,y));
  177.         writeln('The color of this iron ore is '+IntToStr(color));
  178.         ClickMouse2(true);
  179.         fails:=0;
  180.         Inc(current);
  181.       end
  182.         else
  183.         begin
  184.            WaitTime:=0;
  185.            Antiban;
  186.            MMouse((x+random(105)),(y+random(109)),(random(9)),(random(5)));
  187.            Writeln('This is not iron');
  188.            writeln('The color of this pixel is '+IntToStr(color));
  189.            Wait(Random(100));
  190.         end
  191.     end
  192.   else
  193.   begin
  194.     Writeln('SORRY FOUND NO IRON!');
  195.     Antiban;
  196.     Antirandom;
  197.     fails:=fails+1;
  198.     Wait(5000);
  199.   end;
  200.  
  201.   if (fails=3) then //There are no rocks here...possibly a random or bot is confused.
  202.   begin
  203.     CheckLost;
  204.   end;
  205.  
  206.   if ClickToContinue=true then
  207.     begin
  208.     Antirandom;
  209.     ClickContinue(true,true);
  210.     current:=24;
  211.   end;
  212.  
  213.   if (fails>5) then //The bot is definately confused...or lost...logout
  214.   begin
  215.   Logout;
  216.   end;
  217.   if (fails>6) then //Kill script
  218.   begin
  219.   Leave;
  220.   end;
  221.  
  222.   if ClickToContinue=true then
  223.     begin
  224.     Antirandom;
  225.     ClickContinue(true,true);
  226.     current:=24;
  227.   end;
  228. until(current=24);
  229. end;
  230.  
  231. //CoalRockFinder searches for rocks in an area and if they are available clicks them\\
  232. procedure CoalRockFinder;
  233.   var
  234.   current,fails,x,y: Integer;
  235.   randomColor,color:LongInt;
  236.   begin
  237.     Xp:=50; //sets the value of experience gained per ore to 50.
  238.     KeyDown(38);
  239.     Wait(RandomRange(500,1000));
  240.     KeyUp(38);
  241.     current:=Random(11); //drops before full.
  242.     randomColor:=(1645082-Random(2))
  243.     fails:=0;
  244.  
  245.   repeat
  246.     if (FindColorTolerance(x, y, randomColor, 4, 4, 515, 337,2)    OR
  247.     (FindColorTolerance(x, y, randomColor, 4, 4, 515, 337,1))) then
  248.  
  249.  
  250.     begin
  251.       Wait(WaitTime+4000); //Time between clicks Level Base + 4 seconds
  252.       MMouse(x, y, Random(6), (7));
  253.       wait(400+Random(200))
  254.       writeln(GetUpText);
  255.       if (IsUpText('Mine')) then
  256.       begin
  257.         writeln('Clicking On Coal');
  258.         WaitTime:=(Base+(random(2313)));
  259.         randomColor:=(1645082+Random(2))
  260.         Antiban;
  261.         color:=(GetColor(x,y));
  262.         writeln('The color of this coal ore is '+IntToStr(color));
  263.         ClickMouse2(true);
  264.         fails:=0;
  265.         Inc(current);
  266.       end
  267.         else
  268.         begin
  269.            WaitTime:=0;
  270.            Antiban;
  271.            MMouse((x+random(105)),(y+random(109)),(random(9)),(random(5)));
  272.            Writeln('This is not coal');
  273.            writeln('The color of this pixel is '+IntToStr(color));
  274.            Keeper:=Keeper+1;
  275.            Unstucker;
  276.            writeln('The keeper is: '+IntToStr(Keeper));
  277.            if (FindColorTolerance(x, y, 7976927, 4, 4, 515, 337,1)) then
  278.            begin
  279.             Mouse(x, y, Random(3), (4),true);
  280.            end;
  281.  
  282.  
  283.            Wait(Random(100));
  284.         end
  285.     end
  286.   else
  287.   begin
  288.     Writeln('SORRY FOUND NO COAL!');
  289.     Antiban;
  290.     Antirandom;
  291.     fails:=fails+1;
  292.     Wait(2000);
  293.   end;
  294.  
  295.   if (fails=3) then //There are no rocks here...possibly a random or bot is confused.
  296.   begin
  297.     KeyDown(38);
  298.     Wait(RandomRange(500,1000));
  299.     KeyUp(38);
  300.     CheckLost;
  301.   end;
  302.  
  303.   if ClickToContinue=true then
  304.     begin
  305.     Antirandom;
  306.     ClickContinue(true,true);
  307.     current:=24;
  308.   end;
  309.  
  310.   if (fails>5) then //The bot is definately confused...or lost...logout
  311.   begin
  312.   Logout;
  313.   end;
  314.   if (fails>6) then //Kill script
  315.   begin
  316.   Leave;
  317.   end;
  318.  
  319.   if ClickToContinue=true then
  320.     begin
  321.     Antirandom;
  322.     ClickContinue(true,true);
  323.     current:=24;
  324.   end;
  325. until(current=24);
  326. end;
  327.  
  328.  
  329. procedure WhichRock(ORE_TYPE:String);
  330. begin
  331.   case Lowercase(ORE_TYPE) of
  332.   'iron':
  333.   IronRockFinder;
  334.   'coal':
  335.   CoalRockFinder;
  336.   else
  337.   Writeln('none of the above');
  338.   end;
  339. end;
  340.  
  341.  
  342. procedure Getinfo;
  343. begin
  344.   Current:=InvCount+Current;
  345.   Experience:=Current*Xp;
  346.   writeln('You have mined: ' + IntToStr(Current)+' ores.');
  347.   writeln('You have gained: ' + IntToStr(Experience)+' xp.');
  348.   writeln('You have been mining for:' + TimeRunning+'.');
  349. end;
  350.  
  351. begin //Main method
  352.   // These 4 lines HAVE to be set BEFORE you call SetupSRL;
  353.   Smart_Members := True;
  354.   Smart_Signed := True;
  355.   Smart_SuperDetail := False;
  356.   Wait(1000);
  357.   Writeln('STARTING SMART CLIENT -- THIS MAY TAKE SEVERAL MINUTES')
  358.   SetupSRL;
  359.   Writeln('PREPARING TO LOGIN');
  360.   DeclarePlayers; // Calls the procedure, you can't forget this!
  361.   LoginPlayer; // You want your player to login, right?
  362.   SetMineSpeed;
  363.   Wait(15000);
  364.   repeat
  365.   Antirandom
  366.   Antiban
  367.   WhichRock(Ore_TYPE);
  368.   Getinfo;
  369.   DropAll;
  370.   until(Current>=MINING_GOAL);
  371.   Leave;
  372. end.
  373.  
Advertisement
Add Comment
Please, Sign In to add comment