Posted 29 June 2012 - 06:33 PM
Making a program that would control a factory to automatically create computers, factory side works well, just trying to now program the bundled cable outputs based on the users input on how many they want making, though I keep getting this error:
ACsln:55:Bad Arguement: number expect, got string
I have tried several things to make this work, I get that it is basically saying I am trying to compare a number with a string, but as far as I can see all my numbers are numbers.
Any help would be appreciated.
ACsln:55:Bad Arguement: number expect, got string
I have tried several things to make this work, I get that it is basically saying I am trying to compare a number with a string, but as far as I can see all my numbers are numbers.
Any help would be appreciated.
print("How many computers would you like to build?")
local num = tonumber(read())
if num > 5 then
print("Please input a smaller amount this time")
elseif input == 0 then
print("please enter an amount")
elseif input == 1 then
stonex = tonumber(7)
redstonex = tonumber(1)
glassx = tonumber(1)
print("glassx")
elseif input == 2 then
stonex = (14)
redstonex = tonumber(2)
glassx = tonumber(2)
elseif input == 3 then
stonex = tonumber(21)
redstonex = tonumber(3)
glass = tonumber(3)
elseif input == 4 then
stonex = tonumber(28)
redstonex =tonumber(4)
glass = tonumber(4)
else
stonex = tonumber(35)
redstonex = tonumber(5)
glassx = tonumber(5)
end
for i=1,tonumber(redstonex),1 do
rs.setBundledOutput("back", "color.red")
sleep(0.5)
redstone.setBundledOutput(sSide, 0)
for j=1,glassx,1 do
rs.setBundledOutput("back", "color.white")
sleep(0.5)
redstone.setBundledOutput(sSide, 0)
for k=1,stonex,1 do
rs.setBundledOutput("back", "color.white")
sleep(0.5)
redstone.setBundledOutput(sSide, 0)
end
end
end