Don't like ads? PRO users don't see any ads ;-)
Guest

Slime Trainer Perfect

By: a guest on May 8th, 2012  |  syntax: Rails  |  size: 4.05 KB  |  hits: 21  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # SETTINGS #
  2. strong_weapon = "knight axe"                # name of strong weapon to use #
  3. weak_weapon = "sickle"                      # name of weak weapon to use #
  4. trainname = "Slime"                         # name of monster you want to train #
  5. distance = 1                                # distance to attack monster if you are paladin you can set this to 3 or 4 #
  6. hittime = 25                                # time in seconds to change to strong weapon if havent damage blood on creature #
  7. trainpos = [32607, 31969, 7]                # posx posy and posz to return if someone moves you #
  8. getbacktotrainpos = true                    # if you want to go back to position of train #
  9. alarm = true                                # will alarm if cannot got the slime id #
  10. killmother = true                           # kill the mother when options down are meeted #
  11. hppctokill = 50                             # when you reaches 50 percent of health you kill the mother #
  12. foodtokill = 2                              # if you ran out of X food it will kill the mother #
  13. dmgtokill = "50"                            # if mother do 50 or more of damage it will kill mother #
  14. logout = false                              # logout if mother is killed #
  15. # SETTINGS #
  16.  
  17. # DONT CHANGE NOTHING DOWN HERE #
  18. unwalkable = [2471, 2523, 2535, 2025, 2029, 2030, 2043, 2044, 2045, 2046, 2047, 2048, 2059, 2060, 2061, 2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 2453, 2454, 2465, 2466, 2467, 2468, 2524, 2904, 2959, 2960, 2961, 2962, 2963, 2964, 2975, 2976, 2979, 2982, 2986, 2997, 2998, 2999, 3000, 3484, 3485, 3486, 3487, 3510, 3511, 3512, 3513, 5046, 5055, 5056, 6109, 6110, 6111, 6112, 6367, 6368, 6369, 6370, 7860, 7861, 7862, 7863, 9132, 9141, 10208, 10210, 10211, 10212, 10213, 10214, 10215]
  19. eattable_items = [3577, 3578, 3579, 3580, 3581, 3582, 3583, 3584, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3594, 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 3606, 3607, 3723, 3724, 3725, 3726, 3727, 3728, 3729, 3730, 3731, 3732, 3910]
  20.  
  21. while($attacked.nil?)
  22.  if alarm
  23.   playalarm()
  24.  end
  25. end
  26. mother = $attacked.id
  27. while true
  28. monsters_array = []
  29. creature("ms").each do |monst|
  30. if monst.dist < distance
  31.  monsters_array.push(monst)
  32.  end
  33.  
  34. if monst.dist < distance and monst.id != mother
  35.  attackcreatureat(monst.posx, monst.posy, monst.posz)
  36.  wait(500, 600)
  37.  end
  38. end
  39.  
  40. if getbacktotrainpos
  41.  if not islocation(trainpos[1], trainpos[2], trainpos[3])
  42.   setwalking(true)
  43.   waitping()
  44.  elsif islocation(trainpos[1], trainpos[2], trainpos[3])
  45.   setwalking(false)
  46.  end
  47. end
  48.  
  49. if killmother
  50.  if $hppc <= hppctokill
  51.   attackcreatureat(mother.posx, mother.posy, mother.posz)
  52.  end
  53.  backpack.each do |bp|
  54.   bp.item.each do |i|
  55.    if i.itemid.include?(eattable_items) && itemcount(i.itemid) <= foodtokill
  56.     attackcreatureat(mother.posx, mother.posy, mother.posz)
  57.    end
  58.   end
  59.  end
  60.  if m.message.include?("You lose") and m.message.include?(dmgtokill) and m.message.include?("hitpoints due to an attack by a Slime")
  61.   attackcreatureat(mother.posx, mother.posy, mother.posz)
  62.  end
  63.  if $attacked.id == mother and $attacked.hppc == 0
  64.   if logout
  65.    closetibia()
  66.    waitping()
  67.    closebot()
  68.   end
  69.  end
  70.  backpack.each do |bp|
  71.  bp.item.each do |i|
  72.  if i.itemid.include?(eattable_items) and itemcount(i.itemid) <= foodtokill
  73.   attackcreatureat(mother.posx, mother.posy, mother.posz)
  74.   if logout && $attacked.id == mother && $attacked.hppc == 0
  75.    closetibia()
  76.    waitping()
  77.    closebot()
  78.   end
  79.  end
  80.  end
  81.  end
  82. end
  83.  
  84. tile = gettile(trainpos[1], trainpos[2], trainpos[3])
  85. tile.items.each do |tileitem|
  86. if tileitem.id.include?(unwalkable)
  87.  useitemfrombpon(getid(strong_weapon), trainpos[1], trainpos[2], trainpos[3]) or useitemfrombpon(getid(weak_weapon), trainpos[1], trainpos[2], trainpos[3])
  88. end
  89. end
  90.  
  91. if monst.length > 2 && monsteraround() > 2
  92.  setattack("Offensive")
  93.  setchase("Chase")
  94.  waitping()
  95.  equipitem(getid(strong_weapon), getname($back.id), "Left Hand")
  96. else
  97.  setattack("Defensive")
  98.  setchase("Stand")
  99.  equipitem(getid(weak_weapon), getname($back.id), "Left Hand")
  100. end
  101. end