Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --farm buttons
- --edit 2, added more notes on what the scripts doing and cleaned up a bit.
- os.loadAPI("APIbutton") -- The name of the API
- m = peripheral.wrap("monitor_0") --Set where the monitor is on the network or state the side(top, left , right etc)
- m.clear()
- function fillTable() --name, function, active, position(left to right then top to bottom)
- APIbutton.setTable("Test1", test1, false, 10,20,3,5)
- APIbutton.setTable("Test2", test2, false, 22,32,3,5)
- APIbutton.setTable("Test3", test3, false, 10,20,8,10)
- APIbutton.setTable("Test4", test4, false, 22,32,8,10)
- APIbutton.screen()
- end
- function getClick()
- event,side,x,y = os.pullEvent("monitor_touch") --this line seems to have caused the problems on the copys out there.
- APIbutton.checkxy(x,y)
- end
- -- functions for all buttons to go here.
- function test1() -- a flash is a only on why pressing (think push button)
- APIbutton.flash("Test1")
- print("Test1 was a flash button")
- end
- function test2() --toggle is a on and off button (think lever)
- APIbutton.toggleButton("Test2")
- print("Test2 was a toggle button")
- end
- function test3()
- print("Test3")
- end
- function test4()
- print("Test4")
- end
- --End of button function area.
- fillTable()
- APIbutton.heading("Crop Control GUI") --heading at top of the page
- APIbutton.label(1,5,"Demo") --label at the left side of page.
- while true do
- getClick()
- end
Advertisement
Add Comment
Please, Sign In to add comment