Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 4.59 KB | None | 0 0
  1. {$DEFINE SMART}
  2. {$I SRL\SRL.scar}
  3. {$I Reflection\reflection.simba}
  4.  
  5. const
  6.   Server = 123;   //You should find a non-crowded world before you let the script run!
  7.   Signed = False; //False highly recommended!
  8.  
  9.   TimeBetween = 2000;   //Time between players or breaks, in seconds (randomized)
  10.   BreakTime   = 60 * 3; //Time to break for, in seconds (randomized)
  11.  
  12. var
  13.   MonkTime: TIntegerArray;
  14.   bTime: Integer;
  15.  
  16. procedure DeclarePlayers;
  17. begin
  18.   NumberOfPlayers(1);
  19.  
  20.   with Players[0] do
  21.   begin
  22.     Name := '';
  23.     Pass := '';
  24.     Nick := '';
  25.     Active := True;
  26.     Pin := '';
  27.     Integers := [200]; //health to heal at (the new number, e.g. 50 not 5)
  28.     Strings := ['ranging']; //lamp skill
  29.     BoxRewards := ['lamp', 'gold'];
  30.   end;
  31. end;
  32.  
  33. function MonkArea(Tile: TTile): Integer;
  34. begin
  35.   if (((Tile.x = 3044) or (Tile.x = 3045)) and ((Tile.y >= 3493) and (Tile.y <= 3498))) or
  36.     ((Tile.x = 3046) and ((Tile.y = 3497) or (Tile.y = 3498))) then
  37.   begin
  38.     Result := 0;
  39.     Exit;
  40.   end;
  41.   if (((Tile.x = 3044) or (Tile.x = 3045)) and ((Tile.y <= 3488) and (Tile.y >= 3482))) or
  42.     (((Tile.y >= 3482) and (Tile.y <= 3484)) and ((Tile.x >= 3046) and (Tile.x <= 3048))) then
  43.   begin
  44.     Result := 1;
  45.     Exit;
  46.   end;
  47.   if (Tile.x <= 3051) then
  48.     Result := 2
  49.   else
  50.     Result := 3;
  51. end;
  52.  
  53. procedure UpdateTimers;
  54. var
  55.   MonkArray: TNPCArray;
  56.   i: Integer;
  57. begin
  58.   MonkArray := GetNPCs(7727);
  59.   for i := 0 to High(MonkArray) do
  60.     if (MonkArray[i].Animation = 836) then  //836 = Dying animation
  61.       MarkTime(MonkTime[MonkArea(MonkArray[i].Tile)]);
  62. end;
  63.  
  64. procedure Heal;
  65. var
  66.   Monk: TNPC;
  67.   mPoint: TPoint;
  68. begin
  69.   while (R_GetMMLevels('hp') < R_GetSkillLevel('hp') * 9) do
  70.   begin
  71.     repeat
  72.       Monk := GetNPC(7727);
  73.       if (TileOnMS(Monk.Tile, 200)) then
  74.         mPoint := TileToMS(Monk.Tile, 200)
  75.       else
  76.       begin
  77.         if (TileOnMM(Monk.Tile)) then
  78.           mPoint := TileToMM(Monk.Tile);
  79.         Mouse(mPoint.x, mPoint.y, 2, 2, True);
  80.         Wait(800 + Random(600));
  81.         while (GetMe.Speed > 0) do  //Try to click while walking instead?
  82.           Wait(1);
  83.         Monk := GetNPC(7727);
  84.         if (TileOnMS(Monk.Tile, 200)) then
  85.           mPoint := TileToMs(Monk.Tile, 200)
  86.       end;
  87.     until PointInBox(mPoint, IntToBox(MSX1, MSY1, MSX2, MSY2));
  88.     Mouse(mPoint.x, mPoint.y, 2, 4, False);
  89.     R_ChooseOption('alk-t');
  90.     ClickToContinue;
  91.     ClickText('heal', 'CharsNPC', MCX1, MCY1, MCX2, MCY2, True);
  92.     ClickToContinue;
  93.     ClickToContinue;
  94.   end;
  95. end;
  96.  
  97. procedure Anticipate(pMax: Integer);
  98. var
  99.   Players: TPlayerArray;
  100.   i, n, pCount: Integer;
  101.   mPoint := TPoint;
  102. begin
  103.   Result := False;
  104.   for i := 0 to 3 do
  105.   begin
  106.     pCount := 0;
  107.     if ((TimeFromMark(MonkTime[i]) > 18) and (TimeFromMark(MonkTime[i]) < 40)) then
  108.     begin
  109.       Players := GetAllPlayers;
  110.       for n := 0 to High(Players) do
  111.         if (MonkArea(Players[n].Tile) = i) then
  112.           Inc(pCount);
  113.       if (pCount <= pMax) then
  114.       begin
  115.         case i of
  116.            0: mPoint := TileToMM(Tile(3043, 3498));
  117.            1: mPoint := TileToMM(Tile(3043, 3483));
  118.          2,3: mPoint := TileToMM(Tile(3051, 3491));
  119.         end;
  120.         Mouse(mPoint.x, mPoint.y, 2, 4, True);
  121.         Result := True;
  122.         Exit;
  123.       end;
  124.     end;
  125.   end;
  126. end;
  127.  
  128. procedure Fight;
  129. var
  130.   Monk: TNPC;
  131.   T, mPoint: Integer;
  132. begin
  133.   MMouse(
  134.   while (TimeFromMark(T) < 17) do
  135.   begin
  136.     UpdateTimers;
  137.     Monk := GetNPC(7727);
  138.     if ((Distance(Monk.Tile.x, Monk.Tile.y, GetMe.Tile.x, GetMe.Tile.y) < 4) and (not(Monk.Fighting))) then
  139.     begin
  140.       mPoint := TileToMS(Monk.Tile, 200);
  141.       Mouse(mPoint.x, mPoint.y, 2, 4, True);
  142.       while (GetMe.InFight) do
  143.       begin
  144.         UpdateTimers;
  145.         R_FindRandoms;
  146.       end;
  147.     end;
  148.   end;
  149. end;
  150.  
  151. begin
  152.   SetLength(MonkTime, 4);
  153.   MarkTime(bTime);
  154.   SMART_Server := Server;
  155.   SMART_Signed := Signed;
  156.   SetupSRL;
  157.   SetupReflectionEx(True);
  158.   DeclarePlayers;
  159.   LoginPlayer;
  160.   LampSkill := Players[CurrentPlayer].Strings[0];
  161.   repeat
  162.     UpdateTimers;
  163.     if (Players[CurrentPlayer].Integers[0] <= R_GetMMLevels('hp')) then
  164.       Heal
  165.     else
  166.       if (Anticipate(1)) then
  167.         Fight;
  168.     if (TimeFromMark(bTime) >= TimeBetween) then
  169.     begin
  170.       MarkTime(bTime);
  171.       Logout;
  172.       if (HowManyPlayers = 1) then
  173.         Wait(Random(60 * 1000 * 5))
  174.       else
  175.         Wait(Round(BreakTime + Random(BreakTime)/3.0 - Random(BreakTime)/3.0));
  176.       NextPlayer(True);
  177.       LogInPlayer;
  178.       LampSkill := Players[CurrentPlayer].Strings[0];
  179.     end;
  180.   until AllPlayersInactive;
  181. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement