• 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!

Otclient error please help

Felipe93

Ghost Member
Joined
Mar 21, 2015
Messages
1,990
Solutions
9
Reaction score
334
Location
Chile
Hello

im using otclient with varius edited files from others otc
the problem its that i recieving errors in terminal and also im getting kicked after a while
which is the most important thing to me to fix
errors:
hqhMQpu.png


options.lua
Code:
local defaultOptions = {
  vsync = true,
  showFps = false,
  showPing = false,
  fullscreen = false,
  classicControl = false,
  autoChaseOverride = true,
  showStatusMessagesInConsole = true,
  showEventMessagesInConsole = true,
  showInfoMessagesInConsole = true,
  showTimestampsInConsole = true,
  showPrivateMessagesInConsole = true,
  showPrivateMessagesOnScreen = true,
  showLeftPanel = false,
  foregroundFrameRate = 61,
  backgroundFrameRate = 201,
  painterEngine = 0,
  displayNames = true,
  displayHealth = true,
  displayText = true,
  dontStretchShrink = false,
  smoothWalk = true,
  walkingRepeatDelayScrollBar = 100,
  walkingSensitivityScrollBar = 50,
  bouncingKeys = true,
  bouncingKeysDelayScrollBar = 100,
  smartWalk = false,
  blueNpc = true,
  expBar = false,
}

local optionsWindow
local optionsButton
local hotkeysButton
local optionsTabBar
local options = {}
local generalPanel
local consolePanel
local graphicsPanel
local keyboardPanel
local soundPanel

local function setupGraphicsEngines()
  local enginesRadioGroup = UIRadioGroup.create()
  local ogl1 = graphicsPanel:getChildById('opengl1')
  local ogl2 = graphicsPanel:getChildById('opengl2')
  local dx9 = graphicsPanel:getChildById('directx9')
  enginesRadioGroup:addWidget(ogl1)
  enginesRadioGroup:addWidget(ogl2)
  enginesRadioGroup:addWidget(dx9)

  if g_window.getPlatformType() == 'WIN32-EGL' then
    enginesRadioGroup:selectWidget(dx9)
    ogl1:setEnabled(false)
    ogl2:setEnabled(false)
    dx9:setEnabled(true)
  else
    ogl1:setEnabled(g_graphics.isPainterEngineAvailable(1))
    ogl2:setEnabled(g_graphics.isPainterEngineAvailable(2))
    dx9:setEnabled(false)
    if g_graphics.getPainterEngine() == 2 then
      enginesRadioGroup:selectWidget(ogl2)
    else
      enginesRadioGroup:selectWidget(ogl1)
    end

    if g_app.getOs() ~= 'windows' then
      dx9:hide()
    end
  end

  enginesRadioGroup.onSelectionChange = function(self, selected)
    if selected == ogl1 then
      setOption('painterEngine', 1)
    elseif selected == ogl2 then
      setOption('painterEngine', 2)
    end
  end

  --[[--]]if not g_graphics.canCacheBackbuffer() then
    graphicsPanel:getChildById('foregroundFrameRate'):disable()
    graphicsPanel:getChildById('foregroundFrameRateLabel'):disable()
  end--
end

function init()
  for k,v in pairs(defaultOptions) do
    g_settings.setDefault(k, v)
    options[k] = v
  end

  optionsWindow = g_ui.displayUI('options')
  optionsWindow:hide()

  optionsTabBar = optionsWindow:getChildById('optionsTabBar')
  optionsTabBar:setContentWidget(optionsWindow:getChildById('optionsTabContent'))

  g_keyboard.bindKeyDown('Ctrl+F', function() toggleFullScreen() end)
  g_keyboard.bindKeyDown('Ctrl+N', toggleDisplays)

  hotkeysButton = optionsWindow:getChildById('hotkeysButton')

  generalPanel = g_ui.loadUI('game')
  optionsTabBar:addTab(tr('General'), generalPanel, '/images/optionstab/option_button')

  consolePanel = g_ui.loadUI('Console')
  optionsTabBar:addTab(tr('Console'), consolePanel, '/images/optionstab/option_button')

  graphicsPanel = g_ui.loadUI('Graphics')
  optionsTabBar:addTab(tr('Graphics'), graphicsPanel, '/images/optionstab/option_button')
 
  keyboardPanel = g_ui.loadUI('keyboard')
  optionsTabBar:addTab(tr('Keyboard'), keyboardPanel, '/images/optionstab/option_button')
  g_app.setForegroundPaneMaxFps(0)
 
  addEvent(function() setup() end)
end

function toggleFullScreen()
  local screenButton = modules.game_playerbars.fullScreenButton
   if not g_window.isFullscreen() then
     screenButton:setChecked(true)
     g_window.setFullscreen(true)
   else
     g_window.setFullscreen(false)
     screenButton:setChecked(false)
   end
end

function setup()
  local gameMapPanel = modules.game_interface.getMapPanel()
  --gameMapPanel:setDrawLights(false)
  setupGraphicsEngines()
  -- load options
  for k,v in pairs(defaultOptions) do
    if type(v) == 'boolean' then
      setOption(k, g_settings.getBoolean(k), true)
    elseif type(v) == 'number' then
      setOption(k, g_settings.getNumber(k), true)
    end
  end
end

function toggle()
  if optionsWindow:isVisible() then
    hide()
  else
    show()
  end
  if g_game.isOnline() then
     hotkeysButton:enable()
     hotkeysButton:setOpacity(1)
  else
     hotkeysButton:disable()
  end
end

function show()
  optionsWindow:show()
  optionsWindow:raise()
  optionsWindow:focus()
end

function hide()
  optionsWindow:hide()
end

function toggleDisplays()
  if options['displayNames'] and options['displayHealth'] then
    setOption('displayNames', false)
  elseif options['displayHealth'] then
    setOption('displayHealth', false)
  else
    if not options['displayNames'] and not options['displayHealth'] then
      setOption('displayNames', true)
    else
      setOption('displayHealth', true)
    end
  end
end

function toggleOption(key)
  setOption(key, not getOption(key))
end

function setOption(key, value, force)
  if not force and options[key] == value then return end
  local gameMapPanel = modules.game_interface.getMapPanel()
  if key == 'vsync' then
    g_window.setVerticalSync(value)
  elseif key == 'showFps' then
    modules.game_interface.setFpsVisible(value)
  elseif key == 'showPing' then
    modules.game_interface.setPingVisible(value)
  elseif key == 'showLeftPanel' then
    modules.game_interface.getLeftPanel():setOn(value)
  elseif key == 'backgroundFrameRate' then
    local text, v = value, value
    if value <= 0 or value >= 201 then text = 'max' v = 0 end
    graphicsPanel:getChildById('backgroundFrameRateLabel'):setText(tr('Game framerate limit: %s', text))
    g_app.setBackgroundPaneMaxFps(v)
   
  elseif key == 'bouncingKeysDelayScrollBar' then
    keyboardPanel:getChildById('bouncingKeysDelayLabel'):setText(tr('Auto bouncing keys interval: %s ms', value))
  elseif key == 'walkingSensitivityScrollBar' then
    keyboardPanel:getChildById('walkingSensitivityLabel'):setText(tr('Walking keys sensitivity: %s%%', value))
  elseif key == 'walkingRepeatDelayScrollBar' then
    keyboardPanel:getChildById('walkingRepeatDelayLabel'):setText(tr('Walking keys auto-repeat delay: %s ms', value))
    local scrollBar = keyboardPanel:getChildById('walkingRepeatDelayScrollBar')
    modules.game_interface.setWalkingRepeatDelay(value)
  elseif key == 'smoothWalk' then
    keyboardPanel:getChildById('walkingSensitivityScrollBar'):setEnabled(value)
    keyboardPanel:getChildById('walkingSensitivityLabel'):setEnabled(value)
  elseif key == 'bouncingKeys' then
    keyboardPanel:getChildById('bouncingKeysDelayScrollBar'):setEnabled(value)
    keyboardPanel:getChildById('bouncingKeysDelayLabel'):setEnabled(value)

  elseif key == 'painterEngine' then
    g_graphics.selectPainterEngine(value)
  elseif key == 'displayNames' then
    gameMapPanel:setDrawNames(value)
  elseif key == 'displayHealth' then
    gameMapPanel:setDrawHealthBars(value)
  elseif key == 'expBar' then
    modules.game_healthinfo.toggleExpBar(value)
   
  elseif key == 'blueNpc' then
    if value then
         g_game.enableFeature(GameBlueNpcNameColor)
    else
       g_game.disableFeature(GameBlueNpcNameColor)
    end
    modules.game_battle.checkCreatures()
  elseif key == 'displayText' then
    gameMapPanel:setDrawTexts(value)
  elseif key == 'dontStretchShrink' then
    addEvent(function()
      modules.game_interface.updateStretchShrink()
    end)
  end

  -- change value for keybind updates
  for _,panel in pairs(optionsTabBar:getTabsPanel()) do
    local widget = panel:recursiveGetChildById(key)
    if widget then
      if widget:getStyle().__class == 'UICheckBox' then
        widget:setChecked(value)
      elseif widget:getStyle().__class == 'UIScrollBar' then
        widget:setValue(value)
      end
      break
    end
  end

  g_settings.set(key, value)
  options[key] = value
end

function getOption(key)
  return options[key]
end

function addTab(name, panel, icon)
  optionsTabBar:addTab(name, panel, icon)
end

function addButton(name, func, icon)
  optionsTabBar:addButton(name, func, icon)
end
 
I don't know what exactly you changed, but the error you're getting is because there is no setPingVisible function on default game_interface module. Perhaps you forgot to change some other files? I can't tell for sure because you only showed this specific file.
You could try replacing line 194 with this:

modules.client_topmenu.setPingVisible(value)

Because the client_topmenu module does have this setPingVisible function defined right here:
2G3zuS8.png
 
i've added this and this on game_interface/gameinterface.lua
Code:
function onGameStart()
  show()
  g_game.setPingDelay(4000)
end

Code:
function updatePing(ping)
  local text = 'Ping to '..g_app.getName()..': '
  local color
  local ping = math.ceil(ping/2)
    if ping < 0 then
      text = text .. "??"
      color = 'yellow'
    else
      text = text .. ping .. ' ms'
      if ping >= 500 then
        color = 'red'
      elseif ping >= 250 then
        color = 'yellow'
      else
        color = 'green'
      end
    end
    pingLabel:setColor(color)
    pingLabel:setText(text)
end

function setPingVisible(enable)
  pingLabel:setVisible(enable)
end
but when i try to open client i get unable to load game_interface module!


gonna try only with your code
 
Back
Top