SHOW:
|
|
- or go back to the newest paste.
| 1 | os.loadAPI("button")
| |
| 2 | - | m = peripheral.wrap("right")
|
| 2 | + | local m = peripheral.wrap("monitor_0")
|
| 3 | - | m.clear |
| 3 | + | m.clear() |
| 4 | ||
| 5 | function newTouchMenu() | |
| 6 | - | button.setTabel("Main Menu", mainMenu, 17, 18, 14, 24)
|
| 6 | + | m.clear() |
| 7 | - | button.setTabel("MobSpawner", mobSpawner, 7, 9, 3, 11)
|
| 7 | + | m.setBackgroundColor(colors.black) |
| 8 | - | button.setTabel("BaseStatus", baseStatus, 7, 9, 15, 23)
|
| 8 | + | m.setTextColor(colors.white) |
| 9 | - | button.setTabel("SpawnWither", spawnWither, 7, 9, 27, 35)
|
| 9 | + | |
| 10 | - | button.setTabel("Blank1", blank1, 3, 5, 15, 23)
|
| 10 | + | |
| 11 | - | button.setTabel("Blank2", blank2, 11, 13, 15, 23)
|
| 11 | + | |
| 12 | function fillTable() | |
| 13 | newTouchMenu() | |
| 14 | - | function getClick() |
| 14 | + | button.clearTable() |
| 15 | - | event,side,x,y = os.pullEvent("monitor_touch")
|
| 15 | + | button.setTable("HouseControl", houseControl, 4,26 ,3,6)
|
| 16 | - | button.check(x,y) |
| 16 | + | button.setTable("N/A", na, 4,26 ,9,12)
|
| 17 | button.setTable("N/A2", na2, 4,26 ,14,17)
| |
| 18 | - | function mobSpawner() |
| 18 | + | button.setTable("Menu", mainMenu, 2,28, 19,20)
|
| 19 | - | button.flash("MobSpawner")
|
| 19 | + | print("Main Menu Filled")
|
| 20 | button.screen() | |
| 21 | end | |
| 22 | - | function spawnWither() |
| 22 | + | |
| 23 | - | button.flash("SpawnWither")
|
| 23 | + | function houseControl() |
| 24 | button.flash("HouseControl")
| |
| 25 | newTouchMenu() | |
| 26 | button.clearTable() | |
| 27 | - | button.flash("MainMenu")
|
| 27 | + | button.setTable("Obsidian Collection", oC, 4,26 ,2,6)
|
| 28 | button.setTable("Energy Status", energyStatus, 4,26 ,8,12)
| |
| 29 | button.setTable("Menu", mainMenu, 2,28, 19,20)
| |
| 30 | - | function baseStatus() |
| 30 | + | button.setTable("N/A", na, 4,26 ,14,17)
|
| 31 | - | button.flash("BaseStatus")
|
| 31 | + | print("House Control Filled")
|
| 32 | button.screen() | |
| 33 | end | |
| 34 | - | function blank1() |
| 34 | + | |
| 35 | - | button.toggleButton("Blank1")
|
| 35 | + | function na() |
| 36 | button.flash("N/A")
| |
| 37 | print("I do nothing; Hurray!")
| |
| 38 | - | function blank2() |
| 38 | + | |
| 39 | - | button.toggleButton("Blank2")
|
| 39 | + | |
| 40 | - | end |
| 40 | + | function na2() |
| 41 | button.flash("N/A2")
| |
| 42 | print("I do nothing 2; Hurray!")
| |
| 43 | end | |
| 44 | ||
| 45 | function oC() | |
| 46 | button.toggleButton("Obsidian Collection")
| |
| 47 | rednet.send(63, "oc") | |
| 48 | end | |
| 49 | ||
| 50 | function mainMenu() | |
| 51 | button.flash("Menu")
| |
| 52 | m.clear() | |
| 53 | fillTable() | |
| 54 | -- refresh() | |
| 55 | end | |
| 56 | ||
| 57 | ||
| 58 | function energyStatus() | |
| 59 | button.flash("Energy Status")
| |
| 60 | m.clear() | |
| 61 | sleep(.1) | |
| 62 | m.setCursorPos(6,10) | |
| 63 | m.setTextScale(1) | |
| 64 | m.setTextColor(colors.white) | |
| 65 | m.write("Loading Information")
| |
| 66 | sleep(.5) | |
| 67 | m.clear() | |
| 68 | m.write("Loading Information.")
| |
| 69 | sleep(.5) | |
| 70 | m.clear() | |
| 71 | m.write("Loading Information..")
| |
| 72 | sleep(.5) | |
| 73 | m.clear() | |
| 74 | m.write("Loading Information...")
| |
| 75 | sleep(.5) | |
| 76 | m.clear() | |
| 77 | button.clearTable() | |
| 78 | button.setTable("Refresh", refresh, 2,28,0,2)
| |
| 79 | button.setTable("Menu", mainMenu, 2,28, 19,20)
| |
| 80 | button.screen() | |
| 81 | m.setTextScale(1.4) | |
| 82 | m.setCursorPos(0,10) | |
| 83 | button.centerText("Power : ..en")
| |
| 84 | m.setCursorPos(21,3) | |
| 85 | end | |
| 86 | ||
| 87 | ||
| 88 | function getPower() | |
| 89 | c = peripheral.wrap("right")
| |
| 90 | while true do | |
| 91 | en = c.getEnergyStored("south")
| |
| 92 | sleep(.1) | |
| 93 | end | |
| 94 | end | |
| 95 | ||
| 96 | ||
| 97 | function lockScreen() | |
| 98 | m.clear() | |
| 99 | button.clearTable() | |
| 100 | m.setTextColor(colors.red) | |
| 101 | m.setCursorPos(3,9) | |
| 102 | button.centerText("Locked")
| |
| 103 | m.setCursorPos(6,10) | |
| 104 | m.write("Unlock with Digitizer")
| |
| 105 | m.setCursorPos(3,11) | |
| 106 | m.write("Given by Owner EliteGaming")
| |
| 107 | end | |
| 108 | ||
| 109 | ||
| 110 | local function getClick() | |
| 111 | while true do | |
| 112 | local _,_,x,y = os.pullEvent("monitor_touch")
| |
| 113 | button.checkxy(x,y) | |
| 114 | end | |
| 115 | end | |
| 116 | ||
| 117 | local function rednetReceiver() | |
| 118 | while true do | |
| 119 | local senderID, message = rednet.receive() | |
| 120 | if senderID == 62 then | |
| 121 | if message == "unlock" then | |
| 122 | fillTable() | |
| 123 | ||
| 124 | elseif message == "lock" then | |
| 125 | lockScreen() | |
| 126 | ||
| 127 | elseif message == "oc" then | |
| 128 | rednet.send(63, "oc") | |
| 129 | end | |
| 130 | end | |
| 131 | end | |
| 132 | end | |
| 133 | ||
| 134 | function refresh() | |
| 135 | button.flash("Refresh")
| |
| 136 | button.screen() | |
| 137 | end | |
| 138 | ||
| 139 | fillTable() | |
| 140 | -- refresh() | |
| 141 | rednet.open("front")
| |
| 142 | ||
| 143 | parallel.waitForAny(getClick, rednetReceiver) |