ppgab

Untitled

Apr 27th, 2014
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.42 KB | None | 0 0
  1. function mojimi_refill(where_at,rock_hard)
  2.     Cavebot.Stop()
  3.     local tries = 3
  4.     rock_hard = rock_hard or false
  5.     if rock_hard then rkh = "magic stuff" else rkh = '' end
  6.     if where_at == "pot" then
  7.             if Self.Flasks() > 0 then
  8.                 Self.SayToNpc({"hi","vials","yes","trade",rkh},math.random(55,70))
  9.                 else Self.SayToNpc({"hi","trade",rkh},math.random(55,70))
  10.             end
  11.                 wait(1200,1200+Ping_Compensation)
  12.         while   ((useHP and Self.ItemCount(HP)<maxHP) and tries > 0)
  13.                 or ((useMP and Self.ItemCount(MP)<maxMP) and tries > 0)
  14.                 or ((useRune and Self.ItemCount(rune)<maxRune) and tries > 0)
  15.         do
  16.             wait(500,500+Ping_Compensation)
  17.             if (useHP and Self.ItemCount(HP)<maxHP) then
  18.                 wait(500,500+Ping_Compensation) Self.ShopBuyItemsUpTo(HP,maxHP)
  19.             end
  20.             if (useMP and Self.ItemCount(MP)<maxMP) then
  21.                 wait(500,500+Ping_Compensation) Self.ShopBuyItemsUpTo(MP,maxMP)
  22.             end
  23.             if (useRune and Self.ItemCount(rune)<maxRune) then 
  24.                 wait(500,500+Ping_Compensation) Self.ShopBuyItemsUpTo(rune,maxRune)        
  25.             end
  26.             tries = tries-1
  27.         end
  28.     elseif where_at == "ammo" then
  29.         Self.SayToNpc({"hi","trade"},math.random(55,70))
  30.         while (not(wtAmmo) and useAmmo and Self.ItemCount(ammo)<maxAmmo)
  31.         do
  32.         Self.ShopBuyItemsUpTo(HP,maxHP) wait(500,500+Ping_Compensation)
  33.         tries = tries-1
  34.         end
  35.     end
  36.     if tries <= 0 then
  37.         print("You don't have enough cap, Stoping Cavebot") Cavebot.Stop()
  38.         else Cavebot.Start()
  39.     end
  40. end
Add Comment
Please, Sign In to add comment