Hacker's Sandbox

Support and conversations related to playing "The Hacker's Sandbox" as found on Flying Monkey Army.

You are not connected. Please login or register

problem with lua code

Go down  Message [Page 1 of 1]

1 problem with lua code on Wed Jul 29, 2015 2:20 pm

i've a problem with the next code:


newVM ("localhost")
addFile({ name = "home/bob/hello", content = "Hello, Bob!\n" })
mail ({ to = "bob", from = "an email", subject = "Can you see me?\n"})

this is what the program said when I tried to run it:
>lua -e "io.stdout:setvbuf 'no'" "bob.lua"
lua: bob.lua:5: attempt to call global 'newVM' (a nil value)
stack traceback:
   bob.lua:5: in main chunk
   [C]: ?
>Exit code: 1

it's not executing, what am i doing wrong??

Thanx in advance,

ps.: i'm total new to the lua thing but i'm not a noob in the programming sector.

Last edited by D4v1d3 on Wed Jul 29, 2015 2:22 pm; edited 1 time in total (Reason for editing : testing the code again)

View user profile

2 Re: problem with lua code on Mon Aug 03, 2015 11:39 am

Hey D4v1d3, the code actually looks mostly right. You are missing the "body" parameter from the mail() function, but I am not sure that would throw the error you are seeing.

Which version of THS are you running?

View user profile http://hackersandbox.board-directory.net

Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum