Jump to content




What have i done wrong in this code?

computer

3 replies to this topic

#1 joveice

  • New Members
  • 1 posts

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


#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

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.

#3 Cycomantis

  • Members
  • 60 posts

Posted 16 November 2014 - 03:05 AM

Your last os.reboot() is missing the () at the end.

sleep(5)
os.reboot  <--- Here
end


#4 TheOddByte

    Lazy Coder

  • Members
  • 1,607 posts
  • LocationSweden

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






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users