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

Big Reactors Computer Failure

Started by boobooobear1, 24 February 2015 - 10:25 PM
boobooobear1 #1
Posted 24 February 2015 - 11:25 PM
Hello I was working on a Computer Program for Big Reactors. I am fairly new to computer craft but I made this super simple program:
  • reactor = peripheral.find("BigReactors-Reactor")
  • term.clear()
  • term.setCursorPos(1,1)
  • sleep(1)
  • if reactor.getConnected() then
  • print("Reactors Connected")
  • sleep(1)
  • else
  • print("Unable To Connect To Reactors")
  • end
  • print("Please Write on To Turn Reactors On, off To Turn Off")
  • input = read()
  • if input == "on" then
  • print("Turning On Reactors")
  • reactor.setActive(true)
  • elseif input == "off" then
  • print("Turning Off Reactors")
  • reactor,setActive(false")
  • end
  • end
Whenever I run it this pops up:
bios:366: [string "reactor"]:20: unfinished string

Thanks So Much for everyone's help
The_Cat #2
Posted 25 February 2015 - 12:07 AM
Remove the last "end" in code, and if you post again try putting the code in to

CODE
Edited on 24 February 2015 - 11:08 PM
Bomb Bloke #3
Posted 25 February 2015 - 12:24 AM
reactor,setActive(false")

The script ended, but you didn't close the string you started here. Switch it to:

reactor.setActive(false)
boobooobear1 #4
Posted 25 February 2015 - 12:26 AM
Remove the last "end" in code, and if you post again try putting the code in to

CODE

Sorry but that did not work. I might be me but I dont know

Remove the last "end" in code, and if you post again try putting the code in to

CODE
Also Thanks for responding and tell me how to use the code tags
I put it to pastebin and just copied that

reactor,setActive(false")

The script ended, but you didn't close the string you started here. Switch it to:

reactor.setActive(false)
Well that sort of worked now I am getting a new error message
bios:366: [string "reactor"]:21:syntax error
Thanks Also for your help

Well I fixed it Thanks for Everyone that helped out I have the pastebin in case you want it be I personally dont recommend it (NOTE: THIS ONLY WORKS IF YOU HAVE ONE BIG REACTOR DO NOT USE IF YOU ARE USING MORE)
http://pastebin.com/k1asEV8M
Dog #5
Posted 25 February 2015 - 01:09 AM
On the line that you removed the extra quote (line 18 based on the OP) you have reactor,setActive (with a comma) instead of reactor.setActive (with a period). Fix that and see what happens.

EDIT: nevermind … I missed your last paragraph before I posted :P/> Congrats on getting it up and running!
Edited on 25 February 2015 - 12:11 AM