# SETTINGS #
strong_weapon = "knight axe" # name of strong weapon to use #
weak_weapon = "sickle" # name of weak weapon to use #
trainname = "Slime" # name of monster you want to train #
distance = 1 # distance to attack monster if you are paladin you can set this to 3 or 4 #
hittime = 25 # time in seconds to change to strong weapon if havent damage blood on creature #
trainpos = [32607, 31969, 7] # posx posy and posz to return if someone moves you #
getbacktotrainpos = true # if you want to go back to position of train #
alarm = true # will alarm if cannot got the slime id #
killmother = true # kill the mother when options down are meeted #
hppctokill = 50 # when you reaches 50 percent of health you kill the mother #
foodtokill = 2 # if you ran out of X food it will kill the mother #
dmgtokill = "50" # if mother do 50 or more of damage it will kill mother #
logout = false # logout if mother is killed #
# SETTINGS #
# DONT CHANGE NOTHING DOWN HERE #
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]
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]
while($attacked.nil?)
if alarm
playalarm()
end
end
mother = $attacked.id
while true
monsters_array = []
creature("ms").each do |monst|
if monst.dist < distance
monsters_array.push(monst)
end
if monst.dist < distance and monst.id != mother
attackcreatureat(monst.posx, monst.posy, monst.posz)
wait(500, 600)
end
end
if getbacktotrainpos
if not islocation(trainpos[1], trainpos[2], trainpos[3])
setwalking(true)
waitping()
elsif islocation(trainpos[1], trainpos[2], trainpos[3])
setwalking(false)
end
end
if killmother
if $hppc <= hppctokill
attackcreatureat(mother.posx, mother.posy, mother.posz)
end
backpack.each do |bp|
bp.item.each do |i|
if i.itemid.include?(eattable_items) && itemcount(i.itemid) <= foodtokill
attackcreatureat(mother.posx, mother.posy, mother.posz)
end
end
end
if m.message.include?("You lose") and m.message.include?(dmgtokill) and m.message.include?("hitpoints due to an attack by a Slime")
attackcreatureat(mother.posx, mother.posy, mother.posz)
end
if $attacked.id == mother and $attacked.hppc == 0
if logout
closetibia()
waitping()
closebot()
end
end
backpack.each do |bp|
bp.item.each do |i|
if i.itemid.include?(eattable_items) and itemcount(i.itemid) <= foodtokill
attackcreatureat(mother.posx, mother.posy, mother.posz)
if logout && $attacked.id == mother && $attacked.hppc == 0
closetibia()
waitping()
closebot()
end
end
end
end
end
tile = gettile(trainpos[1], trainpos[2], trainpos[3])
tile.items.each do |tileitem|
if tileitem.id.include?(unwalkable)
useitemfrombpon(getid(strong_weapon), trainpos[1], trainpos[2], trainpos[3]) or useitemfrombpon(getid(weak_weapon), trainpos[1], trainpos[2], trainpos[3])
end
end
if monst.length > 2 && monsteraround() > 2
setattack("Offensive")
setchase("Chase")
waitping()
equipitem(getid(strong_weapon), getname($back.id), "Left Hand")
else
setattack("Defensive")
setchase("Stand")
equipitem(getid(weak_weapon), getname($back.id), "Left Hand")
end
end