Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("button")
- m=peripheral.wrap("left")
- rednet.open("back")
- m.clear()
- function drawHeading()
- button.heading("--------- BaseControl v1.0 ---------")
- end
- function drawButtons()
- button.setTable("Sheep on",sheepon,3,13,3,5)
- button.setTable("Sheep off",sheepoff,16,26,3,5)
- button.setTable("Sugar on",sugaron,3,13,8,10)
- button.setTable("Sugar off",sugaroff,16,26,8,10)
- button.setTable("DigRig on",digon,30,40,3,5)
- button.setTable("DigRig off",digoff,43,53,3,5)
- button.setTable("XP on",xpon,30,40,8,10)
- button.setTable("XP off",xpoff,43,53,8,10)
- button.setTable("Meat on",meaton,57,67,3,5)
- button.setTable("Meat off",meatoff,70,80,3,5)
- button.screen()
- end
- function drawText()
- --button.label(x,y,"Sheep farm:")
- --button.label(x,y,"Sugar Cane farm:")
- --button.label(x,y,"Digging Rig:")
- --button.label(x,y,"XP Farm:")
- --button.label(x,y,"Meat Farm:")
- button.label(69,12,"by: dodedodo33")
- end
- function sheepon()
- button.flash("Sheep on")
- shell.run("redset","right","yellow","true")
- end
- function sheepoff()
- button.flash("Sheep off")
- shell.run("redset","right","yellow","false")
- end
- function sugaron()
- button.flash("Sugar on")
- shell.run("redset","right","red","true")
- end
- function sugaroff()
- button.flash("Sugar off")
- shell.run("redset","right","red","false")
- end
- function digon()
- button.flash("DigRig on")
- shell.run("redset","right","green","true")
- end
- function digoff()
- button.flash("DigRig off")
- shell.run("redset","right","green","false")
- end
- function xpon()
- button.flash("XP on")
- shell.run("redset","right","blue","false")
- end
- function xpoff()
- button.flash("XP off")
- shell.run("redset","right","blue","true")
- end
- function meaton()
- if meatactive == "inactive" then
- button.toggleButton("Meat on")
- shell.run("sendmsg","89","place")
- id,msg,dist = rednet.receive()
- meatactive = "active"
- button.toggleButton("Meat on")
- end
- end
- function meatoff()
- if meatactive == "active" then
- button.toggleButton("Meat off")
- shell.run("sendmsg","89","remove")
- id,msg,dist = rednet.receive()
- button.toggleButton("Meat off")
- meatactive = "inactive"
- end
- end
- function getClick()
- event,side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- drawHeading()
- drawText()
- drawButtons()
- while true do
- getClick()
- end
Advertisement
Add Comment
Please, Sign In to add comment