As the title suggest i have an error called:
attempt to compare __le on nil and number
Heres the full code of the program:
-- Clears everything and wraps the peripheral
term.clear()
term.setCursorPos(1, 1)
m = peripheral.wrap("right")
m.clear()
m.setCursorPos(2, 2)
m.setTextColor(colors.white)
m.setBackgroundColor(colors.lime)
-- Writes the button
m.write(" ")
m.setCursorPos(2, 3)
m.write(" Activate ")
m.setCursorPos(2, 4)
m.write(" ")
m.setBackgroundColor(colors.black)
m.setCursorPos(1, 1)
-- Checks if clicked within specified x and y
while true do
event, button, x, y = os.pullEvent(monitor_touch)
if x <= 12 and x >= 2 and y <= 4 and y >= 2 then
rs.setOutput("back", true)
sleep(1)
rs.setOutput("back", false)
end
end
Basically once i pressed the button i get the error.
It won't loop through it again and check if the button is pressed again.
Thanks.











