Jump to content




:17: expected string, number


7 replies to this topic

#1 FrozenFirebat

  • New Members
  • 4 posts

Posted 06 January 2013 - 04:16 PM

I get a :17: expected string, number error -- And I can't seem to figure out the error.

local function White()
redstone.setBundledOutput("back", colors.white)
sleep(1)
redstone.setBundledOutput("back", 0)
end
local function Red()
redstone.setBundledOutput("back", colors.red)
sleep(1)
redstone.setBundledOutput("back", 0)
end
local function Yellow()
redstone.setBundledOutput("back", colors.yellow)
sleep(1)
redstone.setBundledOutput("back", 0)
end
local function Orange()
redstone.setBundledOutput("back", colors.orange)
sleep(1)
redstone.setBundledOutput("back", 0)
end
local function Movedown()
local i = 1
repeat
  White()
  Sleep(2)
  Red()
  Sleep(3)
  i = i + 1
until i == 100
end
local function Moveup()
local j = 1
repeat
  Yellow()
  Sleep(5)
  j = j + 1
until j == 100
end
local function Movesouth()
local k = 1
repeat
  Orange()
  Sleep(2)
  Red()
  Sleep(3)
  k = k + 1
until k == 17
end


while true do
Movesouth()
Sleep(1)
Movedown()
Sleep(1)
Moveup()
Sleep(1)
end


#2 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 06 January 2013 - 04:47 PM

It's saying colors.orange doesn't exist but I'm not sure why.

#3 FrozenFirebat

  • New Members
  • 4 posts

Posted 06 January 2013 - 04:51 PM

Yeah if I change the colors.orange to colors.white on line 17... the program actually runs, lights up white once, and then gives me :43: attempt to call nil

#4 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 06 January 2013 - 05:01 PM

I don't see anywhere you've defined "Sleep" with a capital S, so just lowercase every usage of Sleep(). Also, with the colors.orange issue, either check that you haven't made any sort of typo anywhere, and if it still doesn't work, just use 2 instead of colors.orange.

#5 FrozenFirebat

  • New Members
  • 4 posts

Posted 06 January 2013 - 05:04 PM

Thx. I wasn't aware that it required case sensitivity

#6 Dusty_Rebel

  • Members
  • 57 posts

Posted 06 January 2013 - 05:07 PM

I See you are making an airship... Are You?

#7 FrozenFirebat

  • New Members
  • 4 posts

Posted 06 January 2013 - 05:20 PM

flying quarry.

It's got a 17x17 bore head, and it should move south 17 blocks, then try to drill 100x times and then try to retract the arm 100 times....

#8 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 06 January 2013 - 11:29 PM

Try colours.orange? O.o

In a another program do this:

a = fs.open("file.txt", "w")
for i, col in pairs(colors) do
    print(col)
    a.writeLine(col)
end
a.close()

And paste the output from the 'file.txt' file here





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users