FehZito 0 Postado Março 18, 2012 Share Postado Março 18, 2012 Esse eo erro '<eof>' expected near 'end' function onLogin(cid) registerCreatureEvent(cid, "aloot_kill") return true end local stor = 7575 function autoloot(cid, target, pos) local function doStack(cid, itemid, new) local count = getPlayerItemCount(cid, itemid) if (count > 100) then count = count - math.floor(count / 100) * 100 end local newCount = count + new if (count ~= 0) then local find = getPlayerItemById(cid, true, itemid, count).uid if (find > 0) then doRemoveItem(find) else newCount = new end end local item = doCreateItemEx(itemid, newCount) doPlayerAddItemEx(cid, item, true) end local function scanContainer(cid, uid, list) for k = (getContainerSize(uid) - 1), 0, -1 do local tmp = getContainerItem(uid, k) if (isInArray(list, tmp.itemid)) then if isItemStackable(tmp.itemid) and (getPlayerItemCount(cid, tmp.itemid) > 0) then doStack(cid, tmp.itemid, tmp.type) else local item = doCreateItemEx(tmp.itemid, tmp.type) doPlayerAddItemEx(cid, item, true) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Looted ' .. tmp.type .. ' ' .. getItemNameById(tmp.itemid) .. '.') doRemoveItem(tmp.uid) elseif isContainer(tmp.uid) then scanContainer(cid, tmp.uid, list) end end end local items = {} for i = getTileInfo(pos).items, 1, -1 do pos.stackpos = i table.insert(items, getThingFromPos(pos)) end if (#items == 0) then return end local corpse = -1 for _, item in ipairs(items) do local name = getItemName(item.uid):lower() if name:find(target:lower()) then corpse = item.uid break end end if (corpse ~= -1) and isContainer(corpse) then scanContainer(cid, corpse, tostring(getPlayerStorageValue(cid, stor)):gsub('_', ''):explode(',')) end end function onKill(cid, target, lastHit) if not isPlayer(target) then local infos = getPlayerStorageValue(cid, stor) if (infos == -1) then return true end local list = tostring(infos):explode(',') if (#list == 0) then return true end addEvent(autoloot, 150, cid, getCreatureName(target), getCreaturePosition(target)) end return true end Link para o comentário https://xtibia.com/forum/topic/182733-irregular-arrumar-esse-script%C2%B3/ Compartilhar em outros sites More sharing options...
Vodkart 1515 Postado Março 18, 2012 Share Postado Março 18, 2012 function onLogin(cid) registerCreatureEvent(cid, "aloot_kill") return true end local stor = 7575 function autoloot(cid, target, pos) local function doStack(cid, itemid, new) local count = getPlayerItemCount(cid, itemid) if (count > 100) then count = count - math.floor(count / 100) * 100 end local newCount = count + new if (count ~= 0) then local find = getPlayerItemById(cid, true, itemid, count).uid if (find > 0) then doRemoveItem(find) else newCount = new end end local item = doCreateItemEx(itemid, newCount) doPlayerAddItemEx(cid, item, true) end local function scanContainer(cid, uid, list) for k = (getContainerSize(uid) - 1), 0, -1 do local tmp = getContainerItem(uid, k) if (isInArray(list, tmp.itemid)) then if isItemStackable(tmp.itemid) and (getPlayerItemCount(cid, tmp.itemid) > 0) then doStack(cid, tmp.itemid, tmp.type) else local item = doCreateItemEx(tmp.itemid, tmp.type) doPlayerAddItemEx(cid, item, true) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Looted ' .. tmp.type .. ' ' .. getItemNameById(tmp.itemid) .. '.') doRemoveItem(tmp.uid) elseif isContainer(tmp.uid) then scanContainer(cid, tmp.uid, list) end end end local items = {} for i = getTileInfo(pos).items, 1, -1 do pos.stackpos = i table.insert(items, getThingFromPos(pos)) end if (#items == 0) then return end local corpse = -1 for _, item in ipairs(items) do local name = getItemName(item.uid):lower() if name:find(target:lower()) then corpse = item.uid break end end if (corpse ~= -1) and isContainer(corpse) then scanContainer(cid, corpse, tostring(getPlayerStorageValue(cid, stor)):gsub('_', ''):explode(',')) end function onKill(cid, target, lastHit) if not isPlayer(target) then local infos = getPlayerStorageValue(cid, stor) if (infos == -1) then return true end local list = tostring(infos):explode(',') if (#list == 0) then return true end addEvent(autoloot, 150, cid, getCreatureName(target), getCreaturePosition(target)) end return true end Link para o comentário https://xtibia.com/forum/topic/182733-irregular-arrumar-esse-script%C2%B3/#findComment-1219911 Compartilhar em outros sites More sharing options...
FehZito 0 Postado Março 18, 2012 Autor Share Postado Março 18, 2012 Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/aloot.lua) [18/03/2012 17:14:24] data/talkactions/scripts/aloot.lua:91: '<eof>' expected near 'end' [18/03/2012 17:14:25] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/aloot.lua) [18/03/2012 17:14:25] data/creaturescripts/scripts/aloot.lua:81: 'end' expected (to close 'function' at line 8) near '<eof>' [18/03/2012 17:14:25] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/aloot.lua) [18/03/2012 17:14:25] data/creaturescripts/scripts/aloot.lua:81: 'end' expected (to close 'function' at line 8) near '<eof>' E agora? Link para o comentário https://xtibia.com/forum/topic/182733-irregular-arrumar-esse-script%C2%B3/#findComment-1219987 Compartilhar em outros sites More sharing options...
xFkyx 6 Postado Março 18, 2012 Share Postado Março 18, 2012 function onLogin(cid) registerCreatureEvent(cid, "aloot_kill") return true end local stor = 7575 function autoloot(cid, target, pos) local function doStack(cid, itemid, new) local count = getPlayerItemCount(cid, itemid) if (count > 100) then count = count - math.floor(count / 100) * 100 end local newCount = count + new if (count ~= 0) then local find = getPlayerItemById(cid, true, itemid, count).uid if (find > 0) then doRemoveItem(find) else newCount = new end end local item = doCreateItemEx(itemid, newCount) doPlayerAddItemEx(cid, item, true) end local function scanContainer(cid, uid, list) for k = (getContainerSize(uid) - 1), 0, -1 do local tmp = getContainerItem(uid, k) if (isInArray(list, tmp.itemid)) then if isItemStackable(tmp.itemid) and (getPlayerItemCount(cid, tmp.itemid) > 0) then doStack(cid, tmp.itemid, tmp.type) else local item = doCreateItemEx(tmp.itemid, tmp.type) doPlayerAddItemEx(cid, item, true) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Looted ' .. tmp.type .. ' ' .. getItemNameById(tmp.itemid) .. '.') doRemoveItem(tmp.uid) elseif isContainer(tmp.uid) then scanContainer(cid, tmp.uid, list) end end end local items = {} for i = getTileInfo(pos).items, 1, -1 do pos.stackpos = i table.insert(items, getThingFromPos(pos)) end if (#items == 0) then return end local corpse = -1 for _, item in ipairs(items) do local name = getItemName(item.uid):lower() if name:find(target:lower()) then corpse = item.uid break end end if (corpse ~= -1) and isContainer(corpse) then scanContainer(cid, corpse, tostring(getPlayerStorageValue(cid, stor)):gsub('_', ''):explode(',')) end function onKill(cid, target, lastHit) if not isPlayer(target) then local infos = getPlayerStorageValue(cid, stor) if (infos == -1) then return true end local list = tostring(infos):explode(',') if (#list == 0) then return true end addEvent(autoloot, 150, cid, getCreatureName(target), getCreaturePosition(target)) end return true end end Link para o comentário https://xtibia.com/forum/topic/182733-irregular-arrumar-esse-script%C2%B3/#findComment-1219998 Compartilhar em outros sites More sharing options...
Beeki 284 Postado Março 18, 2012 Share Postado Março 18, 2012 Cara eu axo que não seria necessário você criar um tópico com nomes idênticos para Pedir ajudar.. poderia usar o primeiro tópico que você criou, até Link para o comentário https://xtibia.com/forum/topic/182733-irregular-arrumar-esse-script%C2%B3/#findComment-1220020 Compartilhar em outros sites More sharing options...
FehZito 0 Postado Março 19, 2012 Autor Share Postado Março 19, 2012 Mais São Scripts diferentes. Link para o comentário https://xtibia.com/forum/topic/182733-irregular-arrumar-esse-script%C2%B3/#findComment-1220236 Compartilhar em outros sites More sharing options...
Beeki 284 Postado Março 19, 2012 Share Postado Março 19, 2012 Sim isso eu sei, mais você poderia aproveitar e pedir ajudar no mesmo tópico, isso é so uma sugestão, outra também, crie tópicos com nomes diferentes até. Link para o comentário https://xtibia.com/forum/topic/182733-irregular-arrumar-esse-script%C2%B3/#findComment-1220407 Compartilhar em outros sites More sharing options...
alldakie 160 Postado Março 19, 2012 Share Postado Março 19, 2012 Beeki esta correto, crie tópicos com o título diferente e com o nome do conteúdo que necessita de ajuda, como descrito no topico "Leia antes de fazer seu pedido": Pedidos cujo o título não descrever o conteúdo, serão fechados e não atendidos!Peço que use um título que explique o que quer, para ajudar a organização do fórum. Reportado! Link para o comentário https://xtibia.com/forum/topic/182733-irregular-arrumar-esse-script%C2%B3/#findComment-1220470 Compartilhar em outros sites More sharing options...
pessoa93 217 Postado Março 24, 2012 Share Postado Março 24, 2012 Olá XTibiano, Seu tópico está fora das regras, por favor leia as regras da seção. Grato pela atenção, Fechado. Link para o comentário https://xtibia.com/forum/topic/182733-irregular-arrumar-esse-script%C2%B3/#findComment-1222976 Compartilhar em outros sites More sharing options...
Posts Recomendados