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

Bios:337: [String "glass"]:59: 'end' Expected

Started by candycool1234, 05 August 2013 - 02:09 AM
candycool1234 #1
Posted 05 August 2013 - 04:09 AM
Bios:337: [string "glass"]:59: 'end' expected to close 'while' at line 42) please help
Http://Pastebin.com/fKLqCY6k
makerimages #2
Posted 05 August 2013 - 04:19 AM
'end' expected
Read it, write an end to that line
candycool1234 #3
Posted 05 August 2013 - 04:26 AM
Problem is also it just repeats the one same command given please help
immibis #4
Posted 05 August 2013 - 04:30 AM
Here's your code in "list of instructions" format - the problem should be obvious:

1. Wait for a command
2. Repeat the following step forever:
2a. Process the command
candycool1234 #5
Posted 05 August 2013 - 04:34 AM
Ok soo ik that so could you please help me I thought I could use repeat an then drop the while true and yet a button to trigger the until statement but it did not work
immibis #6
Posted 05 August 2013 - 05:24 AM
How would you fix the list of instructions?
reububble #7
Posted 05 August 2013 - 07:24 AM
You haven't ended the if on line 45.
It's your choice to decide which one you missed but either you missed the while or the if end. From the looks of your indents you missed the end on the if
MmPMSFmM #8
Posted 05 August 2013 - 09:01 AM

while true do

  --test command
  if (command == "shutdownMCM") then
    reset()
    print "running Shutdown command..."
    glass.addText(10, 10, "System offline!", glcolors.red)
    os.shutdown()
  --screen reset
  elseif (command == "reset") then
    fullReset()
  elseif
    glass.addText(10, 10, "Unknown command!", glcolors.red) then
    sleep(2)
    fullReset()
end
end

should do the job.

It adds end to close the loop.
candycool1234 #9
Posted 10 August 2013 - 03:13 PM
It did it thank you :)/>