Posted 10 January 2015 - 03:33 AM
I am attempting to write a program to use computercraft, monitors and bloodmagic. I have it set that when a particalar slate is detected it will move it out to the chest.
I am using a while loop to get it to keep checking but the problem I have is I either have to hit control in the terminal to step the while loop or I can't change the slate on the monitor
code:
Any ideas?
Thanks
I am using a while loop to get it to keep checking but the problem I have is I either have to hit control in the terminal to step the while loop or I can't change the slate on the monitor
code:
function blankSlate()
button.toggleButton("Blank Slate")
repeat
state = button.getState("Blank Slate")
contents = altar.getAllStacks()
for i,j in pairs(contents) do
slot = i
name = j["display_name"]
print(name)
end
if name == "Blank Slate" then
altar.pushItem("west", 1, 1)
end
sleep(1)
until state ~="Blank Slate"
event, side, x, y= os.pullEvent()
if event == "monitor_touch" then
button.checkxy(x,y)
end
end
I suspect I need a if statement that checks for a pullevent: monitor_touch but I can't figure out how to put that in an in if statement.Any ideas?
Thanks