Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Boa novas a todos

 

Estou precisando muito de uma mãozinha como Remover a imagem de fundo de um modulo que estou editando já fiz de tudo mais não consegui fazer isso

então vim aqui tenta acha alguma ajuda entre os menbros mais experiencte pois ainda sou novato em OTClient faz poucos dias que comecei a mexe tentei

todo fórum mais não encontrei nada parecido vamos la:

 

Imagem da Module a ser removida, module padrão que vem em todo os module usando MiniWindow

17dzk0.png

 

Module que estou criando, não consegui remover a imagem do module do fundo

2whgyma.png

 

usei como base da edição o Module game_skills, codigo do module:

 

Skills.lua

Spoiler

skillsWindow = nil
skillsButton = nil
local healthBar = nil
local pbs = {}

function init()
  connect(LocalPlayer, {
    onExperienceChange = onExperienceChange,
    onLevelChange = onLevelChange,
    onHealthChange = onHealthChange,
  })
  connect(g_game, {
    onGameStart = refresh,
    onGameEnd = offline
  })
  connect(g_game, 'onTextMessage', getSex)

  skillsButton = modules.client_topmenu.addRightGameToggleButton('skillsButton', tr('Skills') .. ' (Ctrl+S)', '/images/topbuttons/skills', toggle)
  skillsButton:setOn(true)
  skillsWindow = g_ui.loadUI('skills', modules.game_interface.getRightPanel())
  skillsWindow:disableResize()
  healthBar = skillsWindow:recursiveGetChildById("healthBar")

  g_keyboard.bindKeyDown('Ctrl+S', toggle)
  refresh()
  skillsWindow:setup()
end

function terminate()
  disconnect(LocalPlayer, {
    onExperienceChange = onExperienceChange,
    onLevelChange = onLevelChange,
    onHealthChange = onHealthChange,
  })
  disconnect(g_game, {
    onGameStart = refresh,
    onGameEnd = offline
  })
  disconnect(g_game, 'onTextMessage', getSex)

  g_keyboard.unbindKeyDown('Ctrl+S')
  skillsWindow:destroy()
  skillsButton:destroy()
end

function expForLevel(level)
  return math.floor((50*level*level*level)/3 - 100*level*level + (850*level)/3 - 200)
end

function expToAdvance(currentLevel, currentExp)
  return expForLevel(currentLevel+1) - currentExp
end

function resetSkillColor(id)
  local skill = skillsWindow:recursiveGetChildById(id)
  local widget = skill:getChildById('value')
  widget:setColor('#bbbbbb')
end

function setSkillBase(id, value, baseValue)
  if baseValue <= 0 or value < 0 then
    return
  end
  local skill = skillsWindow:recursiveGetChildById(id)
  local widget = skill:getChildById('value')

  if value > baseValue then
    widget:setColor('#008b00') -- green
    skill:setTooltip(baseValue .. ' +' .. (value - baseValue))
  elseif value < baseValue then
    widget:setColor('#b22222') -- red
    skill:setTooltip(baseValue .. ' ' .. (value - baseValue))
  else
    widget:setColor('#bbbbbb') -- default
    skill:removeTooltip()
  end
end

function setSkillValue(id, value)
  local skill = skillsWindow:recursiveGetChildById(id)
  local widget = skill:getChildById('value')
  widget:setText(value)
end

function setSkillColor(id, value)
  local skill = skillsWindow:recursiveGetChildById(id)
  local widget = skill:getChildById('value')
  widget:setColor(value)
end

function setSkillTooltip(id, value)
  local skill = skillsWindow:recursiveGetChildById(id)
  local widget = skill:getChildById('value')
  widget:setTooltip(value)
end

function setSkillPercent(id, percent, tooltip)
  local skill = skillsWindow:recursiveGetChildById(id)
  local widget = skill:getChildById('percent')
  widget:setPercent(math.floor(percent))

  if tooltip then
    widget:setTooltip(tooltip)
  end
end

function checkAlert(id, value, maxValue, threshold, greaterThan)
  if greaterThan == nil then greaterThan = false end
  local alert = false

  -- maxValue can be set to false to check value and threshold
  -- used for regeneration checking
  if type(maxValue) == 'boolean' then
    if maxValue then
      return
    end

    if greaterThan then
      if value > threshold then
        alert = true
      end
    else
      if value < threshold then
        alert = true
      end
    end
  elseif type(maxValue) == 'number' then
    if maxValue < 0 then
      return
    end

    local percent = math.floor((value / maxValue) * 100)
    if greaterThan then
      if percent > threshold then
        alert = true
      end
    else
      if percent < threshold then
        alert = true
      end
    end
  end

  if alert then
    setSkillColor(id, '#b22222') -- red
  else
    resetSkillColor(id)
  end
end

function update()
end

function refresh()
  local player = g_game.getLocalPlayer()
  if not player then return end

  if expSpeedEvent then expSpeedEvent:cancel() end
  expSpeedEvent = cycleEvent(checkExpSpeed, 30*1000)
  
  onExperienceChange(player, player:getExperience())
  onLevelChange(player, player:getLevel(), player:getLevelPercent())
  onHealthChange(player, player:getHealth(), player:getMaxHealth())

  update()

  local contentsPanel = skillsWindow:getChildById('contentsPanel')
  skillsWindow:setContentMinimumHeight(44)
  skillsWindow:setContentMaximumHeight(390)
end

function offline()
  if expSpeedEvent then expSpeedEvent:cancel() expSpeedEvent = nil end
end

function toggle()
  if skillsButton:isOn() then
    skillsWindow:close()
    skillsButton:setOn(false)
  else
    skillsWindow:open()
    skillsButton:setOn(true)
  end
end

function checkExpSpeed()
  local player = g_game.getLocalPlayer()
  if not player then return end

  local currentExp = player:getExperience()
  local currentTime = g_clock.seconds()
  if player.lastExps ~= nil then
    player.expSpeed = (currentExp - player.lastExps[1][1])/(currentTime - player.lastExps[1][2])
    onLevelChange(player, player:getLevel(), player:getLevelPercent())
  else
    player.lastExps = {}
  end
  table.insert(player.lastExps, {currentExp, currentTime})
  if #player.lastExps > 30 then
    table.remove(player.lastExps, 1)
  end
end

function onMiniWindowClose()
  skillsButton:setOn(false)
end

function onSkillButtonClick(button)
  local percentBar = button:getChildById('percent')
  if percentBar then
    percentBar:setVisible(not percentBar:isVisible())
    if percentBar:isVisible() then
      button:setHeight(21)
    else
      button:setHeight(21 - 6)
    end
  end
end

function onExperienceChange(localPlayer, value)
  setSkillValue('experience', localPlayer:getName())
  setSkillValue('level', value)
end

function onLevelChange(localPlayer, value, percent)
  setSkillValue('level', value)
  local text = tr('You have %s percent to go', 100 - percent) .. '\n' ..
               tr('%s of experience left', expToAdvance(localPlayer:getLevel(), localPlayer:getExperience()))

  if localPlayer.expSpeed ~= nil then
     local expPerHour = math.floor(localPlayer.expSpeed * 3600)
     if expPerHour > 0 then
        local nextLevelExp = expForLevel(localPlayer:getLevel()+1)
        local hoursLeft = (nextLevelExp - localPlayer:getExperience()) / expPerHour
        local minutesLeft = math.floor((hoursLeft - math.floor(hoursLeft))*60)
        hoursLeft = math.floor(hoursLeft)
        text = text .. '\n' .. tr('%d of experience per hour', expPerHour)
        text = text .. '\n' .. tr('Next level in %d hours and %d minutes', hoursLeft, minutesLeft)
     end
  end
    local ExpTo = skillsWindow:recursiveGetChildById("playericon")
    ExpTo:setTooltip(text)
--  setSkillPercent('level', percent, text)
end

function onHealthChange(localPlayer, health, maxHealth)
  setSkillValue('health', health)
  checkAlert('health', health, maxHealth, 30)
  healthBar:setText(health .. ' / ' .. maxHealth)
  skillsWindow:recursiveGetChildById("healthIcon"):setTooltip(healthTooltip, health, maxHealth)
  healthBar:setValue(health, 0, maxHealth)
end

 

skills.otui

Spoiler

SkillFirstWidget < UIWidget

SkillButton < UIButton
  height: 21
  margin-bottom: 9
  &onClick: onSkillButtonClick

SkillNameLabel < GameLabel
  font: verdana-11px-monochrome
  anchors.left: parent.left
  anchors.top: parent.top
  anchors.bottom: parent.bottom

SkillValueLabel < GameLabel
  id: value
  font: verdana-11px-monochrome
  text-align: topright
  color: #00FF00
  anchors.right: parent.right
  anchors.top: parent.top
  anchors.bottom: parent.bottom
  anchors.left: prev.left

SkillPercentPanel < ProgressBar
  id: percent
  background-color: green
  height: 16
  margin-top: 15
  anchors.left: parent.left
  anchors.right: parent.right
  anchors.top: parent.top
  phantom: false

HealthBar < ProgressBar
  id: healthBar
  width: 218
  height: 15
  !text: '0 / 0'
  font: verdana-11px-rounded
  color: #FFFFFF
  background-color: #00FF00  
  anchors.top: parent.top
  anchors.right: parent.right
  margin-top: 135
  margin-right: 30
  opacity: 0.9

HealthIcon < UIButton
  id: healthIcon
  width: 322
  height: 97
  image-source: img/barra2.png
  image-color: white
  focusable: false
  anchors.top: parent.top
  anchors.right: parent.right
  margin-top: 84
  margin-right: 10

PlayerIcon < UIButton
  id: playericon
  image-source: img/barra3.png
  size: 300 190
  anchors.top: parent.top
  anchors.horizontalCenter: parent.horizontalCenter
  margin-top: 50
  margin-left: -20

pbButtonIni < UIButton
  id: playericon
  image-source: img/pb_apagada
  size: 10 9
  anchors.top: parent.top
  anchors.left: parent.left
  margin-top: 53
  margin-left: 15

pbButton < pbButtonIni
  anchors.left: prev.right
  margin-left: 2

MiniWindow
  id: skillWindow
  !text: tr('')
  width: 350
  @onClose: modules.game_skills.onMiniWindowClose()
  &save: true

  HealthBar
  HealthIcon
  PlayerIcon

  MiniWindowContents
    padding-left: 240
    padding-right: 30
    layout: verticalBox

    SkillButton
      margin-top: 140
      id: level
      height: 15
      SkillNameLabel
        !text: tr('Level')
        color: #00FF00
      SkillValueLabel

    SkillButton
      margin-top: -67
      id: experience
      margin-left: 60
        !text: tr('')
        color: #00BFFF
      SkillValueLabel
      SkillPercentPanel
        visible: false

    SkillButton
      id: health
      height: 15
      SkillNameLabel
        !text: tr('Vida')
        color: #00FF00
      SkillValueLabel
        color: #00FF00
      SkillPercentPanel
      visible: false

 

skills.otmod

Spoiler

Module
  name: game_skills
  description: Manage skills window
  author: baxnie, edubart
  website: www.otclient.info
  sandboxed: true
  scripts: [ skills ]
  @onLoad: init()
  @onUnload: terminate()
  dependencies:
    - game_interface
 

 

Ta ai desde ja gostaria de agradecer a atenção de todos

Estou ancioso pra aprende muito sobre OTClient

Editado por nibelins (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Grande Nibelins o mito dos modern acc, cara não faço a minima ideia acho q é aqui 

function getSex(mode, text)
   if not g_game.isOnline() then return end
   if mode == MessageModes.Failure then
      if text:find("#sex#") then
         local t = string.explode(text, ",")
         local ftplayer = t[2]
         playerft = skillsWindow:recursiveGetChildById('playericon')
            playerft:setImageSource('img/'..ftplayer..'.png')
         end
      end
   end

 

Link para o post
Compartilhar em outros sites

só mito não kkkkkkkkk gostava de editar modern acc

 

esse parte do código que você colocou e uma função não necessária, no código ela verifica a sexo do player pra manda imagem

mesmo assim obrigado 

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 maikon1993
      Fala galerinha de boas ?
       
      Preciso de ajuda, preciso de um macro para otcV8, que faça um item dar use no outro.
      Exemplo: Tem um item no servidor "spellswand" e ela é usada para vender item, dando "use" nela e no item que quer vender, queria deixar isso automático, se alguém poder me ajudar agradeço.
    • Por AddroJhonny
      Andei buscando de tudo que é forma para que o minimap fique com a imagem já liberada, assim como é no PxG. Porém, não encontrei em nenhum lugar alguma instrução. Comecei a mexer no arquivo minimap.lua e consegui avançar em algo.
       
      Meu script ficou assim:
      function updateCameraPosition() local player = g_game.getLocalPlayer() if not player then return end local pos = player:getPosition() if not pos then return end if not minimapWidget:recursiveGetChildById('posLabel') then local minimap = g_ui.createWidget('Minimap', minimapWidget) minimapWidget:setImageSource('/mapa/pisos/piso1') minimapWidget:setId('posLabel') minimapWidget:setOpacity(0.3) minimapWidget:centerInPosition(map, {x = 1015, y=1012, z=7}) end if not minimapWidget:isDragging() then if not fullmapView then minimapWidget:setCameraPosition(player:getPosition()) end minimapWidget:setCrossPosition(player:getPosition()) end minimapPos = minimapWindow:recursiveGetChildById('posLabel') minimapPos:setText('X:'..pos.x..' Y:'..pos.y..' Z:'..pos.z) if minimapWidget:getCameraPosition().z ~= 7 then local minimap = minimapWidget:recursiveGetChildById('posLabel') minimap:setVisible(false) minimapWidget:setColor('black') end end  
      Agora a imagem realmente está aparecendo no minimap com transparência... e quase perfeito. Mas ainda falta conseguir fazer ela acompanhar a posição do player no lugar de ficar aberto por inteiro.
       
      Segue como ficou:
       

       
      Alguém consegue ajudar a melhor maneira de fazer isso? Ou se fiz errado também...
       
      Ty.
    • Por brunei
      Olá galera bom dia , boa tarde e boa noite a todos !
      venho trazer meu primeiro projeto para contribuir com o TK , se trata de um modulo bastante util 
      como é minha primeira vez trazendo algo aqui , talvez eu esqueça de algo , sem enrolação vamos la.

      o modulo é um Shiny Ditto Memory para PDA ,o melhor é que nao precisa de source e é bem simples de instalar !

      1° ponto - Adicionar o memory sistem por TalkAction do @zipter98 (fiz algumas correçoes e melhorias no script para funcionar de uma melhor forma com o modulo)

      em Talkactions.xml adicione a tag :  <talkaction words="/memory;!memory" event="script" value="sdittomemory.lua"/>
       
      2° - Em talkaction/script ,crie um arquivo sdittomemory.lua e cole esse script : 
       
      em : local cd = 2 (em segundos) mude para o numero que desejar como cooldown para efetuar a troca .
      Para efetuar a troca o pokemon precisa esta com os Moves 100% ,caso contrario ira mandar uma mensagem de bloqueio.
       

      3° - em somefunctions.lua adicione essas funçoes !

       
      tem umas correções q eu mesmo fiz no ditto system e shiny ditto system ,e é necessario pro modulo funcionar 100% .

      4° - extraia e adicione o arquivo na pasta Modulos do seu OTClient !

      pronto , com isso vai funcionar o modulo 
       

       
      1 - no icone salvar , vc consegue salvar o pokemon que o ditto esta transformado em cada slot (pokebola) e reverter o ditto.
      2 - no icone check , vc consegue remover uma memoria ou checar quais memorias o seu ditto esta usando.
      3 - e no icone transformar vc transforma em cada memoria salva no s.ditto e tbm consegue reverter para virar um pokemon novo sem usar a memori etc..

      entao é isso galera , espero que seja util .

      CREDITOS :
      @zipter98 
      @usoparagames Eu
      game_memory.rar
    • Por Gryffindori
      Já procurei à fundo mas não achei nada resolvido sobre isso, sempre que vou compilar acaba dando o erro. Alguém tem alguma solução?
       
      Problema - > . C2139 'OTMLNode': an undefined class is not allowed as an argument to compiler intrinsic type trait '__is_convertible_to' (compiling source file ..\src\client\localplayer.cpp) type_traits 325
       

    • Por JulianoZN
      Mobile Modificado sem arquivos data/modules etc
      >> o mesmo ja conta com o sistema de rotação de tela
      scan// https://www.virustotal.com/gui/file/596ea29e221af84af5771c94b6160531f681975f8727410060e2d474cd0ab679/detection

      --> Com extensão de tela sem bordas preta requer extensão de tela para mobile
      > http:// https://www.mediafire.com/file/jumo15q39gc9n4d/liberado+extendido.apk/file

      29/2 > 14
      17/2 > 8
       
      Possui cor nos nome procurando as tag \/ no nick do player
      0 [ADM], [GOD], [GM], [CM], [Tutor], [Help], [YT], [Youtuber]
       
      Cor nos nome dos monstro que possuir genero

      Male > Azul 
      Female > Rosa
      Indefinido > Amarelo

      --> Sem Extenção de tela Bordas Preta
      > https://www.mediafire.com/file/fnzhwciwws1om26/liberado.apk/file

      padrao do tibia 
      8
      6
       
      Possui cor nos nome procurando as tag \/ no nick do player
      0 [ADM], [GOD], [GM], [CM], [Tutor], [Help], [YT], [Youtuber]
       
      Cor nos nome dos monstro que possuir genero
      Male > Azul 
      Female > Rosa
      Indefinido > Amarelo
       

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo