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

Help !

Started by Leon669, 23 August 2014 - 11:04 PM
Leon669 #1
Posted 24 August 2014 - 01:04 AM
Hi i have a error when i press any key that is given in the programm code

http://pastebin.com/v0XtxM0u

eingabe:6: index expected, got nil

  • shell.run"farbe"
  • print("ChromeOs Booten ?")
  • sel = 0
  • while true do
  • event. key = os.pullEvent("key")
  • if key == 28 then
  • print("Auswahl bestaetigt")
  • sel = 0
  • elseif key == 14 then
  • print("okay")
  • sel = 1
  • end
  • end
AssossaGPB #2
Posted 24 August 2014 - 01:26 AM
On line 6, it should be a comma not a period. Just like in English (and all languages I think) items in a list/series are separated with commas.

So line 6 should be:
event, key = os.pullEvent("key")

Not:
event. key = os.pullEvent("key")
Edited on 24 August 2014 - 04:09 PM
Dragon53535 #3
Posted 24 August 2014 - 01:56 AM
On line 6, it should be a period not a comma.
Don't you mean comma instead of a period? And yeah that should fix it.
Leon669 #4
Posted 24 August 2014 - 01:15 PM
Thx a lot :D/>
What a fail :D/>
AssossaGPB #5
Posted 24 August 2014 - 06:09 PM
On line 6, it should be a period not a comma.
Don't you mean comma instead of a period? And yeah that should fix it.
Oops, fixed that. Thanks for pointing that out!