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

quarry item counting program error

Started by steveoboy, 04 January 2013 - 03:52 PM
steveoboy #1
Posted 04 January 2013 - 04:52 PM
i am getting this error message "bios:206: [string "quarry"]:56: ')' expected" and I have tried everything and anything to fix it please help




lastvalue = {}
count = {}
colours = {}

colours[1]=" |white |dirt "
colours[2]=" |orange |cobble "
colours[3]=" |magenta |gravel "
colours[4]=" |lightBlue |redstone "
colours[5]=" |yellow |coal "
colours[6]=" |lime |uranium "
colours[7]=" |pink |nikolite "
colours[8]=" |grey |diamond "
colours[9]=" |lightGrey |lapis "
colours[10]=" |cyan |tungsten "
colours[11]=" |purple |iron ore "
colours[12]=" |blue |silver ore"
colours[13]=" |brown |copper ore"
colours[14]=" |green |tin ore "
colours[15]=" |red |gold ore "
colours[16]=" |black"


for i = 1, 15 do
lastvalue = false
count = 0
end

while x ~= "end" do
for i = 1, 15 do
y = rs.getBundledInput("back")



if lastvalue == false and colors.test(y, 2^(i-1)) then
count = count +1
lastvalue = true
end – if lastvalue false
if lastvalue == true and colors.test(y, 2^(i-1)) == false then
lastvalue = false
end – for 1 4
end – if lastvalue true





sleep (0.01)
term.clear()
print("|Item |Input |Item |Number of |RS signal")
print("|Detector |Colour |Type |Items |False or ")
print("|Number | | |Recorded |True")
print("|———–|————-|————|————–|———")
for i = 1, 9 do

y = rs.getBundledInput("back")
print("|", i," ", colours, " ","|",count," ", " "," |",colors.test(y, 2^(i-1)))
end – for i = 1, 15
for i = 10, 15 do
y = rs.getBundledInput("back")
print("|", i," ", colours, " ", "|",count, " ", " "," |",colors.test(y, 2^(i-1)))
end – for i = 1, 15
end – while x
Mads #2
Posted 05 January 2013 - 11:37 PM
print("|", i," ", colours, " ","|",count," ", " "," |",colors.test(y, 2^(i-1)))

Why the fuck are you printing it like that?


Also, what is line 56?

Indent your code, and put it in
 tags, or on Pastebin, so we can see line numbers. Not too hard, is it?