Page 1 of 1

Debugging tip

PostPosted: Wed Mar 17, 2010 1:36 am
by watusimoto
If you are trying to figure out why something went wrong, you can do this:
  Code:
  1.   if x1==nil or x2==nil or y1==nil or y2==nil then
  2.       logprint(debug.traceback())
  3.    end


And you'll get output like this:

Robot: stack traceback:
robots/ender.bot:76: in function 'distanceTo'
robots/ender.bot:278: in function 'attackNearbyEnemies'
robots/ender.bot:383: in function 'onTick'
robot_helper_functions.lua:124: in function <robot_helper_functions.lua:120>

Re: Debugging tip

PostPosted: Mon Oct 08, 2012 10:01 pm
by amgine
It works thank you for the help =)

Re: Debugging tip

PostPosted: Wed Oct 10, 2012 6:04 am
by watusimoto
Thanks for the tardy reply -- I had actually forgotten about this!

Re: Debugging tip

PostPosted: Mon Oct 22, 2012 9:19 pm
by amgine
lol no probem this is reqally helping me iwth my bot work!