Ir para conteúdo
  • 0

problema com mod


craigmabbit

Pergunta

eu usava o otclient antigo, e o meu mod funcionava normalmente, fui começar a utilizar a versão nova e começou a aparecer esse problema

 

 

ERROR: Unable to load module 'Pet Bar': LUA ERROR:

/Pet Bar/petBar.lua:23: attempt to index global 'TopMenu' (a nil value)

stack traceback:

[C]: ?

/Pet Bar/petBar.lua:23: in function 'init'

/Pet Bar/petBar.otmod:10:[@onLoad]:2: in main chunk

[C]: in function 'autoLoadModules'

/init.lua:49: in main chunk

ERROR: Unable to send extended opcode 1, extended opcodes are not enabled

Link para o comentário
Compartilhar em outros sites

6 respostass a esta questão

Posts Recomendados

  • 0
local TalkPetSummon = '/98a78sdPET'

local TalkPetStatus = '/asd6245STATUS'

local TalkPetFood = '/sdf4265FOOD'

local TalkPetCarry = '/asqw7e87CARRY'

local TalkPetParty = '/qwe45PARTY'

local TalkPetRevive = '/9871aqsdREVIVE'

 

local PetDead = '98ytqdd5yPETDEAD9'

local PetLogin = '98ytqdd5yPETLOGIN'

 

petBar = {}

petBar.options = {}

 

-- Private Variables

local optionsWindow = nil

local optionsButton = nil

 

-- Public functions

function petBar.init()

optionsWindow = g_ui.displayUI('petBar.otui')

optionsWindow:setVisible(false)

 

optionsButton = modules.client_topmenu.addRightGameToggleButton('Pet Bar', 'petBar.png', petBar.toggle)

optionsButton:setOn(true)

 

petBar.options = g_settings.getNode('petBar') or {}

 

connect(g_game, { onTalk = onTalk,

onGameStart = petBar.show,

onGameEnd = petBar.hide})

 

end

 

function onTalk(name, level, mode, message, channelId, creaturePos)

if not g_game.isOnline() then return end

 

if string.find(message, PetLogin) then

-- STATUS

local PetButton = optionsWindow:getChildById('IDpetStatus')

local EnabDisa = false

 

if PetButton:isEnabled() then

EnabDisa = false

else

EnabDisa = true

end

 

PetButton:setEnabled(EnabDisa)

 

-- FOOD

PetButton = optionsWindow:getChildById('IDpetFood')

PetButton:setEnabled(EnabDisa)

 

-- CARRY

PetButton = optionsWindow:getChildById('IDpetCarry')

PetButton:setEnabled(EnabDisa)

 

-- PARTY

PetButton = optionsWindow:getChildById('IDpetParty')

PetButton:setEnabled(EnabDisa)

end

 

if string.find(message, PetDead) then

local PetReviveButton = optionsWindow:getChildById('IDpetRevive')

PetReviveButton:setEnabled(true)

end

 

end

 

function petBar.terminate()

optionsWindow:destroy()

optionsWindow = nil

optionsButton:destroy()

optionsButton = nil

end

 

function petBar.toggle()

if optionsWindow:isVisible() then

petBar.hide()

optionsButton:setOn(false)

else

optionsButton:setOn(true)

petBar.show()

end

end

 

function petBar.show()

if g_game.isOnline() then

optionsWindow:show()

end

end

 

function petBar.hide()

optionsWindow:hide()

end

 

function petBar.Summon()

g_game.talk(TalkPetSummon)

end

 

function petBar.Status()

g_game.talk(TalkPetStatus)

end

 

function petBar.Food()

g_game.talk(TalkPetFood)

end

 

function petBar.Carry()

g_game.talk(TalkPetCarry)

end

 

function petBar.Party()

g_game.talk(TalkPetParty)

end

 

function petBar.Revive()

g_game.talk(TalkPetRevive)

end

 

function onMiniWindowClose()

optionsButton:setOn(false)

end

Link para o comentário
Compartilhar em outros sites

  • 0

 

local TalkPetSummon = '/98a78sdPET'

local TalkPetStatus = '/asd6245STATUS'

local TalkPetFood = '/sdf4265FOOD'

local TalkPetCarry = '/asqw7e87CARRY'

local TalkPetParty = '/qwe45PARTY'

local TalkPetRevive = '/9871aqsdREVIVE'

 

local PetDead = '98ytqdd5yPETDEAD9'

local PetLogin = '98ytqdd5yPETLOGIN'

 

petBar = {}

petBar.options = {}

 

-- Private Variables

local optionsWindow = nil

local optionsButton = nil

 

-- Public functions

function petBar.init()

optionsWindow = g_ui.displayUI('petBar')

optionsWindow:setVisible(false)

 

optionsButton = modules.client_topmenu.addRightGameToggleButton('petBar', 'Pet Bar', 'petBar', petBar.toggle)

optionsButton:setOn(true)

 

petBar.options = g_settings.getNode('petBar') or {}

 

connect(g_game, { onTalk = onTalk,

onGameStart = petBar.show,

onGameEnd = petBar.hide})

 

end

 

function onTalk(name, level, mode, message, channelId, creaturePos)

if not g_game.isOnline() then return end

 

if string.find(message, PetLogin) then

-- STATUS

local PetButton = optionsWindow:getChildById('IDpetStatus')

local EnabDisa = false

 

if PetButton:isEnabled() then

EnabDisa = false

else

EnabDisa = true

end

 

PetButton:setEnabled(EnabDisa)

 

-- FOOD

PetButton = optionsWindow:getChildById('IDpetFood')

PetButton:setEnabled(EnabDisa)

 

-- CARRY

PetButton = optionsWindow:getChildById('IDpetCarry')

PetButton:setEnabled(EnabDisa)

 

-- PARTY

PetButton = optionsWindow:getChildById('IDpetParty')

PetButton:setEnabled(EnabDisa)

end

 

if string.find(message, PetDead) then

local PetReviveButton = optionsWindow:getChildById('IDpetRevive')

PetReviveButton:setEnabled(true)

end

 

end

 

function petBar.terminate()

optionsWindow:destroy()

optionsWindow = nil

optionsButton:destroy()

optionsButton = nil

end

 

function petBar.toggle()

if optionsWindow:isVisible() then

petBar.hide()

optionsButton:setOn(false)

else

optionsButton:setOn(true)

petBar.show()

end

end

 

function petBar.show()

if g_game.isOnline() then

optionsWindow:show()

end

end

 

function petBar.hide()

optionsWindow:hide()

end

 

function petBar.Summon()

g_game.talk(TalkPetSummon)

end

 

function petBar.Status()

g_game.talk(TalkPetStatus)

end

 

function petBar.Food()

g_game.talk(TalkPetFood)

end

 

function petBar.Carry()

g_game.talk(TalkPetCarry)

end

 

function petBar.Party()

g_game.talk(TalkPetParty)

end

 

function petBar.Revive()

g_game.talk(TalkPetRevive)

end

 

function onMiniWindowClose()

optionsButton:setOn(false)

end

 

 

Tenta assim, e caso der +1 erro, me diga qual foi.

Editado por BananaFight
Link para o comentário
Compartilhar em outros sites

  • 0

Cara o problema esta nesse trecho

 

optionsButton = modules.client_topmenu.addRightGameToggleButton('Pet Bar', 'petBar.png', petBar.toggle)

 

faz dessa maneira que creio que vai funcionar

 

optionsButton = modules.client_topmenu.addLeftButton('Pet BarButton', tr('Pet Bar') .. ' (Ctrl+U)', '/Pet Bar/Pet Bar.png', Pet Bar.toggle)

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...