its not boting, that feature its present in most of online rpg games =P
This is happening to me too, can anyone help? thank. The talkaction is workin, but it doesn't loot.what all did you put in creaturescripts.xml?
<event type="kill" name="autoloot" event="script" value="autoloot.lua"/>
doesn't work, i can use the talkaction but no looting is taking place... figured this is whats wrong.. tfs 0.3.6p
if (corpse ~= -1) and isContainer(corpse) and(getItemAttribute(corpse, "corpseowner") == cid) then
scanContainer(cid, corpse, tostring(getPlayerStorageValue(cid, stor)):gsub('_', ''):explode(','))
end
if (corpse ~= -1) and isContainer(corpse) and(getItemAttribute(corpse, "corpseowner") == getPlayerGUID(cid)) then
scanContainer(cid, corpse, tostring(getPlayerStorageValue(cid, stor)):gsub('_', ''):explode(','))
end
Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/autoloot.lua:onSay
luaGetItemIdByName(). Item not found
elseif (action:lower() == 'add') then
local infos, list = getPlayerStorageValue(cid, stor), {}
if (infos ~= -1) then
list = tostring(infos):gsub('_', ''):explode(',')
end
if (#list >= limit) then
return doPlayerSendCancel(cid, 'You already have ' .. limit .. ' autolooting items.')
end
local item = tonumber(rst)
if not item then
--item = getItemIdByName(rst)
item = getItemIdByName(rst, false)
if not item then
return doPlayerSendCancel(cid, 'Not a valid item.')
end
end
if not allow_container and isItemContainer(item) then
return doPlayerSendCancel(cid, 'This item can not be autolooted.')
end
local attrs = getItemInfo(item)
if not attrs then
return doPlayerSendCancel(cid, 'Not a valid item.')
elseif not attrs.movable or not attrs.pickupable then
return doPlayerSendCancel(cid, 'This item can not be autolooted.')
end
if isInArray(list, item) then
return doPlayerSendCancel(cid, 'This item is already added in your list.')
end
table.insert(list, tostring(item))
local new = ''
for v, id in ipairs(list) do
new = new .. '_' .. id:gsub('_' ,'') .. ((v < #list) and ',' or '')
end
setPlayerStorageValue(cid, stor, tostring(new))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Item >>' .. getItemNameById(item) .. '<< has been added to the autoloot list.')
elseif (action:lower() == 'remove') then
local infos, list = getPlayerStorageValue(cid, stor), {}
if (infos ~= -1) then
list = tostring(infos):gsub('_', ''):explode(',')
end
if (#list == 0) then
return doPlayerSendCancel(cid, 'You do not have any item added.')
end
local item = tonumber(rst)
if not item then
item = getItemIdByName(rst)
--item = getItemIdByName(rst, false)
if not item then
return doPlayerSendCancel(cid, 'Not a valid item.')
end
end
if not isInArray(list, item) then
return doPlayerSendCancel(cid, 'This item is not in the list.')
end
local new = ''
for v, id in ipairs(list) do
if (tonumber(id) ~= item) then
new = new .. '_' .. id:gsub('_' ,'') .. ((v < #list) and ',' or '')
end
end
setPlayerStorageValue(cid, stor, tostring(new))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Item >>' .. getItemNameById(item) .. '<< removed from the autoloot list.')
mroe info, like server version? try to use it without false as param #2