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

[1.6.4][SMP/(SSP?)] monitor.clear() is slow

Started by cupcode, 15 May 2014 - 07:18 PM
cupcode #1
Posted 15 May 2014 - 09:18 PM
The problem is, that the monitor updates its background color very slowly.
When you press on an advanced monitor it seems that it skips multiple 'monitor_touch'
events. So the background of the monitor would change only like 4 times if you rapid click on
it.

Note: I encountered this with an 4x3 advanced monitor.

Here is the code:

local mon = peripheral.wrap("left")
local color = 1
while true do
os.pullEvent("monitor_touch")
color = color + 1
if color > 16 then
  color = 1
end
mon.setBackgroundColor(color)
mon.clear()
end
Lyqyd #2
Posted 15 May 2014 - 10:08 PM
The colors are not numbered 1-16, they are powers of two from 2^0 - 2^15.

Moved to Ask a Pro.