Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ VARIABLES ]]--
- local mon = peripheral.wrap("top")
- local CowBool = false
- --[[ FUNCTIONS ]]--
- function MainButtons()
- button.setTable("Farm Menu", FarmMenu, 10, 20, 3, 5)
- button.setTable("Test2", main2, 22, 32, 3, 5)
- button.setTable("Test3", main3, 10, 20, 8, 10)
- button.setTable("Test4", main4, 22, 32, 8, 10)
- button.screen()
- end
- function getClick()
- event, side, x, y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function UpdateCowBool() --Currently unused, will remove later
- local filer = fs.open("buttonstates", "r")
- local ReadCow = filer.readLine()
- --CowBool = ReadCow()
- end
- function CheckCowBool() --Checks the file "buttonstates" for the boolean of the CowFarm, and tries to set CowBool to the current, correct state, defined in the file "buttonstates",
- local filer = fs.open("buttonstates", "r")
- local ReadCow = filer.readLine()
- CowBool = ReadCow()
- if ReadCow == "true" then
- button.toggleButton("Cow Farm")
- end
- filer.close()
- local filew = fs.open("buttonstates", "w")
- filew.writeLine(CowBool)
- filew.close()
- end
- function FarmButtons()
- button.setTable("Cow Farm", CowFarm, 10, 20, 3, 5)
- button.setTable("Blaze Farm", BlazeFarm, 22, 32, 3, 5)
- button.setTable("Back", back, 10, 17, 15, 17)
- button.screen()
- end
- function FarmMenu() --Clears the past(main) menu and runs/displays the "Farms" menu
- button.flash("Farm Menu")
- sleep(.1)
- button.clearTable()
- FarmButtons()
- button.heading("Farms")
- CheckCowBool()
- end
- function main2()
- --Do Stuff
- end
- function main3()
- --Do Stuff
- end
- function main4()
- --Do stuff
- end
- function back()
- button.flash("Back")
- button.clearTable()
- MainButtons()
- button.heading("N1ght Network")
- end
- function CowFarm()
- CowBool = not CowBool
- local filew = fs.open("buttonstates", "w")
- filew.writeLine(CowBool)
- filew.close()
- button.toggleButton("Cow Farm")
- rs.setBundledOutput("bottom", colors.white)
- end
- function BlazeFarm()
- --Toggle the BlazeFarm
- end
- function CheckWireStates()
- local filer = fs.open("buttonstates", "r")
- local ReadBool = filer.readLine()
- end
- --[[ MAIN ]]--
- os.loadAPI("button")
- mon.clear()
- MainButtons()
- button.heading("N1ght Network")
- CheckCowBool()
- while true do
- getClick()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement