View Full Version : Using item on a creature.
Splitowskyxx
02-29-2016, 10:49 PM
Hello, i was looking for a mounts taming script, but i didnt find any working. Do u have any working script for using item on a creature? Would be nice if it also turned off walker and targeting. :o
Jontor
03-01-2016, 07:19 AM
Maybe this (http://forums.xenobot.net/showthread.php?40756-Mount-Catch-Script&p=470121&viewfull=1#post470121) one?
Splitowskyxx
03-01-2016, 09:04 AM
I wanted to test it before leaving it afk by using sudden death rune on demon skeleton. This is what i received:
XenoScript Error:
Script: TAME.lua
Line #: 7
Chunk: C:?Users?Admin?DOCUME?1?XenoBot?Scripts??TAME.lua
Error: attempt to index local 'i' (a number value)
This is an error with user-input and should not be reported as a bug with XenoBot.
Im pretty noob so i dont know if its because of using rune, or maybe it wouldnt work with taming item too :s
Do i have to keep item in any special backpack, or bot will find it automatically?
Jontor
03-01-2016, 02:16 PM
Splitowskyxx
Try this one:
local mountItem = "giant shrimp"
local mountName = "crustacea gigantica"
function findItem(item)
for i = 0, 16 do
if (getContainerOpen(i)) then
for spot = 0, Container.ItemCount(i) - 1 do
local data = Container.GetItemData(i, spot).id
if (data == Item.GetID(mountItem)) then
return i, spot
end
end
end
end
return nil
end
while true do
for n, c in Creature.iMonsters() do
if (string.lower(n) == string.lower(mountName)) then
local amount = Self.ItemCount(mountItem)
Cavebot.Stop()
while (amount == Self.ItemCount(mountItem) and Creature.isOnScreen(c)) do
local container, spot = findItem(mountItem)
if (not container or not spot) then
return
end
Container.UseItemWithCreature(container, spot, Creature.ID(c))
wait(500)
end
Cavebot.Start()
end
end
wait(1000)
end
Splitowskyxx
03-01-2016, 03:00 PM
Jontor
Works perfectly, thank you very much :cool: :o
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.