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

What have i done wrong in this code?

Started by joveice, 15 November 2014 - 01:45 PM
joveice #1
Posted 15 November 2014 - 02:45 PM
what have i done wrong in this code?

os.pullEvent = os.pullEventRaw
print("Write Start When ready")
Start = read()
if Start == "9638" true then
print("Shutdown Starting")
rednet.open("back")
rednet.send(29, "SB Restarted")
print("Remove disk")
sleep(3)
os.reboot()
else
term.clear()
print("Order Support from here")
print("if your not a owner of MBP")
print("it costs 10 Coins")
rednet.open("back")
print("Name")
Name = read()
print("Problem")
Problem = read()
print("You will be Contacted soon!")
rednet.send(29, Name)
rednet.send(29, Problem)
rednet.send(29, "--------------------------------------------------")
rednet.open("back")
id, message = rednet.receive()
print(message)
sleep(5)
os.reboot
end
Lyqyd #2
Posted 15 November 2014 - 09:44 PM
Well, you'll need to remove the true from this statement:


if Start == "9638" true then

Other than that, it looks like it should at least somewhat function.
Cycomantis #3
Posted 16 November 2014 - 03:05 AM
Your last os.reboot() is missing the () at the end.


sleep(5)
os.reboot  <--- Here
end
TheOddByte #4
Posted 16 November 2014 - 01:09 PM
I'd like to add that when you ask for help in AaP you need to be more specific, like.. what error code are you getting?
But you've already gotten some answers because it's pretty easy to spot the errors in your code.

Change this

os.reboot
to this

os.reboot()

and this

if Start == "9638" true then
to this

if Start == "9638" then