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

Button Function Trouble

Started by Steelerman82, 20 July 2013 - 09:09 AM
Steelerman82 #1
Posted 20 July 2013 - 11:09 AM
I am having trouble with a function. Func1 should turn a button green, and send a redstone signal through a bundled cable to the white insulated wire out the back. I cannot get it to work. I've been trying things for 2 weeks now. I did not write the code, only edited parts and added to an existing code. any help is appreciated.


    os.loadAPI("button")
	m = peripheral.wrap("top")
	m.clear()
	
	function fillTable()
	   button.setTable("Test1", test1, 10,20,3,5)
	   button.setTable("Test2", test2, 22,32,3,5)
	   button.setTable("Test3", test3, 34,44,3,5)
	   button.setTable("Test4", test4, 10,20,8,10)
	   button.setTable("Test5", test5, 22,32,8,10)
	   button.setTable("Test6", test6, 34,44,8,10)
	   button.setTable("Test7", test7, 10,20,13,15)
	   button.setTable("Test8", test8, 22,32,13,15)
	   button.setTable("Test9", test9, 34,44,13,15)
	   button.setTable("Test10", test10, 10,20,18,20)
	   button.setTable("Test11", test11, 22,32,18,20)
	   button.setTable("Test12", test12, 34,44,18,20)
	   button.screen()
	end
	
	function getClick()
	   event,side,x,y = os.pullEvent("monitor_touch")
	   button.checkxy(x,y)
	end
	
	function test1()
	   button.toggleButton("Test1")
	   redstone.setBundledOutput("back", colors.white)
	   print("Test1")
	end
	
	function test2()
	   button.toggleButton("Test2")
	   print("Test2")
	end
	
	function test3()
	   button.toggleButton("Test3")
	   print("Test3")
	end
	
	function test4()
	   print("Test4")
	end
	
	fillTable()
	button.heading("Demo Button Prog")
	button.label(1,5,"Demo!")
	
	while true do
	   getClick()
	end
Edited by
Lyqyd #2
Posted 20 July 2013 - 11:14 PM
Split into new topic.