Skip to content

lua how to debug

mtanksl edited this page Sep 4, 2023 · 3 revisions

How to debug .lua scripts

  1. Download ZeroBrane Studio IDE.
  2. Launch the IDE.
  3. Click Menu > Project > Start Debugger Server.
  4. Click Menu > Project > Project Directory > Start Debugger Server > Choose... and select \mtanksl.OpenTibia.GameData\data\.
  5. Open \plugins\npcs\lib.lua in the project window, for example.
  6. Insert the function debugger.start() inside the function npchandler:onsay(npc, player, message), for example.
  7. Add breakpoints.
  8. Run the server.
  9. Talk to some NPC.
  10. The breakpoint will be hit, press F10 to step into, Shift + F10 to step over, Ctrl + F10 to step out and F5 to continue debugging.
  11. Now go have some fun!

Clone this wiki locally