Advertisement
Guest User

Untitled

a guest
Oct 10th, 2015
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. local MinMana = 40 -- Amount to buy new potions
  2. local MaxMana = 400 -- Amount to buy up to
  3. local MinCash = 5000 -- Stops is below x gps
  4. local ManaName = "great mana potion" -- Name of your mana potion
  5.  
  6. function Self.ManaPercent()
  7. local x = math.ceil(math.abs(Self.Mana() / (Self.MaxMana() * 0.01)))
  8. return x
  9. end
  10.  
  11. function BuyItems(item, count)
  12. wait(900, 1200)
  13. if (Self.ItemCount(item) < count) then
  14. Self.ShopBuyItem(item, (count-Self.ItemCount(item)))
  15. wait(200, 500)
  16. end
  17. end
  18.  
  19. Module.New('ManaTrain', function(module)
  20. if (Self.ItemCount(Item.GetID(ManaName)) <= MinMana) and (Self.Money() >= MinCash) then
  21. Self.SayToNpc({"hi", "trade"}, 65)
  22. BuyItems(Item.GetID(ManaName), MaxMana)
  23. wait(500)
  24. Self.SayToNpc("bye")
  25. end
  26. module:Delay(1500)
  27. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement