Denuvo 71 Postado Junho 19, 2012 Share Postado Junho 19, 2012 (editado) Algem ajuda a descobrir qual o erro desse script por favor o erro ée esse: [19/06/2012 20:15:40] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/aloot.lua:2: unexpected symbol near '[' [19/06/2012 20:15:40] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/aloot.lua) [19/06/2012 20:15:40] data/talkactions/scripts/aloot.lua:2: unexpected symbol near '[' local stor, limit = 7575, 5 --storage, limit to add.[/size][/color][/font] local allow_container = false --empty! not looted with items, atleast for now. function onSay(cid, words, param) local expl = param:explode(':') local action, rst = expl[1], expl[2] if (action:lower() == 'check') then local infos, list = getPlayerStorageValue(cid, stor), {} if (infos ~= -1) then list = tostring(infos):explode(',') end local txt = 'Autoloot List:\n' if (#list > 0) then for k, id in ipairs(list) do id = id:gsub('_', '') if tonumber(id) then txt = txt .. getItemNameById(tonumber(id)) .. ((k < #list) and '\n' or '') end end else txt = 'Empty' end doPlayerPopupFYI(cid, txt) 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, false) if not item then return doPlayerSendCancel(cid, 'Esse item nao existe.') end end if not allow_container and isItemContainer(item) then return doPlayerSendCancel(cid, 'Este item não pode ser autolooted.') end local attrs = getItemInfo(item) if not attrs then return doPlayerSendCancel(cid, 'Esse item nao existe.') elseif not attrs.movable or not attrs.pickupable then return doPlayerSendCancel(cid, 'este item não podem ser autolooted.') end if isInArray(list, item) then return doPlayerSendCancel(cid, 'Ja foi adicionado.') end table.insert(list, tostring(item)) local new = '' for v, id in ipairs(list) do new = new .. '_' .. id:gsub('_' ,'') .. ((v < #list) and ',' or '') end doPlayerSetStorageValue(cid, stor, tostring(new)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Item >>' .. getItemNameById(item) .. '<< foi adicionado à lista de autoloot.') 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, 'Você não tem nenhum item adicionado.') end local item = tonumber(rst) if not item then item = getItemIdByName(rst, false) if not item then return doPlayerSendCancel(cid, 'item não válido.') end end if not isInArray(list, item) then return doPlayerSendCancel(cid, 'Este item não está na lista.') 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 doPlayerSetStorageValue(cid, stor, tostring(new)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Item >>' .. getItemNameById(item) .. '<< removido da lista de autoloot.') end return true end Já tentei arrumar mais n consegui :s do REP+ Editado Junho 19, 2012 por ChuckNorris666 Link para o comentário https://xtibia.com/forum/topic/188331-ajuda-autoloot/ Compartilhar em outros sites More sharing options...
0 Vinc 101 Postado Junho 19, 2012 Share Postado Junho 19, 2012 data/talkactions/scripts/aloot.lua e na talkaction esse ai é o creaturescript Link para o comentário https://xtibia.com/forum/topic/188331-ajuda-autoloot/#findComment-1281253 Compartilhar em outros sites More sharing options...
0 Denuvo 71 Postado Junho 19, 2012 Autor Share Postado Junho 19, 2012 data/talkactions/scripts/aloot.lua e na talkaction esse ai é o creaturescript tendi nada mano vc poderia ser mais claro por favor? Link para o comentário https://xtibia.com/forum/topic/188331-ajuda-autoloot/#findComment-1281274 Compartilhar em outros sites More sharing options...
0 Vinc 101 Postado Junho 19, 2012 Share Postado Junho 19, 2012 o erro n esta nesse script que tu posto, esta no data/talkactions/scripts/aloot.lua posteo para que possamos resolver o problema Link para o comentário https://xtibia.com/forum/topic/188331-ajuda-autoloot/#findComment-1281282 Compartilhar em outros sites More sharing options...
0 Denuvo 71 Postado Junho 19, 2012 Autor Share Postado Junho 19, 2012 o erro n esta nesse script que tu posto, esta no data/talkactions/scripts/aloot.lua posteo para que possamos resolver o problema looooooooool foi msmo man postei o script errado ... thx corrigi já vlw! Link para o comentário https://xtibia.com/forum/topic/188331-ajuda-autoloot/#findComment-1281295 Compartilhar em outros sites More sharing options...
0 Vinc 101 Postado Junho 20, 2012 Share Postado Junho 20, 2012 no script tem umas tag que deve te bugado no topico da onde vc pego,acho que tirei todas,mas se der algum erro cheque a linha que deu erro se tem alguma tag ne la local stor, limit = 7575, 5 --storage, limit to add. local allow_container = false --empty! not looted with items, atleast for now. function onSay(cid, words, param) local expl = param:explode(':') local action, rst = expl[1], expl[2] if (action:lower() == 'check') then local infos, list = getPlayerStorageValue(cid, stor), {} if (infos ~= -1) then list = tostring(infos):explode(',') end local txt = 'Autoloot List:\n' if (#list > 0) then for k, id in ipairs(list) do id = id:gsub('_', '') if tonumber(id) then txt = txt .. getItemNameById(tonumber(id)) .. ((k < #list) and '\n' or '') end end else txt = 'Empty' end doPlayerPopupFYI(cid, txt) 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, false) if not item then return doPlayerSendCancel(cid, 'Esse item nao existe.') end end if not allow_container and isItemContainer(item) then return doPlayerSendCancel(cid, 'Este item não pode ser autolooted.') end local attrs = getItemInfo(item) if not attrs then return doPlayerSendCancel(cid, 'Esse item nao existe.') elseif not attrs.movable or not attrs.pickupable then return doPlayerSendCancel(cid, 'este item não podem ser autolooted.') end if isInArray(list, item) then return doPlayerSendCancel(cid, 'Ja foi adicionado.') end table.insert(list, tostring(item)) local new = '' for v, id in ipairs(list) do new = new .. '_' .. id:gsub('_' ,'') .. ((v < #list) and ',' or '') end doPlayerSetStorageValue(cid, stor, tostring(new)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Item >>' .. getItemNameById(item) .. '<< foi adicionado à lista de autoloot.') 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, 'Você não tem nenhum item adicionado.') end local item = tonumber(rst) if not item then item = getItemIdByName(rst, false) if not item then return doPlayerSendCancel(cid, 'item não válido.') end end if not isInArray(list, item) then return doPlayerSendCancel(cid, 'Este item não está na lista.') 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 doPlayerSetStorageValue(cid, stor, tostring(new)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Item >>' .. getItemNameById(item) .. '<< removido da lista de autoloot.') end return true end Link para o comentário https://xtibia.com/forum/topic/188331-ajuda-autoloot/#findComment-1281341 Compartilhar em outros sites More sharing options...
Pergunta
Denuvo 71
Algem ajuda a descobrir qual o erro desse script por favor o erro ée esse:
[19/06/2012 20:15:40] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/aloot.lua:2: unexpected symbol near '['
[19/06/2012 20:15:40] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/aloot.lua)
[19/06/2012 20:15:40] data/talkactions/scripts/aloot.lua:2: unexpected symbol near '['
local stor, limit = 7575, 5 --storage, limit to add.[/size][/color][/font]
local allow_container = false --empty! not looted with items, atleast for now.
function onSay(cid, words, param)
local expl = param:explode(':')
local action, rst = expl[1], expl[2]
if (action:lower() == 'check') then
local infos, list = getPlayerStorageValue(cid, stor), {}
if (infos ~= -1) then
list = tostring(infos):explode(',')
end
local txt = 'Autoloot List:\n'
if (#list > 0) then
for k, id in ipairs(list) do
id = id:gsub('_', '')
if tonumber(id) then
txt = txt .. getItemNameById(tonumber(id)) .. ((k < #list) and '\n' or '')
end
end
else
txt = 'Empty'
end
doPlayerPopupFYI(cid, txt)
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, false)
if not item then
return doPlayerSendCancel(cid, 'Esse item nao existe.')
end
end
if not allow_container and isItemContainer(item) then
return doPlayerSendCancel(cid, 'Este item não pode ser autolooted.')
end
local attrs = getItemInfo(item)
if not attrs then
return doPlayerSendCancel(cid, 'Esse item nao existe.')
elseif not attrs.movable or not attrs.pickupable then
return doPlayerSendCancel(cid, 'este item não podem ser autolooted.')
end
if isInArray(list, item) then
return doPlayerSendCancel(cid, 'Ja foi adicionado.')
end
table.insert(list, tostring(item))
local new = ''
for v, id in ipairs(list) do
new = new .. '_' .. id:gsub('_' ,'') .. ((v < #list) and ',' or '')
end
doPlayerSetStorageValue(cid, stor, tostring(new))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Item >>' .. getItemNameById(item) .. '<< foi adicionado à lista de autoloot.')
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, 'Você não tem nenhum item adicionado.')
end
local item = tonumber(rst)
if not item then
item = getItemIdByName(rst, false)
if not item then
return doPlayerSendCancel(cid, 'item não válido.')
end
end
if not isInArray(list, item) then
return doPlayerSendCancel(cid, 'Este item não está na lista.')
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
doPlayerSetStorageValue(cid, stor, tostring(new))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Item >>' .. getItemNameById(item) .. '<< removido da lista de autoloot.')
end
return true
end
Já tentei arrumar mais n consegui :s do REP+
Editado por ChuckNorris666Link para o comentário
https://xtibia.com/forum/topic/188331-ajuda-autoloot/Compartilhar em outros sites
5 respostass a esta questão
Posts Recomendados