Debugging lua script

You can share your Lua Scripts with everybody here.

Debugging lua script

Postby JackDaniels » Fri Sep 21, 2012 5:28 pm

Hi there,

Can you tell me if it's possible to print a LUA script output to a file?

I've add some print command to a script set in the OnUserLoggedIn event but I'dd like to see what it output when it run. Only thing I see in the Domain Log is LUA script on event blabla executed successfully. I know I can copy and past it in the console on administration and get the output there but my problem happen only when it's fire by the event.

Thanks
JackDaniels
 
posts 2
 
joined Mon Jan 09, 2012 6:21 pm

Re: Debugging lua script

Postby FTP » Sat Sep 22, 2012 6:24 am

Yes, you can write the Lua script like this:

Code: Select all
local fp = assert(io.open("c:/output.log", "a+"))
fp:write("something happened!\n")
fp:close()
FTP
Site Admin
 
posts 1216
 
joined Tue Sep 29, 2009 6:09 am

Re: Debugging lua script

Postby JackDaniels » Mon Sep 24, 2012 2:14 pm

Ahhh indeed! Shame to myself for not having thought about it....

Thanks for your help.
JackDaniels
 
posts 2
 
joined Mon Jan 09, 2012 6:21 pm


Return to Lua scripts

Who is online

Users browsing this forum: No registered users and 1 guest