term.clear()
term.setCursorPos(1,1)
term.setTextColor(1024)
print("AppleOS V1")
os.run("turtledoor")
This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Impossibly confused.
Started by applesauce10189, 13 January 2014 - 12:17 AMPosted 13 January 2014 - 01:17 AM
So, I set the startup to say a different OS and to run my program. It only uses about 5 lines of code and my error is "bios:335: Expected string, string"
Posted 13 January 2014 - 01:24 AM
Note: that os.run("turtledoor") line, I tried running it alone and it works fine so the problem is somewhere above it.
EDIT: I tried running turtledoor itself not the actual line of code.
EDIT: I tried running turtledoor itself not the actual line of code.
Edited on 13 January 2014 - 12:35 AM
Posted 13 January 2014 - 01:34 AM
I'm not sure about the part where you set the color, but whenever I use 'shell.run()' (the same as os.run()) I do not use quotation marks… I don't see any other problems.
Posted 13 January 2014 - 01:40 AM
Removed quotation marks. Same error. I feel the quotation marks are optional because of this but it also could be the bios:335… error being triggered first.
Also changed term.setTextColor(1024) to term.setTextColor(colors.purple)
It wrote the "AppleOS" part but still didn't run the program.
EDIT: changed os.run(turtledoor) to use shell instead of os and now it ignores that line of code entirely, it literally printed AppleOS and didn't run the program. Also no error other than the fact it's ignoring the last line of code.
Also changed term.setTextColor(1024) to term.setTextColor(colors.purple)
It wrote the "AppleOS" part but still didn't run the program.
EDIT: changed os.run(turtledoor) to use shell instead of os and now it ignores that line of code entirely, it literally printed AppleOS and didn't run the program. Also no error other than the fact it's ignoring the last line of code.
Edited on 13 January 2014 - 12:43 AM
Posted 13 January 2014 - 01:45 AM
Okay, I put the quotation marks back and it's working perfectly………. Seriously what the heck I changed almost nothing what was even causing this? I only changed two things to make this error go away, using shell instead of os and using colors.purple instead of 1024……… Wow…
Posted 13 January 2014 - 02:36 AM
Os.run and shell.run is not the same thing, and neither will work with an undefined variable. Os.run however also requires an enviroment along with the string path.
Edited on 13 January 2014 - 01:36 AM
Posted 13 January 2014 - 02:54 AM
Edited on 13 January 2014 - 01:55 AM
Posted 13 January 2014 - 12:03 PM
I like the title: Impossibly Confused. Reminds me of the World's Most Interesting Man: He got confused once just to see what it was like.
Applesauce: a debugging tip: put error("X") or some other string after the first line. If the first line runs and you just get "X", then move it to under the 2nd line and repeat.
Alternatively, in your case, comment out all the lines except the first. Run. If all is fine, uncomment the second. Repeat.
Applesauce: a debugging tip: put error("X") or some other string after the first line. If the first line runs and you just get "X", then move it to under the 2nd line and repeat.
Alternatively, in your case, comment out all the lines except the first. Run. If all is fine, uncomment the second. Repeat.
Posted 13 January 2014 - 12:18 PM
A better idea in case of longer programs is check the functions of the api returning the error, which in this case is reffered to as "bios" and is thus any os. functions.
Posted 13 January 2014 - 12:33 PM
Or having print() to check if it gets to a point is fine although sometimes slower.
Posted 13 January 2014 - 12:57 PM
well try this :D/>!
at
it should be something like this
at
term.setCursorPos(1,1)
it should be
term.setCursorPos(1, 1)
and change os.run to shell.runit should be something like this
term.clear()
term.setCursorPos(1, 1)
term.setTextColor(1024)
print("AppleOS V1")
shell.run("turtledoor")
Posted 13 January 2014 - 02:32 PM
This has already been solved. Argument spacing is a purely cosmetic choice and does not affect function.
Posted 13 January 2014 - 10:30 PM
I do still have a question though, what was causing the error? As mentioned above, I used shell instead of os and I used colors.purple instead of 1024, I want to know so I can avoid it in the future because I remember running into this problem once before and rage quitting.
Posted 13 January 2014 - 10:36 PM
I believe it's the use of shell.run over os.run.
Posted 14 January 2014 - 12:56 AM
os.run requires an environment table as the first argument, which you were not providing.
Posted 14 January 2014 - 02:26 AM
Im feeling pretty ignored right now…Os.run and shell.run is not the same thing, and neither will work with an undefined variable. Os.run however also requires an enviroment along with the string path.
Posted 14 January 2014 - 05:22 PM
Don't worry you didn't go ignored by me, just impossibly confused me.Im feeling pretty ignored right now…Os.run and shell.run is not the same thing, and neither will work with an undefined variable. Os.run however also requires an enviroment along with the string path.