Posted 28 January 2015 - 12:29 AM
I am trying to automate Witchery circle magic rituals with a touchscreen monitor and a turtle. I want the turtle to start above the heart glyph of the circle and go forward 3 blocks to check what type of circle it is and send it to the monitor to display. so far i press the button and the turtle goes and checks the chalk (i know it works because i told it to print to the turtle before it sent it and it printed) but it doesnt display on the monitor. Plz help. Here is the code for the turtle
And heres the one for the computer
ps sorry the code parts look weird its my first post, not sure how to make it look right. it did before, until i pressed preview post. Then it got messed up.
- rednet.open("right")
local torf,block = turtle.inspectDown()
while true do
id,message = rednet.receive()
if id == 1 then
if message == ("curse of crazy") then
turtle.forward()
turtle.forward()
turtle.forward()
turtle.inspectDown()
if block.name == ("witchery:circleglyphinfernal") then
turtle.back()
turtle.back()
turtle.back()
else print("ERROR")
rednet.send(1,"ERROR! Invalid circle!")
end
end
end
end
And heres the one for the computer
- os.loadAPI("button")
m = peripheral.wrap("right")
m.clear()
rednet.open("top")
function fillTable()
button.setTable("Curse of Crazy", crazycurse, 10,30,3,8)
button.screen()
end
function getClick()
event,side,x,y = os.pullEvent("monitor_touch")
button.checkxy(x,y)
end
function crazycurse()
button.toggleButton("Curse of Crazy")
rednet.send(20,"curse of crazy")
sleep(0.5)
button.toggleButton("Curse of Crazy")
if rednet.receive() == "ERROR! Invalid circle!" then
m.print("ERROR")
end
end
fillTable()
while true do
getClick()
end
ps sorry the code parts look weird its my first post, not sure how to make it look right. it did before, until i pressed preview post. Then it got messed up.