Ir para conteúdo
Propaganda

[HELP] CTRL+D BUGADO


Posts Recomendados

14 horas atrás, Sanzenkai disse:

Poste o pokemon.lua do modulo que esta apresentando o erro para que possam te ajudar.

Spoiler

function init()
  bottomPanel = g_ui.loadUI('pokemon', modules.game_interface.getRootPanel())
  g_keyboard.bindKeyPress("r", function() local player = g_game.getLocalPlayer() if not modules.game_console.consoleToggleChat:isChecked() then return end useSlotItem(8) end)
  g_keyboard.bindKeyPress("1", function() local player = g_game.getLocalPlayer() if not modules.game_console.consoleToggleChat:isChecked() then return end useSlotItem(10) end)
  g_keyboard.bindKeyPress("2", function() local player = g_game.getLocalPlayer() if not modules.game_console.consoleToggleChat:isChecked() then return end useSlotItem(9) end)
  g_keyboard.bindKeyPress("Ctrl+d", function() local player = g_game.getLocalPlayer() if modules.game_console.consoleToggleChat == 1 then return end startChoosePos() end)
  ProtocolGame.registerExtendedOpcode(179, function(protocol, opcode, buffer) startChoosePos() end)
end

function useSlotItem(slot)
  if not g_game.isOnline() then return end
  local item = g_game.getLocalPlayer():getInventoryItem(slot)
  if not item then return end
  if not modules.game_console.consoleToggleChat:isChecked() and not modules.client_options.getOption('forceItemShortcuts') then return end
  if item:isMultiUse() then
      modules.game_interface.startUseWith(item)
  else
      local item = g_game.getLocalPlayer():getInventoryItem(slot)
      if not item then return end
      local player = g_game.getLocalPlayer()
      g_game.useInventoryItem(player:getInventoryItem(slot):getId())
  end
end

function startChoosePos()
  if g_ui.isMouseGrabbed() then return end

  local mouseGrabberWidget = g_ui.createWidget('UIWidget')
  mouseGrabberWidget:setVisible(false)
  mouseGrabberWidget:setFocusable(false)
  mouseGrabberWidget.onMouseRelease = onClickWithMouse

  mouseGrabberWidget:grabMouse()
  g_mouse.pushCursor('target')
end

function onClickWithMouse(self, mousePosition, mouseButton)
  if mouseButton == MouseLeftButton or mouseButton == MouseMidButton then
    local clickedWidget = modules.game_interface.getRootPanel():recursiveGetChildByPos(mousePosition, false)
    if clickedWidget then
      local protocol = g_game.getProtocolGame()
      if clickedWidget:getClassName() == 'UIGameMap' then
        local tile = clickedWidget:getTile(mousePosition)
        local pos = tile:getPosition()
        if tile then
          local thing = tile:getTopMoveThing()
          if thing:isCreature() then
            if protocol then
              protocol:sendExtendedOpcode(53, thing:getId())
            end
            if thing:isLocalPlayer() then
              modules.game_pokedex.show(0)
            elseif thing:isMonster() then
              if string.find(getPokemonNameByOutfit(tile:getTopCreature():getOutfit().type), 'Shiny') then
                modules.game_pokedex.show(getPokemonIdByName(string.lower(string.explode(getPokemonNameByOutfit(tile:getTopCreature():getOutfit().type), 'Shiny ')[2])), true)
              else
                modules.game_pokedex.show(getPokemonIdByName(string.lower(getPokemonNameByOutfit(tile:getTopCreature():getOutfit().type))), false)
              end
              print(tile:getTopCreature():getOutfit().type)
            end
          end
        end
      elseif clickedWidget:getClassName() == 'UICreatureButton' then
        local creature = clickedWidget:getCreature()
        protocol:sendExtendedOpcode(53, creature:getId())
      end
    end
  end
  g_mouse.popCursor('target')
  self:ungrabMouse()
  self:destroy()
  return true
end

 

Link para o comentário
Compartilhar em outros sites

function init()
  bottomPanel = g_ui.loadUI('pokemon', modules.game_interface.getRootPanel())
  
  g_keyboard.bindKeyPress("r", function()
    local player = g_game.getLocalPlayer()
    if not modules.game_console.consoleToggleChat:isChecked() then return end
    useSlotItem(8)
  end)

  g_keyboard.bindKeyPress("1", function()
    local player = g_game.getLocalPlayer()
    if not modules.game_console.consoleToggleChat:isChecked() then return end
    useSlotItem(10)
  end)

  g_keyboard.bindKeyPress("2", function()
    local player = g_game.getLocalPlayer()
    if not modules.game_console.consoleToggleChat:isChecked() then return end
    useSlotItem(9)
  end)

  g_keyboard.bindKeyPress("Ctrl+d", function()
    local player = g_game.getLocalPlayer()
    if modules.game_console.consoleToggleChat:isChecked() then return end
    startChoosePos()
  end)

  ProtocolGame.registerExtendedOpcode(179, function(protocol, opcode, buffer)
    startChoosePos()
  end)
end

function useSlotItem(slot)
  if not g_game.isOnline() then return end

  local player = g_game.getLocalPlayer()
  local item = player:getInventoryItem(slot)

  if not item then return end

  if not modules.game_console.consoleToggleChat:isChecked() and not modules.client_options.getOption('forceItemShortcuts') then
    return
  end

  if item:isMultiUse() then
    modules.game_interface.startUseWith(item)
  else
    g_game.useInventoryItem(item:getId())
  end
end

function startChoosePos()
  if g_ui.isMouseGrabbed() then return end

  local mouseGrabberWidget = g_ui.createWidget('UIWidget')
  mouseGrabberWidget:setVisible(false)
  mouseGrabberWidget:setFocusable(false)
  mouseGrabberWidget.onMouseRelease = onClickWithMouse

  mouseGrabberWidget:grabMouse()
  g_mouse.pushCursor('target')
end

function onClickWithMouse(self, mousePosition, mouseButton)
  if mouseButton == MouseLeftButton or mouseButton == MouseMidButton then
    local clickedWidget = modules.game_interface.getRootPanel():recursiveGetChildByPos(mousePosition, false)
    
    if clickedWidget then
      local protocol = g_game.getProtocolGame()
      
      if clickedWidget:getClassName() == 'UIGameMap' then
        local tile = clickedWidget:getTile(mousePosition)
        
        if tile then
          local thing = tile:getTopMoveThing()
          
          if thing:isCreature() then
            if protocol then
              protocol:sendExtendedOpcode(53, thing:getId())
            end
            
            if thing:isLocalPlayer() then
              modules.game_pokedex.show(0)
            elseif thing:isMonster() then
              local outfitType = tile:getTopCreature():getOutfit().type
              local pokemonName = getPokemonNameByOutfit(outfitType)
              
              if string.find(pokemonName, 'Shiny') then
                local pokemonId = getPokemonIdByName(string.lower(string.explode(pokemonName, 'Shiny ')[2]))
                modules.game_pokedex.show(pokemonId, true)
              else
                local pokemonId = getPokemonIdByName(string.lower(pokemonName))
                modules.game_pokedex.show(pokemonId, false)
              end
              
              print(outfitType)
            end
          end
        end
      elseif clickedWidget:getClassName() == 'UICreatureButton' then
        local creature = clickedWidget:getCreature()
        protocol:sendExtendedOpcode(53, creature:getId())
      end
    end
  end
  
  g_mouse.popCursor('target')
  self:ungrabMouse()
  self:destroy()
  return true
end

 

Link para o comentário
Compartilhar em outros sites

4 horas atrás, Sanzenkai disse:
function init()
  bottomPanel = g_ui.loadUI('pokemon', modules.game_interface.getRootPanel())
  
  g_keyboard.bindKeyPress("r", function()
    local player = g_game.getLocalPlayer()
    if not modules.game_console.consoleToggleChat:isChecked() then return end
    useSlotItem(8)
  end)

  g_keyboard.bindKeyPress("1", function()
    local player = g_game.getLocalPlayer()
    if not modules.game_console.consoleToggleChat:isChecked() then return end
    useSlotItem(10)
  end)

  g_keyboard.bindKeyPress("2", function()
    local player = g_game.getLocalPlayer()
    if not modules.game_console.consoleToggleChat:isChecked() then return end
    useSlotItem(9)
  end)

  g_keyboard.bindKeyPress("Ctrl+d", function()
    local player = g_game.getLocalPlayer()
    if modules.game_console.consoleToggleChat:isChecked() then return end
    startChoosePos()
  end)

  ProtocolGame.registerExtendedOpcode(179, function(protocol, opcode, buffer)
    startChoosePos()
  end)
end

function useSlotItem(slot)
  if not g_game.isOnline() then return end

  local player = g_game.getLocalPlayer()
  local item = player:getInventoryItem(slot)

  if not item then return end

  if not modules.game_console.consoleToggleChat:isChecked() and not modules.client_options.getOption('forceItemShortcuts') then
    return
  end

  if item:isMultiUse() then
    modules.game_interface.startUseWith(item)
  else
    g_game.useInventoryItem(item:getId())
  end
end

function startChoosePos()
  if g_ui.isMouseGrabbed() then return end

  local mouseGrabberWidget = g_ui.createWidget('UIWidget')
  mouseGrabberWidget:setVisible(false)
  mouseGrabberWidget:setFocusable(false)
  mouseGrabberWidget.onMouseRelease = onClickWithMouse

  mouseGrabberWidget:grabMouse()
  g_mouse.pushCursor('target')
end

function onClickWithMouse(self, mousePosition, mouseButton)
  if mouseButton == MouseLeftButton or mouseButton == MouseMidButton then
    local clickedWidget = modules.game_interface.getRootPanel():recursiveGetChildByPos(mousePosition, false)
    
    if clickedWidget then
      local protocol = g_game.getProtocolGame()
      
      if clickedWidget:getClassName() == 'UIGameMap' then
        local tile = clickedWidget:getTile(mousePosition)
        
        if tile then
          local thing = tile:getTopMoveThing()
          
          if thing:isCreature() then
            if protocol then
              protocol:sendExtendedOpcode(53, thing:getId())
            end
            
            if thing:isLocalPlayer() then
              modules.game_pokedex.show(0)
            elseif thing:isMonster() then
              local outfitType = tile:getTopCreature():getOutfit().type
              local pokemonName = getPokemonNameByOutfit(outfitType)
              
              if string.find(pokemonName, 'Shiny') then
                local pokemonId = getPokemonIdByName(string.lower(string.explode(pokemonName, 'Shiny ')[2]))
                modules.game_pokedex.show(pokemonId, true)
              else
                local pokemonId = getPokemonIdByName(string.lower(pokemonName))
                modules.game_pokedex.show(pokemonId, false)
              end
              
              print(outfitType)
            end
          end
        end
      elseif clickedWidget:getClassName() == 'UICreatureButton' then
        local creature = clickedWidget:getCreature()
        protocol:sendExtendedOpcode(53, creature:getId())
      end
    end
  end
  
  g_mouse.popCursor('target')
  self:ungrabMouse()
  self:destroy()
  return true
end

 

 

Obrigado pela ajuda mano, mas continua do mesmo jeito

 

 protected lua call failed: /modules/game_pokemon/pokemon.lua:83: attempt to index field 'game_pokedex' (a nil value)
stack traceback:
    [C]: in function '__index'
    /modules/game_pokemon/pokemon.lua:83: in function </modules/game_pokemon/pokemon.lua:64>
ERROR: protected lua call failed: /modules/game_pokemon/pokemon.lua:93: attempt to index field 'game_pokedex' (a nil value)
stack traceback:

Link para o comentário
Compartilhar em outros sites

Participe da Conversa

Você pode postar agora e se cadastrar mais tarde. Cadastre-se Agora para publicar com Sua Conta.

Visitante
Responder

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

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.

×
  • Criar Novo...