FIsh_tacoz Posted February 11, 2013 Posted February 11, 2013 Ok, I would usually go to the computercraft forums, but apparently I can't post any topics. Anyways, I was getting an error I couldn't understand how to fix. Here is my code: mon.peripheral.wrap("right") mon.setCursorPos(1,2) mon.write("Test") event, e=os.pullEvent("key") print"Test text" while true do if e==25 then shell.run("lock") -- this is a password program I have set up break end end Anyways, what this program does is basically writes something on my monitor, and when P is pressed, it runs a password system. However, after about 10 seconds, an error comes up: nil: vm error: java.lang.NullPointerException I have no idea what this means, or what is causing it XD any help would be appreciated. Thanks
warpspeed10 Posted February 11, 2013 Posted February 11, 2013 mon = peripheral.wrap("right") print("Test text")
FIsh_tacoz Posted February 11, 2013 Author Posted February 11, 2013 ("Test Text" mon = peripheral.wrap("right") print("Test text") I added the mon.write("test"). is that not the same? Or am I missing something? Oh, and the mon.peripheral thing was a typo :/
warpspeed10 Posted February 11, 2013 Posted February 11, 2013 ("Test Text" I added the mon.write("test"). is that not the same? Or am I missing something? I was correcting your syntax. print"Test text" ^this is not correct.
FIsh_tacoz Posted February 11, 2013 Author Posted February 11, 2013 Hm I was correcting your syntax. print"Test text" ^this is not correct. Err, still gives me the error
FIsh_tacoz Posted February 11, 2013 Author Posted February 11, 2013 Could it be in the lock program? Well, the lock program works when I isolate it to itself. Also, I haven't even pressed the event key P to launch the Lock program, so I don't think the lock would be a problem. My sign just flashes off, then when I open the computer, that error comes up(after I type startup or reboot).
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now