é que com as atualizações acorreram mudanças nas estruturas dos códigos, poste seu mod aqui que eu posso atualizar ele para você.
info
Grupo: Conde
Registrado: 14/02/13
Posts: 702
Reputação: +196
Gênero: Masculino

info
Grupo: Barão
Registrado: 05/10/12
Posts: 245
Reputação: +36

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
info
Grupo: Conde
Registrado: 14/02/13
Posts: 702
Reputação: +196
Gênero: Masculino

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 Maio 24 por BananaFight
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)
info
Grupo: Barão
Registrado: 05/10/12
Posts: 245
Reputação: +36

resolvido, o erro era no "optionsButton"




info
Grupo: Barão
Registrado: 05/10/12
Posts: 245
Reputação: +36
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