Posted 07 June 2013 - 10:41 PM
Greetings! I've been delving into the realm of Lua recently while playing a modpack that includes both ComputerCraft and OpenCCSensors. I am asking this question here because I feel that the OpenCCSensors part of this is not creating this issue.
And so, the issue! I have two similar lua programs, that both project onto their respective monitors (3x3 regular monitor, if it matters). The first program emits names as it should onto the monitor, starting from the top the names quickly move to the bottom of the monitor, and then remain there. There is no flickering. The second program should* do the exact same thing, but the names flicker constantly. I don't know if this is because I did something funky I do not know about, or if it is because I am calling for more information (perhaps a small lag spike not seen in first program for access time?). So here I am, asking for help from you fine folk.
First Program
Second Program
The programs in question are on pastebin as well. First Program: http://pastebin.com/Ntn706mi and Second Program (Troublemaker):http://pastebin.com/Ut7YXSjK
Thank you for any light you can shine on this :)/>/>
And so, the issue! I have two similar lua programs, that both project onto their respective monitors (3x3 regular monitor, if it matters). The first program emits names as it should onto the monitor, starting from the top the names quickly move to the bottom of the monitor, and then remain there. There is no flickering. The second program should* do the exact same thing, but the names flicker constantly. I don't know if this is because I did something funky I do not know about, or if it is because I am calling for more information (perhaps a small lag spike not seen in first program for access time?). So here I am, asking for help from you fine folk.
First Program
Spoiler
os.loadAPI("ocs/apis/sensor")
local prox = sensor.wrap("top")
repeat
local targets = prox.getTargets()
term.clear()
for name, basicDetails in pairs(targets) do
term.redirect(peripheral.wrap("left"))
print("--> "..name.." <--")
end
until false
Second Program
Spoiler
os.loadAPI("ocs/apis/sensor")
local proxSense = sensor.wrap("top")
term.redirect(peripheral.wrap("right"))
repeat
term.clear()
for target in pairs(proxSense.getTargets()) do
local detailedInfo = proxSense.getTargetDetails(target)
if detailedInfo.Name == "Player" then
print("--> "..target.." <--")
end
end
until false
The programs in question are on pastebin as well. First Program: http://pastebin.com/Ntn706mi and Second Program (Troublemaker):http://pastebin.com/Ut7YXSjK
Thank you for any light you can shine on this :)/>/>