• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Request script for pokemon

adrianokk

New Member
Joined
Jan 22, 2019
Messages
43
Reaction score
1
I'd like to put a pokedex similar to this, on my server.
Could someone help me find one. or do?

49721791_2009860082645754_3533288875080286208_n.png
 
Yes, I know it's a Otclient module. I managed to get a similar one, but I can not activate it inside my client.
Lua:
local DexWindow = nil

function init()
  connect(g_game, { onGameEnd = onGameEnd })
  DexWindow = g_ui.displayUI('dex')
  DexWindow:hide()
  ProtocolGame.registerExtendedOpcode(27, pokemon)
end

function terminate()
  disconnect(g_game, { onGameEnd = onGameEnd })
  DexWindow:destroy()
  ProtocolGame.unregisterExtendedOpcode(27)
end

function onGameEnd()
  if DexWindow:isVisible() then
     DexWindow:hide()
     terminate()
    end
end

function show()
  DexWindow:show()
  DexWindow:raise()
  addEvent(function() g_effects.fadeIn(DexWindow, 250) end)
end

function sendRequestShow(op)
   g_game.getProtocolGame():sendExtendedOpcode(27, op)
end

function hide()
  addEvent(function() g_effects.fadeOut(DexWindow, 250) end)
  scheduleEvent(function() DexWindow:hide() end, 250)
end

local function clickOptionButton(option)
  g_game.talk(option)
end

function pokemon(protocol, opcode, buffer)
  local param = buffer:split('@')
  local eventAnimation = nil

  show()
  DexWindow:getChildById('img'):setImageSource("/images/game/pokedex/"..param[1]..".png")
  DexWindow:getChildById('name'):setText(param[1])
  DexWindow:getChildById('level'):setText(param[2])
  DexWindow:getChildById('wildlevel'):setText(param[3])
  DexWindow:getChildById('tipo'):setImageSource("/images/game/pokedex/elements/"..param[4]..".png")
  DexWindow:getChildById('tipo1'):setImageSource("/images/game/pokedex/elements/"..param[5]..".png")
  DexWindow:getChildById('habilidades2'):setImageSource("/images/game/pokedex/abilitys/"..param[6]..".png")
  DexWindow:getChildById('name2'):setText("Nome: ")
  DexWindow:getChildById('level2'):setText("Level: ")
  DexWindow:getChildById('wildlevel2'):setText("WildLevel: ")
  DexWindow:getChildById('tipo2'):setText("Tipo: ")
  DexWindow:getChildById('habilidades'):setText("Ability: ")
  DexWindow:getChildById('name'):setColor("white")
  DexWindow:getChildById('level'):setColor("white")
  DexWindow:getChildById('wildlevel'):setColor("white")
  DexWindow:getChildById('name2'):setColor("white")
  DexWindow:getChildById('level2'):setColor("white")
  DexWindow:getChildById('wildlevel2'):setColor("white")
  DexWindow:getChildById('tipo2'):setColor("white")
  DexWindow:getChildById('habilidades'):setColor("white")

  if param[7] == "evolutions" then
  DexWindow:getChildById('evolution'):setText(param[8])
  DexWindow:getChildById('portrait'):setItemId(tonumber(param[9]))
  DexWindow:getChildById('evolution'):setColor("white")
  DexWindow:getChildById('portrait'):setVisible(true)
  DexWindow:getChildById('evolution'):setVisible(true)
  DexWindow:getChildById('move1'):setVisible(false)
  DexWindow:getChildById('move2'):setVisible(false)
  DexWindow:getChildById('move3'):setVisible(false)
  DexWindow:getChildById('move4'):setVisible(false)
  DexWindow:getChildById('move5'):setVisible(false)
  DexWindow:getChildById('move6'):setVisible(false)
  DexWindow:getChildById('move7'):setVisible(false)
  DexWindow:getChildById('move8'):setVisible(false)
  DexWindow:getChildById('move9'):setVisible(false)
  DexWindow:getChildById('move10'):setVisible(false)
  DexWindow:getChildById('move11'):setVisible(false)
  DexWindow:getChildById('move12'):setVisible(false)
  DexWindow:getChildById('move1label'):setVisible(false)
  DexWindow:getChildById('move2label'):setVisible(false)
  DexWindow:getChildById('move3label'):setVisible(false)
  DexWindow:getChildById('move4label'):setVisible(false)
  DexWindow:getChildById('move5label'):setVisible(false)
  DexWindow:getChildById('move6label'):setVisible(false)
  DexWindow:getChildById('move7label'):setVisible(false)
  DexWindow:getChildById('move8label'):setVisible(false)
  DexWindow:getChildById('move9label'):setVisible(false)
  DexWindow:getChildById('move10label'):setVisible(false)
  DexWindow:getChildById('move11label'):setVisible(false)
  DexWindow:getChildById('move12label'):setVisible(false)
  end

  if param[7] == "moves" then
  DexWindow:getChildById('evolution'):setVisible(false)
  DexWindow:getChildById('portrait'):setVisible(false)
  DexWindow:getChildById('move1'):setImageSource("/images/game/pokedex/moves_icon/"..param[10].."_on.png")
  DexWindow:getChildById('move2'):setImageSource("/images/game/pokedex/moves_icon/"..param[11].."_on.png")
  DexWindow:getChildById('move3'):setImageSource("/images/game/pokedex/moves_icon/"..param[12].."_on.png")
  DexWindow:getChildById('move4'):setImageSource("/images/game/pokedex/moves_icon/"..param[13].."_on.png")
  DexWindow:getChildById('move5'):setImageSource("/images/game/pokedex/moves_icon/"..param[14].."_on.png")
  DexWindow:getChildById('move6'):setImageSource("/images/game/pokedex/moves_icon/"..param[15].."_on.png")
  DexWindow:getChildById('move7'):setImageSource("/images/game/pokedex/moves_icon/"..param[16].."_on.png")
  DexWindow:getChildById('move8'):setImageSource("/images/game/pokedex/moves_icon/"..param[17].."_on.png")
  DexWindow:getChildById('move9'):setImageSource("/images/game/pokedex/moves_icon/"..param[18].."_on.png")
  DexWindow:getChildById('move10'):setImageSource("/images/game/pokedex/moves_icon/"..param[19].."_on.png")
  DexWindow:getChildById('move11'):setImageSource("/images/game/pokedex/moves_icon/"..param[20].."_on.png")
  DexWindow:getChildById('move12'):setImageSource("/images/game/pokedex/moves_icon/"..param[21].."_on.png")
  DexWindow:getChildById('move1'):setVisible(true)
  DexWindow:getChildById('move2'):setVisible(true)
  DexWindow:getChildById('move3'):setVisible(true)
  DexWindow:getChildById('move4'):setVisible(true)
  DexWindow:getChildById('move5'):setVisible(true)
  DexWindow:getChildById('move6'):setVisible(true)
  DexWindow:getChildById('move7'):setVisible(true)
  DexWindow:getChildById('move8'):setVisible(true)
  DexWindow:getChildById('move9'):setVisible(true)
  DexWindow:getChildById('move10'):setVisible(true)
  DexWindow:getChildById('move11'):setVisible(true)
  DexWindow:getChildById('move12'):setVisible(true)
  DexWindow:getChildById('move1label'):setText(param[10])
  DexWindow:getChildById('move2label'):setText(param[11])
  DexWindow:getChildById('move3label'):setText(param[12])
  DexWindow:getChildById('move4label'):setText(param[13])
  DexWindow:getChildById('move5label'):setText(param[14])
  DexWindow:getChildById('move6label'):setText(param[15])
  DexWindow:getChildById('move7label'):setText(param[16])
  DexWindow:getChildById('move8label'):setText(param[17])
  DexWindow:getChildById('move9label'):setText(param[18])
  DexWindow:getChildById('move10label'):setText(param[19])
  DexWindow:getChildById('move11label'):setText(param[20])
  DexWindow:getChildById('move12label'):setText(param[21])
  DexWindow:getChildById('move1label'):setVisible(true)
  DexWindow:getChildById('move2label'):setVisible(true)
  DexWindow:getChildById('move3label'):setVisible(true)
  DexWindow:getChildById('move4label'):setVisible(true)
  DexWindow:getChildById('move5label'):setVisible(true)
  DexWindow:getChildById('move6label'):setVisible(true)
  DexWindow:getChildById('move7label'):setVisible(true)
  DexWindow:getChildById('move8label'):setVisible(true)
  DexWindow:getChildById('move9label'):setVisible(true)
  DexWindow:getChildById('move10label'):setVisible(true)
  DexWindow:getChildById('move11label'):setVisible(true)
  DexWindow:getChildById('move12label'):setVisible(true)
  DexWindow:getChildById('move1label'):setColor("white")
  DexWindow:getChildById('move2label'):setColor("white")
  DexWindow:getChildById('move3label'):setColor("white")
  DexWindow:getChildById('move4label'):setColor("white")
  DexWindow:getChildById('move5label'):setColor("white")
  DexWindow:getChildById('move6label'):setColor("white")
  DexWindow:getChildById('move7label'):setColor("white")
  DexWindow:getChildById('move8label'):setColor("white")
  DexWindow:getChildById('move9label'):setColor("white")
  DexWindow:getChildById('move10label'):setColor("white")
  DexWindow:getChildById('move11label'):setColor("white")
  DexWindow:getChildById('move12label'):setColor("white")
  end

end
Code:
MainWindow
  id: placa
  size:690 430
  &save: true
  image-source: img/pokedex_window
  opacity: 40
  focusable: true

  UIButton
    id: closeButton
    anchors.top: parent.top
    anchors.right: parent.right
    size: 23 22
    image-source: /images/game/shop/button
    image-clip: 0 0 23 22
    @onClick: hide()

    $hover:
      image-clip: 0 22 23 22

    $pressed:
      image-clip: 0 44 23 22

  UIButton
    id: moves
    anchors.top: parent.top
    anchors.left: parent.left
    size: 118 46
    margin-left: 60
    margin-top: 200
    image-source: img/moves
    image-clip: 0 0 118 46
    @onClick: modules.game_dex.sendRequestShow(1)

    $hover:
      image-clip: 0 46 118 46

    $pressed:
      image-clip: 0 92 118 46

  UIButton
    id: evo
    anchors.top: parent.top
    anchors.left: parent.left
    size: 118 46
    margin-left: 60
    margin-top: 245
    image-source: img/evo
    image-clip: 0 0 118 46
    @onClick: modules.game_dex.sendRequestShow(2)

    $hover:
      image-clip: 0 46 118 46

    $pressed:
      image-clip: 0 92 118 46

  UIImageView
    id: img
    anchors.left: parent.left
    anchors.top: parent.top
    margin-left: 60
    margin-top: 5
    size: 214 165

  Label
    id: name
    size:300 300
    text-align: Left
    font: sans-bold-16px-rounded
    anchors.top: name2.top
    anchors.left: name2.left
    margin-top:0
    margin-left:180

  Label
    id: level
    size:300 300
    text-align: Left
    font: sans-bold-16px-rounded
    anchors.top: level2.top
    anchors.left: level2.left
    margin-top:0
    margin-left:180

  Label
    id: wildlevel
    size:300 300
    text-align: Left
    font: sans-bold-16px-rounded
    anchors.top: wildlevel2.top
    anchors.left: wildlevel2.left
    margin-top:0
    margin-left:200

  UIImageView
    id: tipo
    anchors.top: tipo2.top
    anchors.left: tipo2.left
    margin-top:141
    margin-left:178
    size: 20 20

  UIImageView
    id: tipo1
    anchors.top: tipo2.top
    anchors.left: tipo2.left
    margin-top:141
    margin-left:208
    size: 20 20

  Label
    id: name2
    size:300 300
    text-align: center
    font: sans-bold-16px-rounded
    anchors.top: parent.top
    anchors.left: parent.left
    margin-top:-130
    margin-left:243

  Label
    id: level2
    size:300 300
    text-align: center
    font: sans-bold-16px-rounded
    anchors.top: parent.top
    anchors.left: parent.left
    margin-top:-95
    margin-left:243

  Label
    id: wildlevel2
    size:300 300
    text-align: center
    font: sans-bold-16px-rounded
    anchors.top: parent.top
    anchors.left: parent.left
    margin-top:-70
    margin-left:260

  Label
    id: tipo2
    size:300 300
    text-align: center
    font: sans-bold-16px-rounded
    anchors.top: parent.top
    anchors.left: parent.left
    margin-top:-45
    margin-left:237

  Label
    id: habilidades
    size:300 300
    text-align: center
    font: sans-bold-16px-rounded
    anchors.top: parent.top
    anchors.left: parent.left
    margin-top:-15
    margin-left:246

  UIImageView
    id: habilidades2
    anchors.top: habilidades.top
    anchors.left: habilidades.left
    margin-top:167
    margin-left:121
    size: 26 26

  Label
    id: evolution
    size:500 500
    text-align: center
    font: sans-bold-16px-rounded
    anchors.top: parent.top
    anchors.left: parent.left
    margin-top:50
    margin-left:150

  Item
    id: portrait
    image-color: alpha
    anchors.top: evolution.top
    anchors.left: evolution.left
    margin-top:168
    margin-left:232
    virtual: true

  UIImageView
    id: move1
    anchors.top: parent.top
    anchors.left: parent.left
    margin-top:220
    margin-left:220
    size: 32 32

  Label
    id: move1label
    size:100 100
    text-align: Left
    font: verdana-11px-rounded
    anchors.top: move1.top
    anchors.left: move1.left
    margin-top:-33
    margin-left:39

  UIImageView
    id: move2
    anchors.top: parent.top
    anchors.left: parent.left
    margin-top:253
    margin-left:220
    size: 32 32

  Label
    id: move2label
    size:100 100
    text-align: Left
    font: verdana-11px-rounded
    anchors.top: move2.top
    anchors.left: move2.left
    margin-top:-33
    margin-left:39

  UIImageView
    id: move3
    anchors.top: parent.top
    anchors.left: parent.left
    margin-top:286
    margin-left:220
    size: 32 32

  Label
    id: move3label
    size:100 100
    text-align: Left
    font: verdana-11px-rounded
    anchors.top: move3.top
    anchors.left: move3.left
    margin-top:-33
    margin-left:39

  UIImageView
    id: move4
    anchors.top: parent.top
    anchors.left: parent.left
    margin-top:319
    margin-left:220
    size: 32 32

  Label
    id: move4label
    size:100 100
    text-align: Left
    font: verdana-11px-rounded
    anchors.top: move4.top
    anchors.left: move4.left
    margin-top:-33
    margin-left:39

  UIImageView
    id: move5
    anchors.top: parent.top
    anchors.left: parent.left
    margin-top:220
    margin-left:350
    size: 32 32

  Label
    id: move5label
    size:100 100
    text-align: Left
    font: verdana-11px-rounded
    anchors.top: move5.top
    anchors.left: move5.left
    margin-top:-33
    margin-left:39

  UIImageView
    id: move6
    anchors.top: parent.top
    anchors.left: parent.left
    margin-top:253
    margin-left:350
    size: 32 32

  Label
    id: move6label
    size:100 100
    text-align: Left
    font: verdana-11px-rounded
    anchors.top: move6.top
    anchors.left: move6.left
    margin-top:-33
    margin-left:39

  UIImageView
    id: move7
    anchors.top: parent.top
    anchors.left: parent.left
    margin-top:286
    margin-left:350
    size: 32 32

  Label
    id: move7label
    size:100 100
    text-align: Left
    font: verdana-11px-rounded
    anchors.top: move7.top
    anchors.left: move7.left
    margin-top:-33
    margin-left:39

  UIImageView
    id: move8
    anchors.top: parent.top
    anchors.left: parent.left
    margin-top:319
    margin-left:350
    size: 32 32

  Label
    id: move8label
    size:100 100
    text-align: Left
    font: verdana-11px-rounded
    anchors.top: move8.top
    anchors.left: move8.left
    margin-top:-33
    margin-left:39

  UIImageView
    id: move9
    anchors.top: parent.top
    anchors.left: parent.left
    margin-top:220
    margin-left:480
    size: 32 32

  Label
    id: move9label
    size:100 100
    text-align: Left
    font: verdana-11px-rounded
    anchors.top: move9.top
    anchors.left: move9.left
    margin-top:-33
    margin-left:39

  UIImageView
    id: move10
    anchors.top: parent.top
    anchors.left: parent.left
    margin-top:253
    margin-left:480
    size: 32 32

  Label
    id: move10label
    size:100 100
    text-align: Left
    font: verdana-11px-rounded
    anchors.top: move10.top
    anchors.left: move10.left
    margin-top:-33
    margin-left:39

  UIImageView
    id: move11
    anchors.top: parent.top
    anchors.left: parent.left
    margin-top:286
    margin-left:480
    size: 32 32

  Label
    id: move11label
    size:100 100
    text-align: Left
    font: verdana-11px-rounded
    anchors.top: move11.top
    anchors.left: move11.left
    margin-top:-33
    margin-left:39

  UIImageView
    id: move12
    anchors.top: parent.top
    anchors.left: parent.left
    margin-top:319
    margin-left:480
    size: 32 32

  Label
    id: move12label
    size:100 100
    text-align: Left
    font: verdana-11px-rounded
    anchors.top: move12.top
    anchors.left: move12.left
    margin-top:-33
    margin-left:39
 
Last edited:
Back
Top