Ir para conteúdo
  • Cadastre-se

Posts Recomendados

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

Spoiler

O OTClientV8 bot está incluído no projeto OTClientV8, mas possui um repositório github separado com documentação e exemplos.


Este bot permite que você crie o que quiser com a linguagem lua e otclient otml. Ele fornece acesso a todas as funções otclient lua e possui várias funções e ferramentas para facilitar o desenvolvimento.
 
Ainda não há uma interface atualizado, porém você pode criar utilizando a função setupUI e compartilhar

Já está em desenvolvimento a documentação de uso deste bot, onde é possível encontrar scripts e tutoriais de como utiliza-lo 
Se você quiser contribuir, adicionar mais funções, alguns scripts ou até a interface do usuário entre no canal de discord otclientv8 e entre em contato comigo - Entre no Servidor de discórdia OTClientV8! (https://discord.gg/feySup6). Ou apenas faça uma solicitação de recebimento do github.

O Limite é a sua imaginação!

Creditos Kondra

 

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

 

Spoiler

Todos exemplos aqui  NÃO foram criado por mim, deixarei os devidos crédito e link.

Os script são colocado no diretorio do AppData\Roaming\OTClientV8\otclientv8\bot\seuperfil

A maoria aqui talvez ja vem incluso como 'example'.

 

Sio com janela de texto para adicionar quantos friends quiser - credito Evolunia

Spoiler


macro(100, "Sio", function()
    local friend = getPlayerByName(storage.friendName)
    local friend1 = getPlayerByName(storage.friend1Name)
    if friend and friend:getHealthPercent() < 80 then
        say("exura sio \""..storage.friendName)
        delay(500)
   elseif friend1 and friend1:getHealthPercent() <= 80 then -- If u need more you can copy this lines
        say("exura sio \""..storage.friend1Name) --
        delay(500) --
    end -- And paste them between this end and the delay
end)
  addTextEdit("friendName", storage.friendName or "Friend Name", function(widget, text) 
    storage.friendName = text
end)
addLabel("Priority 1 ^ Priority 2 v", "Priority 1 ^ Priority 2 v")
  addTextEdit("friend1Name", storage.friend1Name or "Friend Name", function(widget, text)   -- Also copy this lines
    storage.friend1Name = text -- If u add more just rename the Friend1Name to Friend2Name in the lines u paste
end) --

 

 

 

Anti-Paralyze - credito Evolunia

Spoiler


macro(100, "Anti Paralyze", nil, function()
  if isParalyzed() and storage.autoAntiParalyzeText:len() > 0 then
    saySpell(storage.autoAntiParalyzeText)
end
end)
addTextEdit("autoAntiParalyzeText", storage.autoAntiParalyzeText or "utani hur", function(widget, text) 
  storage.autoAntiParalyzeText = text
end)

 

 

 

Heal com Potion com janela para escolher potions - credito Evolunia

Spoiler


local healthPercent = 99
macro(200, "faster health potting",  function()
  if (hppercent() <= healthPercent) then
    usewith((storage.hpItem), player)
  end
end)
addTextEdit("hpItem", storage.hpItem or "23375", function(widget, text) 
storage.hpItem = text
end)

 

 

Equipa energy ring em determinado % de vida - credito Evolunia

Spoiler


--[[
  1. Start the script with your normal ring on 
  2. make sure the backpack with e-rings
     are always open
]]
local energy_ring = 3051; -- Your energy ring
local energy_ring_equiped = 3088; -- Ring changes id when equiped
local original_ring = getFinger(); -- Your original ring
local healthp_for_energy = 50;
local healthp_for_original = 80;
local manap_for_original = 25;

macro(1000, "e-ring", function()
  if (manapercent() <= manap_for_original and getFinger():getId() ~= original_ring:getId()) then
    g_game.equipItem(original_ring);
  elseif (hppercent() <= healthp_for_energy and manapercent() >= manap_for_original and getFinger():getId() ~= energy_ring) then
      local ring = findItem(energy_ring);
      if (ring) then
          g_game.equipItem(ring);
      end
  elseif (hppercent() >= healthp_for_original and getFinger():getId() ~= original_ring:getId()) then
      g_game.equipItem(original_ring);
  end
end)

 

 

faz com que todas as mensagens privadas sejam exibidas na tela, da mesma forma que os scripts no windbot / xenobot. Basta colá-lo na janela de retornos de chamada e ele funcionará. -- credito Mr. Greyshade

Spoiler


local height = 50
local widget = setupUI([[
Panel
  id: msgPanel
  height: 400
  width: 200
]], g_ui.getRootWidget())

onTalk(function(name, level, mode, text, channelId, pos)
    if (mode ~= 4) then return end
    local msgLabel = g_ui.loadUIFromString([[
Label
  color: #5ff7f7
  background-color: black
  opacity: 0.87
]], widget)
    msgLabel:setText(name .." ["..level.. "]: " .. text)
    msgLabel:setPosition({y = height, x = 10})
    if height > 210 then
        for msgIndex, message in ipairs(widget:getChildren()) do
            message:setPosition({y = message:getPosition().y - 13, x = 10})
            if (msgIndex == 1) then message:destroy() end
        end
    else
        height = height + 13
    end
end)

 

 

Ataca monstro mais proximo e menos health se for mais de um - credito Ele no

Spoiler


macro(100, "Smarter targeting", function() 
  local battlelist = getSpectators();
  local closest = 10
  local lowesthpc = 101
  for key, val in pairs(battlelist) do
    if val:isMonster() then
      if getDistanceBetween(player:getPosition(), val:getPosition()) <= closest then
        closest = getDistanceBetween(player:getPosition(), val:getPosition())
        if val:getHealthPercent() < lowesthpc then
          lowesthpc = val:getHealthPercent()
        end
      end
    end
  end
  for key, val in pairs(battlelist) do
    if val:isMonster() then
      if getDistanceBetween(player:getPosition(), val:getPosition()) <= closest then
        if g_game.getAttackingCreature() ~= val and val:getHealthPercent() <= lowesthpc then 
          g_game.attack(val)
          break
        end
      end
    end
  end
end)

 

 

Agora esse é mais avançado vou deixa oque ele faz com tradução do translate google mas o link original de todos esta no começo. - credito panxor

 

Spoiler

como se comporta:
1.bot usará magia multi-alvo se houver 2 ou mais monstros por perto, mesmo quando houver jogadores na tela - até você atingir 15 pvp kills (alguém tenta fazer o RS)
2. bot usará magia alvo única se apenas 1 monstros ao redor ou existem jogadores na tela (se você ultrapassou 15 pontos de pvp em mata-mata).

Importante! bot irá contar o número de mortes que você ganhou desde que você iniciou o script / redefiniu a janela da macro (desligue e ligue novamente).
Para alterar o ponto inicial da contagem, basta alterar os frags de 0 para o

próprio X Script:

 



local frags = 0

onTextMessage(function(mode, text)
 if string.find(text, "Warning! The murder") then
    frags = frags + 1
end
end)

local multiTargetSpell = 'holy power'
local singleTargetSpell = 'exori san'
local distance = 3
local amountOfMonsters = 2
local fragLimit = 15

macro(250, "Exp Cast",  function()
    local isSafe = true;
    local specAmount = 0
    if not g_game.isAttacking() then
        return
    end
    for i,mob in ipairs(getSpectators()) do
        if (getDistanceBetween(player:getPosition(), mob:getPosition())  <= distance and mob:isMonster())  then
            specAmount = specAmount + 1
        end
        if (mob:isPlayer() and player:getName() ~= mob:getName()) then
            isSafe = false;
        end
    end
    if (specAmount >= amountOfMonsters and ((frags <= fragLimit) or isSafe)) then
        say(multiTargetSpell)
    else
        say(singleTargetSpell)
    end
end)

 

 

Todos script tirado desse link - https://otland.net/threads/scripts-macros-for-kondras-otclientv8-bot.267394/

 

 

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.

Discord: Naze#3578

 

Ter Linux Dentro de Windows com Acesso 'localhost' para testes e +

AutoLoot Otimizado Direto na Source (tfs 0.4/otx)

 

// Pirataria é crime, original é roubo, compartilhar é legal.

 

tumblr_muk78tEwDQ1qah4nko1_500.gif

Link para o post
Compartilhar em outros sites
  • Administrador

Parabéns, seu tópico de conteúdo foi aprovado!
Muito obrigado pela sua contribuição, nós do Tibia King agradecemos.
Seu conteúdo com certeza ajudará à muitos outros, você recebeu +1 REP.

Spoiler

Congratulations, your content has been approved!
Thank you for your contribution, we of Tibia King we are grateful.
Your content will help many other users, you received +1 REP.

 

TibiaKing Team- KingTópicos
www.tibiaking.com

Link para o post
Compartilhar em outros sites
  • 1 year later...
Em 21/02/2020 em 11:55, Naze disse:

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

  Mostrar conteúdo oculto

O OTClientV8 bot está incluído no projeto OTClientV8, mas possui um repositório github separado com documentação e exemplos.


Este bot permite que você crie o que quiser com a linguagem lua e otclient otml. Ele fornece acesso a todas as funções otclient lua e possui várias funções e ferramentas para facilitar o desenvolvimento.
 
Ainda não há uma interface atualizado, porém você pode criar utilizando a função setupUI e compartilhar

Já está em desenvolvimento a documentação de uso deste bot, onde é possível encontrar scripts e tutoriais de como utiliza-lo 
Se você quiser contribuir, adicionar mais funções, alguns scripts ou até a interface do usuário entre no canal de discord otclientv8 e entre em contato comigo - Entre no Servidor de discórdia OTClientV8! (https://discord.gg/feySup6). Ou apenas faça uma solicitação de recebimento do github.

O Limite é a sua imaginação!

Creditos Kondra

 

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

 

  Ocultar conteúdo

Todos exemplos aqui  NÃO foram criado por mim, deixarei os devidos crédito e link.

Os script são colocado no diretorio do AppData\Roaming\OTClientV8\otclientv8\bot\seuperfil

A maoria aqui talvez ja vem incluso como 'example'.

 

Sio com janela de texto para adicionar quantos friends quiser - credito Evolunia

  Mostrar conteúdo oculto



macro(100, "Sio", function()
    local friend = getPlayerByName(storage.friendName)
    local friend1 = getPlayerByName(storage.friend1Name)
    if friend and friend:getHealthPercent() < 80 then
        say("exura sio \""..storage.friendName)
        delay(500)
   elseif friend1 and friend1:getHealthPercent() <= 80 then -- If u need more you can copy this lines
        say("exura sio \""..storage.friend1Name) --
        delay(500) --
    end -- And paste them between this end and the delay
end)
  addTextEdit("friendName", storage.friendName or "Friend Name", function(widget, text) 
    storage.friendName = text
end)
addLabel("Priority 1 ^ Priority 2 v", "Priority 1 ^ Priority 2 v")
  addTextEdit("friend1Name", storage.friend1Name or "Friend Name", function(widget, text)   -- Also copy this lines
    storage.friend1Name = text -- If u add more just rename the Friend1Name to Friend2Name in the lines u paste
end) --

 

 

 

Anti-Paralyze - credito Evolunia

  Mostrar conteúdo oculto



macro(100, "Anti Paralyze", nil, function()
  if isParalyzed() and storage.autoAntiParalyzeText:len() > 0 then
    saySpell(storage.autoAntiParalyzeText)
end
end)
addTextEdit("autoAntiParalyzeText", storage.autoAntiParalyzeText or "utani hur", function(widget, text) 
  storage.autoAntiParalyzeText = text
end)

 

 

 

Heal com Potion com janela para escolher potions - credito Evolunia

  Mostrar conteúdo oculto



local healthPercent = 99
macro(200, "faster health potting",  function()
  if (hppercent() <= healthPercent) then
    usewith((storage.hpItem), player)
  end
end)
addTextEdit("hpItem", storage.hpItem or "23375", function(widget, text) 
storage.hpItem = text
end)

 

 

Equipa energy ring em determinado % de vida - credito Evolunia

  Mostrar conteúdo oculto



--[[
  1. Start the script with your normal ring on 
  2. make sure the backpack with e-rings
     are always open
]]
local energy_ring = 3051; -- Your energy ring
local energy_ring_equiped = 3088; -- Ring changes id when equiped
local original_ring = getFinger(); -- Your original ring
local healthp_for_energy = 50;
local healthp_for_original = 80;
local manap_for_original = 25;

macro(1000, "e-ring", function()
  if (manapercent() <= manap_for_original and getFinger():getId() ~= original_ring:getId()) then
    g_game.equipItem(original_ring);
  elseif (hppercent() <= healthp_for_energy and manapercent() >= manap_for_original and getFinger():getId() ~= energy_ring) then
      local ring = findItem(energy_ring);
      if (ring) then
          g_game.equipItem(ring);
      end
  elseif (hppercent() >= healthp_for_original and getFinger():getId() ~= original_ring:getId()) then
      g_game.equipItem(original_ring);
  end
end)

 

 

faz com que todas as mensagens privadas sejam exibidas na tela, da mesma forma que os scripts no windbot / xenobot. Basta colá-lo na janela de retornos de chamada e ele funcionará. -- credito Mr. Greyshade

  Mostrar conteúdo oculto



local height = 50
local widget = setupUI([[
Panel
  id: msgPanel
  height: 400
  width: 200
]], g_ui.getRootWidget())

onTalk(function(name, level, mode, text, channelId, pos)
    if (mode ~= 4) then return end
    local msgLabel = g_ui.loadUIFromString([[
Label
  color: #5ff7f7
  background-color: black
  opacity: 0.87
]], widget)
    msgLabel:setText(name .." ["..level.. "]: " .. text)
    msgLabel:setPosition({y = height, x = 10})
    if height > 210 then
        for msgIndex, message in ipairs(widget:getChildren()) do
            message:setPosition({y = message:getPosition().y - 13, x = 10})
            if (msgIndex == 1) then message:destroy() end
        end
    else
        height = height + 13
    end
end)

 

 

Ataca monstro mais proximo e menos health se for mais de um - credito Ele no

  Mostrar conteúdo oculto



macro(100, "Smarter targeting", function() 
  local battlelist = getSpectators();
  local closest = 10
  local lowesthpc = 101
  for key, val in pairs(battlelist) do
    if val:isMonster() then
      if getDistanceBetween(player:getPosition(), val:getPosition()) <= closest then
        closest = getDistanceBetween(player:getPosition(), val:getPosition())
        if val:getHealthPercent() < lowesthpc then
          lowesthpc = val:getHealthPercent()
        end
      end
    end
  end
  for key, val in pairs(battlelist) do
    if val:isMonster() then
      if getDistanceBetween(player:getPosition(), val:getPosition()) <= closest then
        if g_game.getAttackingCreature() ~= val and val:getHealthPercent() <= lowesthpc then 
          g_game.attack(val)
          break
        end
      end
    end
  end
end)

 

 

Agora esse é mais avançado vou deixa oque ele faz com tradução do translate google mas o link original de todos esta no começo. - credito panxor

 

  Mostrar conteúdo oculto

como se comporta:
1.bot usará magia multi-alvo se houver 2 ou mais monstros por perto, mesmo quando houver jogadores na tela - até você atingir 15 pvp kills (alguém tenta fazer o RS)
2. bot usará magia alvo única se apenas 1 monstros ao redor ou existem jogadores na tela (se você ultrapassou 15 pontos de pvp em mata-mata).

Importante! bot irá contar o número de mortes que você ganhou desde que você iniciou o script / redefiniu a janela da macro (desligue e ligue novamente).
Para alterar o ponto inicial da contagem, basta alterar os frags de 0 para o

próprio X Script:

 




local frags = 0

onTextMessage(function(mode, text)
 if string.find(text, "Warning! The murder") then
    frags = frags + 1
end
end)

local multiTargetSpell = 'holy power'
local singleTargetSpell = 'exori san'
local distance = 3
local amountOfMonsters = 2
local fragLimit = 15

macro(250, "Exp Cast",  function()
    local isSafe = true;
    local specAmount = 0
    if not g_game.isAttacking() then
        return
    end
    for i,mob in ipairs(getSpectators()) do
        if (getDistanceBetween(player:getPosition(), mob:getPosition())  <= distance and mob:isMonster())  then
            specAmount = specAmount + 1
        end
        if (mob:isPlayer() and player:getName() ~= mob:getName()) then
            isSafe = false;
        end
    end
    if (specAmount >= amountOfMonsters and ((frags <= fragLimit) or isSafe)) then
        say(multiTargetSpell)
    else
        say(singleTargetSpell)
    end
end)

 

 

Todos script tirado desse link - https://otland.net/threads/scripts-macros-for-kondras-otclientv8-bot.267394/

 

 

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.

 

Desculpa o incomodo mas não achei em nenhum lugar

Você sabe me dizer como faz o comando do Function pra quando ele chegar no final do cavebot voltar para o label hunt?

 

EX: Eu fiz o label inicio

Fiz o script pra ir até a hunt

Chegando na hunt fiz o label hunt

Fiz o script da hunt 

Agora quero que ele volte pro label hunt se não tiver morrido

Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por L3K0T
      TUTORIAL BY L3K0T PT~EN
       
      Olá pessoal, trago a vocês uma atualização que fiz no sistema, contendo 3 novas funcionalidades de movimentação de itens e uma proteção contra Elf Bot. Estas adições foram cuidadosamente implementadas para aperfeiçoar a experiência de jogo e manter a integridade do seu servidor.
      As novas funcionalidades têm a função vital de impedir que jogadores deixem itens indesejados em locais inapropriados, como na entrada de sua casa, em cima de seus depósitos ou em teleportes. Agora, apenas proprietários, subproprietários e convidados têm permissão para manipular itens nesses locais.
      Este pacote de atualização foi meticulosamente revisado para evitar abusos por parte de jogadores mal-intencionados e garantir um ambiente de jogo justo e equilibrado para todos os usuários.
       
       
       
      Iniciando o Tutorial
      1Abra o arquivo "creatureevents.cpp" com o editor de sua preferência. Eu pessoalmente recomendo o Notepad++. 
       
       
      Em creatureevents.cpp:
      return "onPrepareDeath"; Adicione abaixo:
      case CREATURE_EVENT_MOVEITEM: return "onMoveItem"; case CREATURE_EVENT_MOVEITEM2: return "onMoveItem2";  
      Em:
      return "cid, deathList"; Adicione abaixo:
      case CREATURE_EVENT_MOVEITEM: return "moveItem, frompos, topos, cid"; case CREATURE_EVENT_MOVEITEM2: return "cid, item, count, toContainer, fromContainer, fromPos, toPos";  
      Em:
      m_type = CREATURE_EVENT_PREPAREDEATH; Adicione abaixo:
      else if(tmpStr == "moveitem") m_type = CREATURE_EVENT_MOVEITEM; else if(tmpStr == "moveitem2") m_type = CREATURE_EVENT_MOVEITEM2;  
      Procure por:
      bool CreatureEvents::playerLogout(Player* player, bool forceLogout) { //fire global event if is registered bool result = true; for(CreatureEventList::iterator it = m_creatureEvents.begin(); it != m_creatureEvents.end(); ++it) { if((*it)->getEventType() == CREATURE_EVENT_LOGOUT && (*it)->isLoaded() && !(*it)->executeLogout(player, forceLogout) && result) result = false; } return result; } Adicione abaixo:
      uint32_t CreatureEvents::executeMoveItems(Creature* actor, Item* item, const Position& frompos, const Position& pos) { // fire global event if is registered for(CreatureEventList::iterator it = m_creatureEvents.begin(); it != m_creatureEvents.end(); ++it) { if((*it)->getEventType() == CREATURE_EVENT_MOVEITEM) { if(!(*it)->executeMoveItem(actor, item, frompos, pos)) return 0; } } return 1; }  
      Em:
      bool CreatureEvents::playerLogin(Player* player) { //fire global event if is registered bool result = true; for(CreatureEventList::iterator it = m_creatureEvents.begin(); it != m_creatureEvents.end(); ++it) { if((*it)->getEventType() == CREATURE_EVENT_LOGIN && (*it)->isLoaded() && !(*it)->executeLogin(player) && result) result = false; } if (result) { for(CreatureEventList::iterator it = m_creatureEvents.begin(); it != m_creatureEvents.end(); ++it) { CreatureEvent* event = *it; if(event->isLoaded() && ( event->getRegister() == "player" || event->getRegister() == "all") ) player->registerCreatureEvent(event->getName()); } } return result; } Adicione Abaixo:
      uint32_t CreatureEvent::executeMoveItem(Creature* actor, Item* item, const Position& frompos, const Position& pos) { //onMoveItem(moveItem, frompos, position, cid) if(m_interface->reserveEnv()) { ScriptEnviroment* env = m_interface->getEnv(); if(m_scripted == EVENT_SCRIPT_BUFFER) { env->setRealPos(pos); std::stringstream scriptstream; env->streamThing(scriptstream, "moveItem", item, env->addThing(item)); env->streamPosition(scriptstream, "position", frompos, 0); env->streamPosition(scriptstream, "position", pos, 0); scriptstream << "local cid = " << env->addThing(actor) << std::endl; scriptstream << m_scriptData; bool result = true; if(m_interface->loadBuffer(scriptstream.str())) { lua_State* L = m_interface->getState(); result = m_interface->getGlobalBool(L, "_result", true); } m_interface->releaseEnv(); return result; } else { #ifdef __DEBUG_LUASCRIPTS__ char desc[35]; sprintf(desc, "%s", player->getName().c_str()); env->setEventDesc(desc); #endif env->setScriptId(m_scriptId, m_interface); env->setRealPos(pos); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); LuaInterface::pushThing(L, item, env->addThing(item)); LuaInterface::pushPosition(L, frompos, 0); LuaInterface::pushPosition(L, pos, 0); lua_pushnumber(L, env->addThing(actor)); bool result = m_interface->callFunction(4); m_interface->releaseEnv(); return result; } } else { std::clog << "[Error - CreatureEvent::executeMoveItem] Call stack overflow." << std::endl; return 0; } } uint32_t CreatureEvent::executeMoveItem2(Player* player, Item* item, uint8_t count, const Position& fromPos, const Position& toPos, Item* toContainer, Item* fromContainer, int16_t fstack) { //onMoveItem2(cid, item, count, toContainer, fromContainer, fromPos, toPos) if(m_interface->reserveEnv()) { ScriptEnviroment* env = m_interface->getEnv(); if(m_scripted == EVENT_SCRIPT_BUFFER) { env->setRealPos(player->getPosition()); std::stringstream scriptstream; scriptstream << "local cid = " << env->addThing(player) << std::endl; env->streamThing(scriptstream, "item", item, env->addThing(item)); scriptstream << "local count = " << count << std::endl; env->streamThing(scriptstream, "toContainer", toContainer, env->addThing(toContainer)); env->streamThing(scriptstream, "fromContainer", fromContainer, env->addThing(fromContainer)); env->streamPosition(scriptstream, "fromPos", fromPos, fstack); env->streamPosition(scriptstream, "toPos", toPos, 0); scriptstream << m_scriptData; bool result = true; if(m_interface->loadBuffer(scriptstream.str())) { lua_State* L = m_interface->getState(); result = m_interface->getGlobalBool(L, "_result", true); } m_interface->releaseEnv(); return result; } else { #ifdef __DEBUG_LUASCRIPTS__ char desc[30]; sprintf(desc, "%s", player->getName().c_str()); env->setEvent(desc); #endif env->setScriptId(m_scriptId, m_interface); env->setRealPos(player->getPosition()); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); lua_pushnumber(L, env->addThing(player)); LuaInterface::pushThing(L, item, env->addThing(item)); lua_pushnumber(L, count); LuaInterface::pushThing(L, toContainer, env->addThing(toContainer)); LuaInterface::pushThing(L, fromContainer, env->addThing(fromContainer)); LuaInterface::pushPosition(L, fromPos, fstack); LuaInterface::pushPosition(L, toPos, 0); //lua_pushnumber(L, env->addThing(actor)); bool result = m_interface->callFunction(7); m_interface->releaseEnv(); return result; } } else { std::clog << "[Error - CreatureEvent::executeMoveItem] Call stack overflow." << std::endl; return 0; } }  
       
       
      Agora em em creatureevents.h:
      CREATURE_EVENT_PREPAREDEATH, Adicione abaixo:
      CREATURE_EVENT_MOVEITEM, CREATURE_EVENT_MOVEITEM2  
      Em:
      uint32_t executePrepareDeath(Creature* creature, DeathList deathList); Adicione abaixo:
      uint32_t executeMoveItem(Creature* actor, Item* item, const Position& frompos, const Position& pos); uint32_t executeMoveItem2(Player* player, Item* item, uint8_t count, const Position& fromPos, const Position& toPos, Item* toContainer, Item* fromContainer, int16_t fstack);  
      Em:
      bool playerLogout(Player* player, bool forceLogout); Abaixo adicone também
      uint32_t executeMoveItems(Creature* actor, Item* item, const Position& frompos, const Position& pos); uint32_t executeMoveItem2(Player* player, Item* item, uint8_t count, const Position& fromPos, const Position& toPos, Item* toContainer, Item* fromContainer, int16_t fstack);  
       
      Agora em em game.cpp:
      if(!canThrowObjectTo(mapFromPos, mapToPos) && !player->hasCustomFlag(PlayerCustomFlag_CanThrowAnywhere)) { player->sendCancelMessage(RET_CANNOTTHROW); return false; } ReturnValue ret = internalMoveItem(player, fromCylinder, toCylinder, toIndex, item, count, NULL); if(ret == RET_NOERROR) return true; player->sendCancelMessage(ret); return false; } Altere para:
      if (!canThrowObjectTo(mapFromPos, mapToPos) && !player->hasCustomFlag(PlayerCustomFlag_CanThrowAnywhere)) { player->sendCancelMessage(RET_CANNOTTHROW); return false; } bool success = true; CreatureEventList moveitemEvents = player->getCreatureEvents(CREATURE_EVENT_MOVEITEM2); for (CreatureEventList::iterator it = moveitemEvents.begin(); it != moveitemEvents.end(); ++it) { Item* toContainer = toCylinder->getItem(); Item* fromContainer = fromCylinder->getItem(); if (!(*it)->executeMoveItem2(player, item, count, fromPos, toPos, (toContainer ? toContainer : 0), (fromContainer ? fromContainer : 0), fromStackpos) && success) success = false; } if (!success) return false; if (g_config.getBool(ConfigManager::ANTI_PUSH)) { std::string antiPushItems = g_config.getString(ConfigManager::ANTI_PUSH_ITEMS); IntegerVec tmpVec = vectorAtoi(explodeString(antiPushItems, ",")); if (tmpVec[0] != 0) { for (IntegerVec::iterator it = tmpVec.begin(); it != tmpVec.end(); ++it) { if (item->getID() == uint32_t(*it) && player->hasCondition(CONDITION_EXHAUST, 1)) { player->sendTextMessage(MSG_STATUS_SMALL, "Please wait a few seconds to move this item."); return false; } } } } int32_t delay = g_config.getNumber(ConfigManager::ANTI_PUSH_DELAY); if (Condition* condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_EXHAUST, delay, 0, false, 1)) player->addCondition(condition); if (!g_creatureEvents->executeMoveItems(player, item, mapFromPos, mapToPos)) return false; ReturnValue ret = internalMoveItem(player, fromCylinder, toCylinder, toIndex, item, count, NULL); if (ret != RET_NOERROR) { player->sendCancelMessage(ret); return false; } player->setNextAction(OTSYS_TIME() + g_config.getNumber(ConfigManager::ACTIONS_DELAY_INTERVAL) - 10); return true; }  
      Agora em configmanager.h
      ADMIN_ENCRYPTION_DATA Adicione abaixo:
      ANTI_PUSH_ITEMS,  
      em:
      STAMINA_DESTROY_LOOT, Adicione abaixo:
      ANTI_PUSH_DELAY,  
      em:
      ADDONS_PREMIUM, Adicione abaixo:
      ANTI_PUSH  
      Agora você pode compilar a Source.
       
       
      Configurando no servidor:
       
      Abra seu config.lua do servidor e adicione isso dentro qualquer lugar:
      -- Anti-Push useAntiPush = true antiPushItems = "2148,2152,2160,3976" antiPushDelay = 500  
       
      Navegue até o diretório 'creaturescripts' e localize o arquivo 'login.lua'.
      em resgistros de eventos adicione:
      login.lua
      registerCreatureEvent(cid, "MoveItem") registerCreatureEvent(cid, "MoveItem2")  
      Agora abra o aquivo creaturescript .xml
      <event type="moveitem" name="MoveItem" event="script" value="houseprotecao.lua"/> <event type="moveitem2" name="MoveItem2" event="script" value="moveitem2.lua"/>  
      Crie um novo arquivo lua em scripts com o nome houseprotecao.lua e adicione isso:
      function onMoveItem(moveItem, frompos, position, cid) if position.x == CONTAINER_POSITION then return true end local house = getHouseFromPos(frompos) or getHouseFromPos(position) --correção 100% if type(house) == "number" then local owner = getHouseOwner(house) if owner == 0 then return false, doPlayerSendCancel(cid, "Isso não é Possível.") end if owner ~= getPlayerGUID(cid) then local sub = getHouseAccessList(house, 0x101):explode("\n") local guest = getHouseAccessList(house, 0x100):explode("\n") local isInvited = false if (#sub > 0) and isInArray(sub, getCreatureName(cid)) then isInvited = true end if (#guest > 0) and isInArray(guest, getCreatureName(cid)) then isInvited = true end if not isInvited then return false, doPlayerSendCancel(cid, "Desculpe, você não está invitado.") end end end return true end  
      Crie um novo arquivo lua em scripts com o nome moveitem2.lua e adicione isso abaixo:
      local depottiles = {} --piso pra n jogar local depots = {2589} --id dos dps local group = 3 --id dos group 6 é todos. local function checkIfThrow(pos,topos) if topos.x == 0xffff then return false end local thing = getThingFromPos(pos) if isInArray(depottiles,thing.itemid) then if not isInArea(topos,{x=pos.x-1,y=pos.y-1,z=pos.z},{x=pos.x+1,y=pos.y+1, z=pos.z}) then return true end else for i = 1, #depots do if depots[i] == getTileItemById(topos,depots[i]).itemid or getTileInfo(topos).actionid == 7483 then return true end end end return false end function onMoveItem2(cid, item, count, toContainer, fromContainer, fromPos, toPos) if isPlayer(cid) then local pos = getThingPos(cid) if getPlayerGroupId(cid) > group then return true end if checkIfThrow({x=pos.x,y=pos.y,z=pos.z,stackpos=0},toPos) then doPlayerSendCancel(cid,"Não jogue item ai!!") doSendMagicEffect(getThingPos(cid),CONST_ME_POFF) return false end end return true end  
      ajudei?? REP+
      CRÉDITOS:
      @L3K0T
      Fir3element
      Summ
      Wise
      GOD Wille
      Yan Lima
       
       
       
       
    • Por Doria Louro
      Olá senhores.
       
      Gostaria de uma ajuda com um script de summon que venho trabalhando no momento, gostaria que o summon andasse do lado do jogador, entretanto o mesmo sempre fica para trás ou a frente do jogador.
      Efetuei a alteração na source creature.cpp:
       
      void Creature::getPathSearchParams(const Creature* creature, FindPathParams& fpp) const { fpp.fullPathSearch = !hasFollowPath; fpp.clearSight = true; if(creature->isPlayerSummon()) { if(creature->getName() == "Summon Name") fpp.clearSight = false; } fpp.maxSearchDist = 12; fpp.minTargetDist = fpp.maxTargetDist = 1; }  
      fpp.maxTargetDist = 1;
      Porém ele sempre mantem 1 de distancia do jogador, alterando para zero o "Zero" summon nem segue o jogador.
      Resultado:

       
      Agradeço desde já.
    • Por Imperius
      O propósito é criar uma nova função em creaturescripts que será acionada toda vez que um novo report (CTRL + R) for aberto.
       
      Eu implementei para enviar uma notificação no grupo do Telegram, contendo os dados do report.
       
      Isso garantirá que os GMs tenham acesso aos reports dos jogadores mesmo quando não estiverem logados, e também evitará que algum report seja perdido caso o jogador saia do servidor.
      A parte do Telegram é apenas um exemplo. Você pode ajustar o script para executar outras ações desejadas.
       
      creatureevent.cpp:
      Dentro deste arquivo, localize a função:
       
      uint32_t CreatureEvent::executeChannelLeave(Player* player, uint16_t channelId, UsersMap usersMap)  
      abaixo dela, adicione:
       
      uint32_t CreatureEvent::executeOpenRuleViolation(Player* player, std::string message) { if (!m_interface->reserveEnv()) { std::clog << "[Error - CreatureEvent::executeOpenRuleViolation] Call stack overflow." << std::endl; return 0; } ScriptEnviroment* env = m_interface->getEnv(); env->setScriptId(m_scriptId, m_interface); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); lua_pushnumber(L, env->addThing(player)); lua_pushstring(L, message.c_str()); bool result = m_interface->callFunction(2); m_interface->releaseEnv(); return result; }  
      Após, procure por:
       
      std::string CreatureEvent::getScriptEventName() const  
      abaixo de:
       
      case CREATURE_EVENT_CHANNEL_LEAVE: return "onLeaveChannel";  
      adicione:
       
      case CREATURE_EVENT_OPEN_RULE_VIOLATION: return "onOpenRuleViolation";  
      Agora, procure por:
       
      std::string CreatureEvent::getScriptEventParams() const  
      abaixo de:
       
      case CREATURE_EVENT_CHANNEL_LEAVE: return "cid, channel, users";  
      adicione:
       
      case CREATURE_EVENT_OPEN_RULE_VIOLATION: return "cid, message";  
      Procure por:
       
      bool CreatureEvent::configureEvent(xmlNodePtr p)  
      abaixo de:
       
      else if(tmpStr == "leavechannel") m_type = CREATURE_EVENT_CHANNEL_LEAVE;  
      adicione:
       
      else if(tmpStr == "openruleviolation") m_type = CREATURE_EVENT_OPEN_RULE_VIOLATION;  
       
      creatureevent.h:
      Dentro deste arquivo, localize:
       
      enum CreatureEventType_t  
      adicione "CREATURE_EVENT_OPEN_RULE_VIOLATION" como o último item de enum CreatureEventType_t
       
      Exemplo:
       
      enum CreatureEventType_t { // ... CREATURE_EVENT_OPEN_RULE_VIOLATION };  
      Agora, procure por:
       
      uint32_t executeChannelLeave(Player* player, uint16_t channelId, UsersMap usersMap);  
      abaixo dela, adicione:
       
      uint32_t executeOpenRuleViolation(Player* player, std::string message);  
      game.cpp:
      Dentro deste arquivo, localize:
       
      bool Game::playerReportRuleViolation(Player* player, const std::string& text)  
      e substitua por:
       
      bool Game::playerReportRuleViolation(Player* player, const std::string& text) { //Do not allow reports on multiclones worlds since reports are name-based if(g_config.getNumber(ConfigManager::ALLOW_CLONES)) { player->sendTextMessage(MSG_INFO_DESCR, "Rule violation reports are disabled."); return false; } cancelRuleViolation(player); boost::shared_ptr<RuleViolation> rvr(new RuleViolation(player, text, time(NULL))); ruleViolations[player->getID()] = rvr; ChatChannel* channel = g_chat.getChannelById(CHANNEL_RVR); if(!channel) return false; for(UsersMap::const_iterator it = channel->getUsers().begin(); it != channel->getUsers().end(); ++it) it->second->sendToChannel(player, SPEAK_RVR_CHANNEL, text, CHANNEL_RVR, rvr->time); CreatureEventList joinEvents = player->getCreatureEvents(CREATURE_EVENT_OPEN_RULE_VIOLATION); for(CreatureEventList::iterator it = joinEvents.begin(); it != joinEvents.end(); ++it) (*it)->executeOpenRuleViolation(player, text); return true; }  
      Agora é só compilar a source.
       
      depois em "data > creaturescripts > creaturescripts.xml", adicione:
       
      <event type="login" name="loginNotifyRuleViolation" script="notifyRuleViolation.lua"/> <event type="openruleviolation" name="openNotifyRuleViolation" script="notifyRuleViolation.lua"/>  
      em "data > creaturescripts > scripts", crie um arquivo notifyRuleViolation.lua e adicione:
       
      function onOpenRuleViolation(cid, message) local config = { token = "", -- Token do seu BOT no Telegram chatId = "" -- ID do chat do Telegram que será enviado a notificação. } local message = "Player: "..getCreatureName(cid).."\n\nReport:\n"..message.."" message = string.gsub(message, "\n", "%%0A") local url = "https://api.telegram.org/bot"..config.token.."/sendMessage" local data = "chat_id="..config.chatId.."&text="..message.."" local curl = io.popen('curl -d "'..data..'" "'..url..'"'):read("*a") return true end function onLogin(cid) registerCreatureEvent(cid, "openNotifyRuleViolation") return true end  
       
      Demonstração:
      1. Jogador abre um novo report (CTRL + R)

      2. notifyRuleViolation.lua, definido em creaturescripts.xml, é acionado para enviar uma notificação ao grupo do Telegram.
       

       
    • Por Jordan422
      Fala comunidade do Tibia King! Eu sei que tem alguém ai escondido que manja muito de modules do Otclient... Se você é essa pessoa, então pode me ajudar e ainda ser pago por isso!
       
      Estou com um projeto de servidor 8.0 já rodando a mais de 2 meses, old school 8.0 com Prey System. Porém essa prey está faltando três funcionalidades do global que são essenciais ( marcado em vermelho na imagem )
       
      Isso ai já tá meio caminho andado, já estou com o código responsável por essas 3 funcionalidades na source e no módulo da prey do meu TFS, só falta passar essas informações para o Otclient.
       
      Ta interessado? Me adiciona no discord: mythh9257
       
       
       
      Nosso projeto: https://tibiaremains.com/
       

    • Por FeeTads
      SALVE rapaziada do TK, esses dias vim pensando em novos scripts pro meu OT, e em um deles eu precisava que determinada area não contasse frag pro player que matasse outros, PORÉM eu precisava que os players que morressem nessa area ainda assim tivessem as penalidades da sua morte, procurei por ai, achei alguns scripts que apenas tiravam o SKULL e não realmente o FRAG do player.

      **script atualizado 22/10/2023** - melhorado e otimizado, levei o script pra puxar as infos por .lua / creatureScripts

      vou disponibilizar o code aqui, e o que fazer pra determinada area não contar frag.

      SOURCE OTX 2 / TFS 0.x, Funciona em TFS 1.x mudando as tags e ajeitando as sintaxes.

      vá em creatureevent.cpp

      procure por:
      else if(type == "preparedeath") _type = CREATURE_EVENT_PREPAREDEATH;
      Adiciona abaixo:
      else if(type == "nocountfrag") _type = CREATURE_EVENT_NOCOUNTFRAG;

      procure por:
      case CREATURE_EVENT_PREPAREDEATH: return "onPrepareDeath";  
      Adicione abaixo: 
      case CREATURE_EVENT_NOCOUNTFRAG: return "noCountFragArea";

      procure por:
      case CREATURE_EVENT_PREPAREDEATH: return "cid, deathList";
      Adicione abaixo:
      case CREATURE_EVENT_NOCOUNTFRAG: return "cid, target";

      agora no mesmo arquivo, vá até o final do arquivo e adicione essa função:
      uint32_t CreatureEvent::executeNoCountFragArea(Creature* creature, Creature* target) { //noCountFragArea(cid, target) if(m_interface->reserveEnv()) { ScriptEnviroment* env = m_interface->getEnv(); if(m_scripted == EVENT_SCRIPT_BUFFER) { env->setRealPos(creature->getPosition()); std::ostringstream scriptstream; scriptstream << "local cid = " << env->addThing(creature) << std::endl; scriptstream << "local target = " << env->addThing(target) << std::endl; if(m_scriptData) scriptstream << *m_scriptData; bool result = true; if(m_interface->loadBuffer(scriptstream.str())) { lua_State* L = m_interface->getState(); result = m_interface->getGlobalBool(L, "_result", true); } m_interface->releaseEnv(); return result; } else { #ifdef __DEBUG_LUASCRIPTS__ std::ostringstream desc; desc << creature->getName(); env->setEvent(desc.str()); #endif env->setScriptId(m_scriptId, m_interface); env->setRealPos(creature->getPosition()); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); lua_pushnumber(L, env->addThing(creature)); lua_pushnumber(L, env->addThing(target)); bool result = m_interface->callFunction(2); m_interface->releaseEnv(); return result; } } else { std::clog << "[Error - CreatureEvent::noCountFragArea] Call stack overflow." << std::endl; return 0; } }

      agora vá em creatureevent.h

      procure por:
      CREATURE_EVENT_PREPAREDEATH
      adicione abaixo:
      CREATURE_EVENT_NOCOUNTFRAG

      procure por:
      uint32_t executePrepareDeath(Creature* creature, DeathList deathList);
      Adicione abaixo:
      uint32_t executeNoCountFragArea(Creature* creature, Creature* target);

      agora vá em player.cpp

      procure por:
      bool Player::onKilledCreature(Creature* target, DeathEntry& entry)
      abaixo de:
      War_t enemy; if(targetPlayer->getEnemy(this, enemy)) { if(entry.isLast()) IOGuild::getInstance()->updateWar(enemy); entry.setWar(enemy); }
      Adicione o seguinte código:
      if (targetPlayer){ CreatureEventList killEvents = getCreatureEvents(CREATURE_EVENT_NOCOUNTFRAG); for (const auto &event : killEvents) { if (!event->executeNoCountFragArea(this, target)) { return true; } } }

      //

      Feito isso, tudo completo na sua source, agora é necessário adicionar o creaturescript dentro do servidor

      vá até creaturescripts/scripts
      crie um arquivo chamado, "noCountFragInArea.lua"
      e dentro dele cole o código:
       
      --[[ script feito por feetads / TibiaKing ]]-- --[[ discord: feetads / FeeTads#0246 ]]-- -- Add positions here for which you do not want to count frags local areas = { [1] = {from = {x = 91, y = 122, z = 7}, to = {x = 98, y = 127, z = 7}}, -- from = area superior esquerda / to = area inferior direita (formando um quadrado) } local onlyKillerInArea = false -- only killer need to be in area? function noCountFragArea(cid, target) if not isCreature(cid) or not isCreature(target) then return true end local posKiller = getPlayerPosition(cid) local posTarget = getPlayerPosition(target) for i = 1, #areas do local area = areas[i] if isInArea(posKiller, area.from, area.to) then if onlyKillerInArea then return false elseif isInArea(posTarget, area.from, area.to) then return false end end end return true end
      agora em creaturescripts.xml
      <event type="nocountfrag" name="fragarea" event="script" value="noCountFragInArea.lua"/>
      agora em creaturescripts/scripts/login.lua
       procure por OU semelhante a esse:
      registerCreatureEvent(cid, "AdvanceSave")
      e abaixo adicione:
      registerCreatureEvent(cid, "fragarea")

      //


      Agora tudo certo, quando quiser adiciona uma area que não pega frag, vá até o script e apenas coloque a area, igual o demonstrado no script

      Exemplo:
      local areas = { [1] = {from = {x = 91, y = 122, z = 7}, to = {x = 98, y = 127, z = 7}}, [2] = {from = {x = 1000, y = 1000, z = 7}, to = {x = 1100, y = 1100, z = 7}}, }
      assim somente colocando a area no script e abrindo o server ou dando /reload, já funcionará a area como não pegar frag.
      Esse sistema pode ser bom pra areas de pvp ativo, onde você ainda quer que o player que morrer perca os atributos, como se fosse uma morte normal, porém não conta frag pra quem matar.
      Bom pra sistemas tipo castle 48h (guild war), onde há diversas mortes e risco de pegar red, atrapalhando a war.

      Façam bom proveito dos scripts, e deixem os créditos no script rsrs

      **Eu fiz as alterações e o simples código por isso vim disponibilizar, créditos meus**
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo