• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Mod] Auto Loot

Code:
[16:1:05.474] [Error - TalkAction Interface]
[16:1:05.474] local cid = 268663762
[16:1:05.474] local words = "/autoloot"
[16:1:05.474] local param = "add,meat"
[16:1:05.474] local channel = 65534
[16:1:05.474] domodlib('Loot_func')
[16:1:05.474] local t = string.explode(string.lower(param), ",")
[16:1:05.474] if info.OnlyPremium == true and not isPremium(cid) then
[16:1:05.474] doPlayerSendCancel(cid, "you must be a premium account.") return true
[16:1:05.474] elseif not t[1] then
[16:1:05.474] ShowItemsTabble(cid) return true
[16:1:05.474] elseif tonumber(t[1]) or tonumber(t[2]) then
[16:1:05.474] doPlayerSendCancel(cid, "enter!autoloot add,name or !autoloot remove,name") return true
[16:1:05.474] elseif isInArray({"add","remove"}, tostring(t[1])) then
[16:1:05.474] local func,check = tostring(t[1]) == "add" and addItemTable or removeItemTable, tostring(t[1]) == "add" and true or false
[16:1:05.474] local item = getItemIdByName(tostring(t[2]), false)
[16:1:05.474] if not item then
[16:1:05.475] doPlayerSendCancel(cid, "This item does not exist.") return true
[16:1:05.475] elseif check == true and isInArray(info.BlockItemsList, item) then
[16:1:05.475] doPlayerSendCancel(cid, "You can not add this item in the list!") return true
[16:1:05.475] elseif isInTable(cid, item) == check then
[16:1:05.475] doPlayerSendCancel(cid, "This Item "..(check == true and "already" or "is not").." in your list.") return true
[16:1:05.475] end
[16:1:05.475] func(cid, item)
[16:1:05.475] doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,check == true and "you added the item "..t[2].." in the list" or "you removed the item "..t[2].." from the list") return true
[16:1:05.475] end
[16:1:05.475] return true
[16:1:05.475] Description:
[16:1:05.475] (luaGetItemIdByName) Item not found

Using tfs 0.4 9.6
 
If it says the item doesnt exist maybe you have a bad items.xml file.
 
missing, remove all and, limit

I'm content to limit,
would be perfect thanks a good mod
 
Lua:
[22/9/2012 23:3:2] [Error - TalkAction Interface] 
[22/9/2012 23:3:2] local cid = 268440919
[22/9/2012 23:3:2] local words = "/autoloot"
[22/9/2012 23:3:2] local param = "add,gold coin"
[22/9/2012 23:3:2] local channel = 65534
[22/9/2012 23:3:2] domodlib('Loot_func')
[22/9/2012 23:3:2] local t = string.explode(string.lower(param), ",")
[22/9/2012 23:3:2] if info.OnlyPremium == true and not isPremium(cid) then
[22/9/2012 23:3:2] doPlayerSendCancel(cid, "you must be a premium account.") return true
[22/9/2012 23:3:2] elseif not t[1] then
[22/9/2012 23:3:2] ShowItemsTabble(cid) return true
[22/9/2012 23:3:2] elseif tonumber(t[1]) or tonumber(t[2]) then
[22/9/2012 23:3:2] doPlayerSendCancel(cid, "enter!autoloot add,name or !autoloot remove,name") return true
[22/9/2012 23:3:2] elseif isInArray({"add","remove"}, tostring(t[1])) then
[22/9/2012 23:3:2] local func,check = tostring(t[1]) == "add" and addItemTable or removeItemTable, tostring(t[1]) == "add" and true or false
[22/9/2012 23:3:2] local item = getItemIdByName(tostring(t[2]), false) 
[22/9/2012 23:3:2] if not item then
[22/9/2012 23:3:2] doPlayerSendCancel(cid, "This item does not exist.") return true
[22/9/2012 23:3:2] elseif check == true and isInArray(info.BlockItemsList, item) then
[22/9/2012 23:3:2] doPlayerSendCancel(cid, "You can not add this item in the list!") return true
[22/9/2012 23:3:2] elseif isInTable(cid, item) == check then
[22/9/2012 23:3:2] doPlayerSendCancel(cid, "This Item "..(check == true and "already" or "is not").." in your list.") return true
[22/9/2012 23:3:2] end
[22/9/2012 23:3:2] func(cid, item)
[22/9/2012 23:3:2] doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,check == true and "you added the item "..t[2].." in the list" or "you removed the item "..t[2].." from the list") return true
[22/9/2012 23:3:2] end
[22/9/2012 23:3:2] return true
[22/9/2012 23:3:2] Description: 
[22/9/2012 23:3:2] (LuaInterface::luaGetItemIdByName) Item not found
...?
 
Good, but it should check for player corpses. It shouldn't auto loot them imo.
 
Can this be used on 8.54?

I tried it but does not work.

I have cheese and gold coin added to loot list (mod loads no errors)
I kill monster - doesn't open body
I open monster body - doesn't take gold coins nor cheese (by themselves or in stacks, it matters not) :p

Was wondering if it's possible for it to work on 8.54
 
How do I install this? I am running "Forgotten v0.2.14-win64console" server. I made a folder called "mods" in the root directory and put the xml file in, but nothing happens.
 
Back
Top