FAQ  •  Register  •  Login

Debugging tip

<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Wed Mar 17, 2010 1:36 am

Debugging tip

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>
<<

amgine

Posts: 1399

Joined: Thu Apr 19, 2012 2:57 pm

Post Mon Oct 08, 2012 10:01 pm

Re: Debugging tip

It works thank you for the help =)
Bitfighter Forever.
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Wed Oct 10, 2012 6:04 am

Re: Debugging tip

Thanks for the tardy reply -- I had actually forgotten about this!
<<

amgine

Posts: 1399

Joined: Thu Apr 19, 2012 2:57 pm

Post Mon Oct 22, 2012 9:19 pm

Re: Debugging tip

lol no probem this is reqally helping me iwth my bot work!
Bitfighter Forever.

Return to Bots

Who is online

Users browsing this forum: No registered users and 2 guests