• 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

Advanced OT User
Joined
Oct 13, 2009
Messages
844
Solutions
6
Reaction score
151
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
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
Back
Top