Hacker's Sandbox
Would you like to react to this message? Create an account in a few clicks or log in to continue.
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

2 posters

Go down  Message [Page 1 of 1]

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

D4v1d3



hi,
i've a problem with the next code:

Code:

newVM ("localhost")
addUser("bob","password")
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:
Code:
>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,
D4v1d3


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)

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

unix-ninja


Admin

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?

https://hackersandbox.board-directory.net

Back to top  Message [Page 1 of 1]

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