Jump to content




Button Function Trouble


  • You cannot reply to this topic
1 reply to this topic

#1 Steelerman82

  • Members
  • 3 posts

Posted 20 July 2013 - 10: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, 20 July 2013 - 10:13 PM.
added code tags


#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 20 July 2013 - 10:14 PM

Split into new topic.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users