Facebook
From Ungracious Mosquito, 6 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 283
  1. const
  2. delay = 0.1 // delay to wait between shooting HMMs on the Ghost.
  3. MonsterName = 'Hydra'
  4. MinHP = 0 // if YOU have under this HP you will not shoot HMM.
  5. MonsterHP = 50 // if MONSTER has this % of HP or less it will not shoot on it.
  6. RuneID = 3155 // enter the ID of the rune you want to shoot
  7.  
  8. function GetCreatureByName(Name: string): TCreature;
  9. var
  10. x: integer;
  11. begin
  12. Result := nil;
  13. for x := 0 to Creatures.Count - 1 do
  14. begin
  15. if x >= Creatures.Count then Break;
  16. if Creatures.Creature[x].Name = Name then
  17. begin
  18. Result := Creatures.Creature[x];
  19. Exit;
  20. end;
  21. end;
  22. end;
  23.  
  24. procedure Attack(Name:string);
  25. var
  26. Player:TCreature;
  27. x:integer;
  28. begin
  29. updateworld;
  30. Monster :=GetCreatureByName(Name);
  31. if monster <> nil then
  32. if Self.Health>MinHp then
  33. begin
  34. Self.Containers.UseItemWithCreature(RuneID, Monster);
  35. updateworld;
  36. end
  37. end;
  38.  
  39. while not terminated do
  40. begin
  41. Yes := false;
  42. UpdateWorld;
  43. for i := 0 to creatures.Count - 1 do
  44. begin
  45. if creatures.Creature[i].Z = Self.Z then
  46. If Creatures.Creature[i].Name = MonsterName then
  47. begin
  48. Yes := true;
  49. repeat
  50. Attack(MonsterName);
  51. Sleep(Delay * 1000);
  52. UpdateWorld;
  53. for g := 0 to creatures.Count -1 do
  54. begin
  55. if creatures.Creature[i].Z = Self.Z then
  56. If Creatures.Creature[i].Name = MonsterName then
  57. Yes := True else Yes := false; else yes := false;
  58. end;
  59. until Yes = false;
  60. end;
  61. sleep(100);
  62. end;
  63. Sleep(100);
  64. end;