Posted 28 January 2015 - 12:04 AM
so i use direwolf20's button API: http://pastebin.com/sCM3Lp3j
And i have my own script like this (i'm new to computercraft doing so i didnt know any other way to do the redstone output, and yeah it's buggy that's why i'm asking for pro help :)/>)
So lets say i have pressed "T1 Slate" button and it lights green, if i then press the button "T3 Slate" i want to be able to turn off "T1 Slate" 's redstone and then turn off the green color on the screen and thereafter turn on so "T3 Slate" turns green on the screen and the redstone strength for T3 goes on.
And of course i want to be able to do this with everyone. So if T3 is on and i wanna make T1 then T3's redstone goes off and goes red on the screen and then T1 goes green and output the redstone strength.
So can anyone help me with that? :)/>
And i have my own script like this (i'm new to computercraft doing so i didnt know any other way to do the redstone output, and yeah it's buggy that's why i'm asking for pro help :)/>)
os.loadAPI("button")
m = peripheral.wrap("top")
m.clear()
function fillTable()
button.setTable("T1 Slate", t1slate, 2,14,4,6)
button.setTable("T2 Slate", t2slate, 2,14,8,10)
button.setTable("T3 Slate", t3slate, 2,14,12,14)
button.setTable("T4 Slate", t4slate, 2,14,16,18)
button.setTable("T5 Slate", t5slate, 2,14,20,22)
button.screen()
end
function getClick()
event,side,x,y = os.pullEvent("monitor_touch")
button.checkxy(x,y)
end
function t1slate()
button.toggleButton("T1 Slate")
if (redstone.getInput("front") == false) then
redstone.setAnalogOutput("front", 2)
else
redstone.setOutput("front", false)
end
end
function t2slate()
button.toggleButton("T2 Slate")
if (redstone.getInput("front") == false) then
redstone.setAnalogOutput("front", 4)
else
redstone.setOutput("front", false)
end
end
function t3slate()
button.toggleButton("T3 Slate")
if (redstone.getInput("front") == false) then
redstone.setAnalogOutput("front", 6)
else
redstone.setOutput("front", false)
end
end
function t4slate()
button.toggleButton("T4 Slate")
if (redstone.getInput("front") == false) then
redstone.setAnalogOutput("front", 8)
else
redstone.setOutput("front", false)
end
end
function t5slate()
button.toggleButton("T5 Slate")
if (redstone.getInput("front") == false) then
redstone.setAnalogOutput("front", 10)
else
redstone.setOutput("front", false)
end
end
button.heading("Craft:")
fillTable()
while true do
getClick()
end
So lets say i have pressed "T1 Slate" button and it lights green, if i then press the button "T3 Slate" i want to be able to turn off "T1 Slate" 's redstone and then turn off the green color on the screen and thereafter turn on so "T3 Slate" turns green on the screen and the redstone strength for T3 goes on.
And of course i want to be able to do this with everyone. So if T3 is on and i wanna make T1 then T3's redstone goes off and goes red on the screen and then T1 goes green and output the redstone strength.
So can anyone help me with that? :)/>