• 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 Where is walk on click function? in otcv8 and or in mehah otclient?

johnsamir

Active Member
Joined
Oct 13, 2009
Messages
230
Solutions
1
Reaction score
35
Location
Nowhere
Hello

I need to find where is the "walk on game window click function". But i don't know where it could be at otcv8 or in mehah otclient. Need to find this function to add a new code related to check server elevation. I have added this piece of code, developed by @Terotrificy to walking lua, Which checks the server elevation, bloking player path if there are two or more stacked items that has elevation when a player walks with arrows keys, so i need the same but for when a player walk with game mouseclick. enlighten me please
Lua:
 local playerTile = player:getTile()--agregado 7.x block parcel
   if toTile and toTile:isWalkable() then
    if not player:isServerWalking() and not ignoredCanWalk then
        if (playerTile and (toTile:getElevation() - playerTile:getElevation() <= 1) or (playerTile:getElevation() > 3)) then
            player:preWalk(dir)
            preWalked = true
        end
    end--agregado 7.x block parcel
 
Solution
Lua:
local player = g_game.getLocalPlayer()
  local playerTile = player:getTile()
  player:stopAutoWalk()
 
  if autoWalkPos and keyboardModifiers == KeyboardNoModifier and (mouseButton == MouseLeftButton or mouseButton == MouseTouch2 or mouseButton == MouseTouch3) then
    local autoWalkTile = g_map.getTile(autoWalkPos)
    if autoWalkTile and not autoWalkTile:isWalkable(true) then
      modules.game_textmessage.displayFailureMessage(tr('Sorry, not possible.'))
      return false
    end
    if (playerTile and (autoWalkTile:getElevation() - playerTile:getElevation() <= 1) or (playerTile:getElevation() > 3)) then
    player:autoWalk(autoWalkPos)
    return true
    end
  end

  return false
end

Terotrificy

Well-Known Member
Joined
Oct 18, 2020
Messages
219
Solutions
9
Reaction score
67
Location
Santiago, Chile.
Lua:
local player = g_game.getLocalPlayer()
  local playerTile = player:getTile()
  player:stopAutoWalk()
 
  if autoWalkPos and keyboardModifiers == KeyboardNoModifier and (mouseButton == MouseLeftButton or mouseButton == MouseTouch2 or mouseButton == MouseTouch3) then
    local autoWalkTile = g_map.getTile(autoWalkPos)
    if autoWalkTile and not autoWalkTile:isWalkable(true) then
      modules.game_textmessage.displayFailureMessage(tr('Sorry, not possible.'))
      return false
    end
    if (playerTile and (autoWalkTile:getElevation() - playerTile:getElevation() <= 1) or (playerTile:getElevation() > 3)) then
    player:autoWalk(autoWalkPos)
    return true
    end
  end

  return false
end
 
Solution
Top