Advertisement
Guest User

Untitled

a guest
May 25th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. Const
  2. BPIndex = 1
  3. RingID = 3051
  4. MinHealth = 1
  5. HealthToRemoveRing = 2
  6.  
  7. var
  8. G:integer;
  9.  
  10. Function GetItemFromOpenBackpack(ID:integer):TItem;
  11. begin
  12. result := nil;
  13. UpdateWorld;
  14. for x := 0 to Self.Containers.Count - 1 do
  15. begin
  16. if x >= Self.Containers.Count then break;
  17. for y := 0 to Self.Containers.Container[x].Count do
  18. begin
  19. if y >= Self.Containers.Container[x].Count then break;
  20. if Self.Containers.Container[x].Item[y].ID = ID then
  21. begin
  22. result := Self.Containers.Container[x].Item[y];
  23. G := x;
  24. Exit;
  25. end;
  26. end;
  27. end;
  28. end;
  29.  
  30. while not terminated do
  31. begin
  32. If HealthToRemoveRing <= MinHealth Then
  33. begin
  34. Self.DisplayText('HealthToRemoveRing must be higher then MinHealth! Script will turn off now. Please try again.');
  35. exit;
  36. end;
  37. UpdateWorld;
  38. if Self.Health <= MinHealth then
  39. begin
  40. if self.ring.ID = 0 then
  41. begin
  42. Ring := GetItemFromOpenBackpack(RingID);
  43. if Ring <> nil then
  44. Ring.MoveToBody(Self.Ring,0);
  45. else Self.DisplayText('The Ring wasnt found in any opened backpack.');
  46. end;
  47. end;
  48. UpdateWorld;
  49. if Self.Health >= HealthToRemoveRing then
  50. begin
  51. if self.ring.id <> 0 then
  52. begin
  53. Ring := Self.Ring;
  54. Ring.MoveToContainer(Self.Containers.Container[BPIndex - 1],0,0);
  55. end;
  56. end;
  57. sleep(1);
  58. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement