Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Redpwr - v1.0.0 - Created by Sir.Mongoose!
- local s1 = 1 local s1p = 0 --x;11 y;8
- local s2 = 2 local s2p = 0 --x;11 y;10
- local s3 = 3 local s3p = 0 --x;11 y;12
- local s4 = 4 local s4p = 0 --x;33 y;8
- local s5 = 5 local s5p = 0 --x;33 y;10
- local s6 = 6 local s6p = 0 --x;33 y;12
- local x = 14 local y = 8
- local cur = 1
- function draw(p,x,y)
- if p == 0 then
- term.setCursorPos(x,y)
- write("OFF")
- elseif p > 0 then
- term.setCursorPos(x,y)
- write(" "..p)
- end
- end
- function signalP()
- if cur == 1 then
- x = 14
- y = 8
- elseif cur == 2 then
- x = 14
- y = 10
- elseif cur == 3 then
- x = 14
- y = 12
- elseif cur == 4 then
- x = 36
- y = 8
- elseif cur == 5 then
- x = 36
- y = 10
- elseif cur == 6 then
- x = 36
- y = 12
- end
- draw(s1p,10,8)
- draw(s2p,10,10)
- draw(s3p,10,12)
- draw(s4p,32,8)
- draw(s5p,32,10)
- draw(s6p,32,12)
- end
- function power()
- redstone.setAnalogOutput("front",s1p)
- redstone.setAnalogOutput("back",s2p)
- redstone.setAnalogOutput("left",s3p)
- redstone.setAnalogOutput("right",s4p)
- redstone.setAnalogOutput("top",s5p)
- redstone.setAnalogOutput("bottom",s6p)
- end
- function display()
- term.clear()
- term.setCursorPos(1,1)
- print("REDPWR v1.0.0")
- print("")
- print("CREATED BY SIR.MONGOOSE")
- term.setCursorPos(1,6)
- print("SIDES | SIGNAL SIDES | SIGNAL")
- print("============== ==============")
- print("FRONT | * RIGHT | * ")
- print("-------------- --------------")
- print("BACK | * TOP | * ")
- print("-------------- --------------")
- print("LEFT | * BOTTOM| * ")
- print("-------------- --------------")
- term.setCursorPos(1,16)
- print(" [PRESS BACKSPACE TO EXIT PROGRAM] ")
- print(" [USE ARROW KEYS TO NAVIGATE]")
- signalP()
- term.setCursorPos(x,y)
- write("*")
- end
- while true do
- display()
- power()
- local event, key = os.pullEvent()
- if key == keys.backspace then
- break
- elseif key == keys.right then
- if cur > 6 then
- cur = cur - 1
- else
- cur = cur + 1
- end
- if cur == 7 then
- cur = 6
- end
- elseif key == keys.left then
- if cur < 1 then
- cur = cur + 1
- else
- cur = cur - 1
- end
- if cur == 0 then
- cur = 1
- end
- elseif key == keys.up then
- if cur == 1 then
- if s1p ~= 15 then
- s1p = s1p + 1
- end
- elseif cur == 2 then
- if s2p ~= 15 then
- s2p = s2p + 1
- end
- elseif cur == 3 then
- if s3p ~= 15 then
- s3p = s3p + 1
- end
- elseif cur == 4 then
- if s4p ~= 15 then
- s4p = s4p + 1
- end
- elseif cur == 5 then
- if s5p ~= 15 then
- s5p = s5p + 1
- end
- elseif cur == 6 then
- if s6p ~= 15 then
- s6p = s6p + 1
- end
- end
- elseif key == keys.down then
- if cur == 1 then
- if s1p ~= 0 then
- s1p = s1p - 1
- end
- elseif cur == 2 then
- if s2p ~= 0 then
- s2p = s2p - 1
- end
- elseif cur == 3 then
- if s3p ~= 0 then
- s3p = s3p - 1
- end
- elseif cur == 4 then
- if s4p ~= 0 then
- s4p = s4p - 1
- end
- elseif cur == 5 then
- if s5p ~= 0 then
- s5p = s5p - 1
- end
- elseif cur == 6 then
- if s6p ~= 0 then
- s6p = s6p - 1
- end
- end
- end
- end
- term.setCursorPos(1,1)
- term.clear()
- redstone.setAnalogOutput("front",0)
- redstone.setAnalogOutput("back",0)
- redstone.setAnalogOutput("left",0)
- redstone.setAnalogOutput("right",0)
- redstone.setAnalogOutput("top",0)
- redstone.setAnalogOutput("bottom",0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement