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

attempt to compare __lt on nil and number?

Started by OSProgrammer, 30 July 2014 - 12:14 AM
OSProgrammer #1
Posted 30 July 2014 - 02:14 AM
I have been trying to work out what this means! I never seen this error before.

mon = peripheral.wrap("monitor_5")

while true do
mon.clear()
mon.setBackgroundColor(colors.black)
mon.clear()
mon.setTextScale(4)
mon.setCursorPos(4,2)
mon.setTextColor(colors.white)
mon.write("Touch Me!")
event, side, x, y = os.pullEvent("monitor_touch")
if x > 4 and X < 12 and y == 2 then
mon.setBackgroundColor(colors.blue)
mon.clear()
mon.setCursorPos(4,2)
mon.setTextColor(colors.yellow)
mon.write("That's Nice!")
sleep(5)
end
end
theoriginalbit #2
Posted 30 July 2014 - 02:20 AM
In the future please use [code][/code] tags around your code so it is better formatted, and if it is a long script use an upload service such as pastebin.

As for the problem, it is because Lua is case sensitive. meaning that X < 12 should be x < 12