Your browser does not support JavaScript or its disabled!
Please turn it on, or be aware that some features on this website will not work correctly.
631
Use Item Infront #85
Auto uses top item infront of the player.
385b | 13 lines.
macro(1000, "Auto Use Infront", function()
  local dirs = { {0,-1}, {1,0},  {0,1},  {-1,0} }
  local player = g_game.getLocalPlayer()

  local pos = player:getPosition()
  local dir = dirs[player:getDirection()+1]
  pos.x = pos.x + dir[1]
  pos.y = pos.y + dir[2]
  local tile = g_map.getTile(pos)
  if tile then
    g_game.useWith(tile:getTopUseThing(), player)
  end
end)

21 Mar 2022
Ads