It is currently November 19th, 2018, 8:10 am

Lua debugger

Discuss the use of Lua in Script measures.
User avatar
CyberTheWorm
Posts: 602
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Lua debugger

CyberTheWorm » January 7th, 2018, 12:36 am

Does anyone know of a debugger for Lua scripts.

I only ask because I sent a lot of time on my first script, it would be nice to see the values I'm getting while running it.
Last edited by CyberTheWorm on January 7th, 2018, 4:58 am, edited 1 time in total.
The only source of knowledge is experience. Albert Einstein
Deviant Art Page
User avatar
jsmorley
Developer
Posts: 18330
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Lua debugger

jsmorley » January 7th, 2018, 12:46 am

CyberTheWorm wrote:Does anyone know of a debugger for Lua scripts.

I only ask because I sent a lot of time on my first script, it would be nice to see the values I'm getting while running it.
There really isn't anything I know of that is some kind of official debugger, but there is good news. The print() function outputs to the Rainmeter log, so you can just:

for inc = 1, 5 do
print(inc)
end

Point is, you can output any result, any variable or table value to the Rainmeter log pretty easily. Just remember that the log will be in reverse chronological order...

What you would see in the log with the above is:

5
4
3
2
1

You could certainly write a function that outputs to a text file, and call it with LogMe('The current value of someVar is '..SomeVar), but I have never run into something that required that much effort. The print() function does a good job of telling you what it going on.
User avatar
CyberTheWorm
Posts: 602
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: Lua debugger

CyberTheWorm » January 7th, 2018, 4:59 am

OK Thanks jsmorley
The only source of knowledge is experience. Albert Einstein
Deviant Art Page
User avatar
FormFollowsFunction
Posts: 2
Joined: April 26th, 2018, 2:29 pm

Re: Lua debugger

FormFollowsFunction » May 29th, 2018, 11:37 am

http://lua-users.org/wiki/DebuggingLuaCode

Powered by a popular search engine ! ;-)