SHOW:
|
|
- or go back to the newest paste.
| 1 | os.loadAPI("button")
| |
| 2 | - | m = peripheral.wrap("top")
|
| 2 | + | m = peripheral.wrap("monitor_2")
|
| 3 | p = peripheral.wrap("back")
| |
| 4 | bank = peripheral.wrap("blockcapacitorbank_3")
| |
| 5 | m.clear() | |
| 6 | ||
| 7 | - | button.setTable("Peat",peat,3,17,1,3)
|
| 7 | + | energy = bank.getEnergyStored("left")
|
| 8 | - | button.setTable("Pumpkin",pumpkin,3,17,5,7)
|
| 8 | + | mj = bank.getMJStored("left")
|
| 9 | - | button.setTable("Melon",melon,3,17,9,11)
|
| 9 | + | mjmax = bank.getMaxMJReceived("left")
|
| 10 | - | button.setTable("Netherwart",netherwart,3,17,13,15)
|
| 10 | + | |
| 11 | - | button.setTable("Wheat 1",wheat1,3,17,17,19)
|
| 11 | + | |
| 12 | - | button.setTable("Wheat 2",wheat2,23,37,1,3)
|
| 12 | + | button.setTable("Refuel",refuel,3,17,1,3)
|
| 13 | - | button.setTable("Oak",oak,23,37,5,7)
|
| 13 | + | button.setTable("Cancel",cancel,3,17,5,7)
|
| 14 | - | button.setTable("Birch",birch,23,37,9,11)
|
| 14 | + | |
| 15 | - | button.setTable("Spruce",spruce,23,37,13,15)
|
| 15 | + | |
| 16 | - | button.setTable("Jungle",jungle,23,37,17,19)
|
| 16 | + | |
| 17 | function getClick() | |
| 18 | event,side,x,y = os.pullEvent("monitor_touch")
| |
| 19 | button.checkxy(x, y) | |
| 20 | end | |
| 21 | ||
| 22 | function pulse() | |
| 23 | redstone.setOutput("back", true)
| |
| 24 | end | |
| 25 | ||
| 26 | function pulse1() | |
| 27 | redstone.setOutput("back", true)
| |
| 28 | sleep(0,5) | |
| 29 | redstone.setOutput("back", false)
| |
| 30 | end | |
| 31 | - | function peat() |
| 31 | + | |
| 32 | - | button.toggleButton("Peat")
|
| 32 | + | |
| 33 | - | p.setFreq(151) |
| 33 | + | function refuel() |
| 34 | - | pulse() |
| 34 | + | button.toggleButton("Refuel")
|
| 35 | p.setFreq(301) | |
| 36 | pulse1() | |
| 37 | - | function pumpkin() |
| 37 | + | |
| 38 | - | button.toggleButton("Pumpkin")
|
| 38 | + | |
| 39 | - | p.setFreq(152) |
| 39 | + | function cancel() |
| 40 | - | pulse() |
| 40 | + | button.toggleButton("Cancel")
|
| 41 | p.setFreq(302) | |
| 42 | pulse1() | |
| 43 | - | function melon() |
| 43 | + | |
| 44 | - | button.toggleButton("Melon")
|
| 44 | + | |
| 45 | - | p.setFreq(153) |
| 45 | + | |
| 46 | - | pulse() |
| 46 | + | |
| 47 | ||
| 48 | while true do | |
| 49 | - | function netherwart() |
| 49 | + | |
| 50 | - | button.toggleButton("Netherwart")
|
| 50 | + | getClick() |
| 51 | - | p.setFreq(154) |
| 51 | + | |
| 52 | - | pulse() |
| 52 | + | m.setTextColor(colors.white) |
| 53 | m.write("POWER MANAGEMENT V3")
| |
| 54 | m.setCursorPos(1,3) | |
| 55 | - | function wheat1() |
| 55 | + | m.write("RF:" ..energy)
|
| 56 | - | button.toggleButton("Wheat 1")
|
| 56 | + | m.setCursorPos(1,5) |
| 57 | - | p.setFreq(155) |
| 57 | + | |
| 58 | - | pulse() |
| 58 | + | end |