Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {$DEFINE SMART}
- {$I SRL\SRL.scar}
- {$I Reflection\reflection.simba}
- const
- Server = 123; //You should find a non-crowded world before you let the script run!
- Signed = False; //False highly recommended!
- TimeBetween = 2000; //Time between players or breaks, in seconds (randomized)
- BreakTime = 60 * 3; //Time to break for, in seconds (randomized)
- var
- MonkTime: TIntegerArray;
- bTime: Integer;
- procedure DeclarePlayers;
- begin
- NumberOfPlayers(1);
- with Players[0] do
- begin
- Name := '';
- Pass := '';
- Nick := '';
- Active := True;
- Pin := '';
- Integers := [200]; //health to heal at (the new number, e.g. 50 not 5)
- Strings := ['ranging']; //lamp skill
- BoxRewards := ['lamp', 'gold'];
- end;
- end;
- function MonkArea(Tile: TTile): Integer;
- begin
- if (((Tile.x = 3044) or (Tile.x = 3045)) and ((Tile.y >= 3493) and (Tile.y <= 3498))) or
- ((Tile.x = 3046) and ((Tile.y = 3497) or (Tile.y = 3498))) then
- begin
- Result := 0;
- Exit;
- end;
- if (((Tile.x = 3044) or (Tile.x = 3045)) and ((Tile.y <= 3488) and (Tile.y >= 3482))) or
- (((Tile.y >= 3482) and (Tile.y <= 3484)) and ((Tile.x >= 3046) and (Tile.x <= 3048))) then
- begin
- Result := 1;
- Exit;
- end;
- if (Tile.x <= 3051) then
- Result := 2
- else
- Result := 3;
- end;
- procedure UpdateTimers;
- var
- MonkArray: TNPCArray;
- i: Integer;
- begin
- MonkArray := GetNPCs(7727);
- for i := 0 to High(MonkArray) do
- if (MonkArray[i].Animation = 836) then //836 = Dying animation
- MarkTime(MonkTime[MonkArea(MonkArray[i].Tile)]);
- end;
- procedure Heal;
- var
- Monk: TNPC;
- mPoint: TPoint;
- begin
- while (R_GetMMLevels('hp') < R_GetSkillLevel('hp') * 9) do
- begin
- repeat
- Monk := GetNPC(7727);
- if (TileOnMS(Monk.Tile, 200)) then
- mPoint := TileToMS(Monk.Tile, 200)
- else
- begin
- if (TileOnMM(Monk.Tile)) then
- mPoint := TileToMM(Monk.Tile);
- Mouse(mPoint.x, mPoint.y, 2, 2, True);
- Wait(800 + Random(600));
- while (GetMe.Speed > 0) do //Try to click while walking instead?
- Wait(1);
- Monk := GetNPC(7727);
- if (TileOnMS(Monk.Tile, 200)) then
- mPoint := TileToMs(Monk.Tile, 200)
- end;
- until PointInBox(mPoint, IntToBox(MSX1, MSY1, MSX2, MSY2));
- Mouse(mPoint.x, mPoint.y, 2, 4, False);
- R_ChooseOption('alk-t');
- ClickToContinue;
- ClickText('heal', 'CharsNPC', MCX1, MCY1, MCX2, MCY2, True);
- ClickToContinue;
- ClickToContinue;
- end;
- end;
- procedure Anticipate(pMax: Integer);
- var
- Players: TPlayerArray;
- i, n, pCount: Integer;
- mPoint := TPoint;
- begin
- Result := False;
- for i := 0 to 3 do
- begin
- pCount := 0;
- if ((TimeFromMark(MonkTime[i]) > 18) and (TimeFromMark(MonkTime[i]) < 40)) then
- begin
- Players := GetAllPlayers;
- for n := 0 to High(Players) do
- if (MonkArea(Players[n].Tile) = i) then
- Inc(pCount);
- if (pCount <= pMax) then
- begin
- case i of
- 0: mPoint := TileToMM(Tile(3043, 3498));
- 1: mPoint := TileToMM(Tile(3043, 3483));
- 2,3: mPoint := TileToMM(Tile(3051, 3491));
- end;
- Mouse(mPoint.x, mPoint.y, 2, 4, True);
- Result := True;
- Exit;
- end;
- end;
- end;
- end;
- procedure Fight;
- var
- Monk: TNPC;
- T, mPoint: Integer;
- begin
- MMouse(
- while (TimeFromMark(T) < 17) do
- begin
- UpdateTimers;
- Monk := GetNPC(7727);
- if ((Distance(Monk.Tile.x, Monk.Tile.y, GetMe.Tile.x, GetMe.Tile.y) < 4) and (not(Monk.Fighting))) then
- begin
- mPoint := TileToMS(Monk.Tile, 200);
- Mouse(mPoint.x, mPoint.y, 2, 4, True);
- while (GetMe.InFight) do
- begin
- UpdateTimers;
- R_FindRandoms;
- end;
- end;
- end;
- end;
- begin
- SetLength(MonkTime, 4);
- MarkTime(bTime);
- SMART_Server := Server;
- SMART_Signed := Signed;
- SetupSRL;
- SetupReflectionEx(True);
- DeclarePlayers;
- LoginPlayer;
- LampSkill := Players[CurrentPlayer].Strings[0];
- repeat
- UpdateTimers;
- if (Players[CurrentPlayer].Integers[0] <= R_GetMMLevels('hp')) then
- Heal
- else
- if (Anticipate(1)) then
- Fight;
- if (TimeFromMark(bTime) >= TimeBetween) then
- begin
- MarkTime(bTime);
- Logout;
- if (HowManyPlayers = 1) then
- Wait(Random(60 * 1000 * 5))
- else
- Wait(Round(BreakTime + Random(BreakTime)/3.0 - Random(BreakTime)/3.0));
- NextPlayer(True);
- LogInPlayer;
- LampSkill := Players[CurrentPlayer].Strings[0];
- end;
- until AllPlayersInactive;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement