This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
sphynxcatgaming's profile picture

Issues with my first program

Started by sphynxcatgaming, 09 November 2017 - 11:47 PM
sphynxcatgaming #1
Posted 10 November 2017 - 12:47 AM
I'm working on a modded adventure map, and the player will carry a pocket computer throughout for entering various codes they can obtain to access different programs.
The program works fine when started normally, but will not autostart. It throws the below error:


function start()
    while true do
	 term.clear()
	 term.setCursorPos(1, 1)
	 print("Neo OS v. 20.3.4")
	 print("Info: NeoOS is a specialized OS that can be suited to corporations. NeoOS can do anything. Its diffrent functions can be activated based on different codes which can be shared on a need-to-know basis.")
	 print("Input a code to activate a function.")
	 input = read("*")
	 if input == "codetest" then
	    print("code is working")
	 end
    end
end
start()
If it helps any, my startup file is set to just use pastebin run for easy updating purposes.
Thanks!
(By the way, this is my first post- if i'm doing anything wrong, please tell me!)
KingofGamesYami #2
Posted 10 November 2017 - 12:51 AM
Please post the contents of the startup file.
sphynxcatgaming #3
Posted 10 November 2017 - 12:54 AM
Startup file:

pastebin run sLpVwA58
Sorry!

I forgot to mention it's running on an Advanced Wireless Pocket Computer.
KingofGamesYami #4
Posted 10 November 2017 - 01:18 AM
The contents of your startup file is not valid lua code. Try this:

shell.run( "pastebin run sLpVwA58" )

This is a work-around. You should use the http API directly, but shell.run is simpler and easier, especially for a beginner such as yourself. If you are interested, open rom/programs/http/pastebin with the edit progarm. You won't be able to make changes, but you'll be able to see what the pastebin program actually does.
sphynxcatgaming #5
Posted 10 November 2017 - 02:03 AM
Thank you!