-
Quem Está Navegando 0 membros estão online
Nenhum usuário registrado visualizando esta página.
-
Conteúdo Similar
-
Por Naze
Bom, estava pesquisando sobre OtClient e acabei achando esse OtClientV8, feito por Kondra -- link em pt-br dizendo sobre ele External Link -- tópico feito pelo próprio criado External Link
Comecei pesquisar sobre, e realmente me parasse um OtClient muito bom, o que mais me interessou e oq venho mostrar é a parte do BOT, ele ja vem com um bot incluso que me interessou muito, pois qualquer um pode criar as funções dele em lua.
O tópico falando do bot so vou deixar escrito oque ta la, mas se quiserem ver as imagens o link é esse -- External Link
Quando baixei o OtClient o bot ja vem um com 'example' com bastante comandos ja adicionado, mas vou deixar alguns exemplo aqui para poderem entender:
Aqui tem todas funções e mais informações sobre o bot -- https://github.com/OTCv8/otclientv8_bot
Meu objetivo com esse post é só compartilhar, já que não achei nada sobre ele no Tibia King, no momento tenho outros projeto, e não posso estuda as funções do bot, mas acredito que como eu tenha mais pessoas que se interesse.
Mas logo pretendo estuda pois acho que esse seria o melhor client e bot que pode substituir o tibia.exe elf/magebot q sempre usamos.
@edit
Não sei se estou na area certa, se estiver errado me desculpe e favor mover.
-
Por Naze
Uns dos problemas das maiorias dos otserv casual que estão online é o autoloot, alguns com erros e defeito na checagem dos containers e sempre consumindo muito por ser em lua fazendo checagens de tile, corpo, itens e etc. Por isso decidi da uma contribuição a essa comunidade que me evoluiu bastante um autoloot diretamente na source na função que insere os itens no corpo, otimizando em 100% na hr da entrega do item, e não tendo problemas ocasionais como corpos sobre corpos ou varias bags.
Esse sistema já é bem comum quando comprado, mas gratuito acredito que ainda não tinha disponível, então fiz esse totalmente do 0 na source tfs 0.4 rev 3999 (do yan).
Atenção na instalação! Qualquer problema pra compilar que envolva as linhas presente no código verifique novamente se instalou corretamente antes de pedir ajuda para evitar flood. Qualquer bug, erro ou mal funcionamento encontrado pode postar que estarei corrigindo, mas não irei customizar a seu agrado, você consegue fazer isso sozinho com atenção e calma, e se precisa de ajuda é só posta as duvidas.
Imagens do Sistema:
Características:
-> Otimizado executando apenas funções necessarias -> Comandos simples e praticos -> !autoloot on/off //Autoloot estara sempre ligado, e caso queria desliga use '!autoloot off' -> !autoloot bank/bag //Define para onde ira o dinheiro coletado, direto banco ou no inventario -> !autoloot list //Lista todos itens adicionados para coleta -> !autoloot clear/clean //Remove todos itens da lista -> !autoloot add, name item, name item, ... //Adiciona itens na lista, podendo adicionar quantos quiser de uma vez. Ele retorna um messagem dizendo os itens que foram adicionados e os que deram erro e não foram adicionados, talvez por escrito errado, ja existente na lista, na lista de bloquados, etc. -> !autoloot remove, item name, item name, ... //Remove itens da lista, com a mesma logica do add. -> Opções configuravel pelo Config.lua -> AutoLoot_MoneyIDs //IDs dos Itens Moedas do servidor como gold coins, platinium coins, crystal coins. -> AutoLoot_BlockIDs //IDs dos itens bloqueados para autoloot -> AutoLoot_MaxItem //Quantidade maxima de itens para adicionar a lista -> Sistema livres de bugs ou logs de erros.
Instalação:
Toda instalação será feita na source, exceto por 1 linha em talkactions.xml e 3 variáveis no config.lua
TFS 0.4 :
Link para Otx -> https://tibiaking.com/forums/topic/101086-otimizado-autoloot-in-sources-for-otx2-ou-menor/
Nas versões atual da TFS para servidores 10+ não ira funcionar pois algumas funções são diferente e não irei corrigir agora, em breve passo o mesmo pra tfs 1.x e otx3.
Esse sistema foi totalmente feito por mim, mas dou créditos também ao @Mathias Kenfi por me ajudar muito na evolução em lua/c++ e a tabela sql é a mesma usada no quick autoloot 1.3 postado por Pedriinz
@Edit:
Quem usa source de derivados caso ocorra erro aplica as alterações dos comentários abaixo.
Pequena correção em talkactions.cpp na parte remove na linha if(!player->checkAutoLoot(itemId)), para if(player->checkAutoLoot(itemId))
-
Por Digoshow
Ola eu instalei um scrip no meu otserv que e o Auto-loot, tudo certinho blz, mais eu queria editar o comando que e usado para diciona um item, o comando que esta e esse /aloot remove:2170 eu queria deixa assim /aloot remove, 2170 tirar os 2 pontos e deixa uma virgula e um espaco depois da virgula, alguem consegue editar pra mim porfavor:
Scrip que estou usando : http://www.tibiaking.com/forum/topic/8172-sistema-auto-loot/
Obrigado, REP+ !
-
Por Tricoder
SCREENSHOT
http://3.1m.yt/Zwo99Sdx.png
http://4.1m.yt/oG_cwli8u.png
______________________________________________ COMANDOS
!autoloot add, itemId ou name -- Adicionando um item na lista !autoloot remove, itemId or name -- Remover um item da lista !autoloot show -- Mostrar a lista do autoLoot !autoloot clear -- Limpar a lista do autoLoot ______________________________________________ SCRIPT data/global.lua
-- AutoLoot config AUTO_LOOT_MAX_ITEMS = 5 -- Reserved storage AUTOLOOT_STORAGE_START = 10000 AUTOLOOT_STORAGE_END = AUTOLOOT_STORAGE_START + AUTO_LOOT_MAX_ITEMS -- AutoLoot config end talkactions/talkactions.xml
<talkaction words="!autoloot" separator=" " script="autoloot.lua"/> talkactions/scripts/autoloot.lua
function onSay(player, words, param) local split = param:split(",") local action = split[1] if action == "add" then local item = split[2]:gsub("%s+", "", 1) local itemType = ItemType(item) if itemType:getId() == 0 then itemType = ItemType(tonumber(item)) if itemType:getId() == 0 then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "There is no item with that id or name.") return false end end local itemName = tonumber(split[2]) and itemType:getName() or item local size = 0 for i = AUTOLOOT_STORAGE_START, AUTOLOOT_STORAGE_END do local storage = player:getStorageValue(i) if size == AUTO_LOOT_MAX_ITEMS then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "The list is full, please remove from the list to make some room.") break end if storage == itemType:getId() then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, itemName .." is already in the list.") break end if storage <= 0 then player:setStorageValue(i, itemType:getId()) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, itemName .." has been added to the list.") break end size = size + 1 end elseif action == "remove" then local item = split[2]:gsub("%s+", "", 1) local itemType = ItemType(item) if itemType:getId() == 0 then itemType = ItemType(tonumber(item)) if itemType:getId() == 0 then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "There is no item with that id or name.") return false end end local itemName = tonumber(split[2]) and itemType:getName() or item for i = AUTOLOOT_STORAGE_START, AUTOLOOT_STORAGE_END do if player:getStorageValue(i) == itemType:getId() then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, itemName .." has been removed from the list.") player:setStorageValue(i, 0) return false end end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, itemName .." was not founded in the list.") elseif action == "show" then local text = "-- Auto Loot List --\n" local count = 1 for i = AUTOLOOT_STORAGE_START, AUTOLOOT_STORAGE_END do local storage = player:getStorageValue(i) if storage > 0 then text = string.format("%s%d. %s\n", text, count, ItemType(storage):getName()) count = count + 1 end end if text == "" then text = "Empty" end player:showTextDialog(1950, text, false) elseif action == "clear" then for i = AUTOLOOT_STORAGE_START, AUTOLOOT_STORAGE_END do player:setStorageValue(i, 0) end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "The autoloot list has been cleared.") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Use the commands: !autoloot {add, remove, show, clear}") end return false end creaturescripts/creaturescripts.xml
<event type="kill" name="AutoLoot" script="autoloot.lua" /> creaturescripts/scripts/autoloot.lua
local function scanContainer(cid, position) local player = Player(cid) if not player then return end local corpse = Tile(position):getTopDownItem() if not corpse then return end if corpse:getType():isCorpse() and corpse:getAttribute(ITEM_ATTRIBUTE_CORPSEOWNER) == cid then for i = corpse:getSize() - 1, 0, -1 do local containerItem = corpse:getItem(i) if containerItem then for i = AUTOLOOT_STORAGE_START, AUTOLOOT_STORAGE_END do if player:getStorageValue(i) == containerItem:getId() then containerItem:moveTo(player) end end end end end end function onKill(player, target) if not target:isMonster() then return true end addEvent(scanContainer, 100, player:getId(), target:getPosition()) return true end creaturescripts/scripts/login.lua
player:registerEvent("AutoLoot") ______________________________________________ CRÉDITOS
Printer -
Por AgaSsI
creaturescripts.xml
<event type="login" name="aloot_reg" event="script" value="aloot.lua"/> <event type="kill" name="aloot_kill" event="script" value="aloot.lua"/> creaturescripts/scritps aloot.lua
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 talkactios.xml
<talkaction words="/aloot" hide="yes" event="script" value="aloot.lua"/> Talkaction/scrips
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, 'not 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 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, 'already added.') 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) .. '<< 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 dont have any item added.') 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, 'not 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 doPlayerSetStorageValue(cid, stor, tostring(new)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Item >>' .. getItemNameById(item) .. '<< removed from the autoloot list.') end return true end Usando
/aloot check
Cheka a Lista dos Loots
/aloot add:itemid ou nome do item
Exemplo
/aloot add:worm
/aloot add:2170
16:42 Item >>worm<< has been added to the autoloot list.
Para remover
/aloot remove:worm
/aloot remove:2170
Exemplo Testado:
16:41 Looted 2 gold coin.
16:41 Looted 1 cheese.
CREDITOS: eduardobean
é isso pessoal gosto da + Rep
-
Posts Recomendados
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.