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

read() function Improvments

Started by BigSHinyToys, 14 September 2012 - 04:12 PM
BigSHinyToys #1
Posted 14 September 2012 - 06:12 PM
when running read in parallel with other functions that print to the screen some times the section of the screen used by read is overwritten. read dose not redraw the screen when events that don't change its output happen example timer and rednet. leaving the section of the screen blank or incorrectly displaying.

possible solutions

A ) making read respond to a "redraw" event. This would allow us th create an event with

os.queueEvent("redraw")

B ) add a option to read that will update every time any event happens.

local input = read(nil,nil,true)

C ) have a option turn on a respond to an event

local function input()
while true do
local input = read(nil,nil,"redraw_Event")
rednet.send(compID,input)
end
end
local function other()
while true do
local event,sender,message,dist = os.pullEvent("rednet_message")
print(message)
os.queuEvent("redraw_Event")
end
end
Cranium #2
Posted 14 September 2012 - 06:24 PM
I know Grim Reaper (PaymentOption) posted a function that solves this issue before. I can't remember where it was, or he may have PM'ed it to me ina game, but you should ask him for a copy. I would distribute, but I don't think I have his permission. :)/>/>