Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local w,h = term.getSize()
- local function draw()
- term.clear()
- term.setCursorPos(math.floor(w/2) - 11,1)
- print("Welcome to block caller")
- term.setCursorPos(math.floor(w/2) - 6,2)
- print("By AnthonyD98")
- term.setCursorPos(1,4)
- print("Blocks: ")
- print(" - basalt, basalt_cobble, marblebrick")
- print(" - cobblestone, stonebrick, brick, dirt")
- print(" - basaltbrick, sandstone, sand")
- end
- local blocks = {
- "basalt","basalt_cobble","marblebrick","cobblestone","stonebrick","brick","dirt","basaltbrick","sandstone","sand"
- }
- local bColor = {
- 512,2048,16348,4,16,2,32,8192,4096,8
- }
- while true do
- local cor = 0
- draw()
- term.setCursorPos(1,10)
- write("Please input the block you want >> ")
- iBlock = read()
- if iBlock == "exit" then
- term.clear()
- term.setCursorPos(1,1)
- return
- end
- write("Please input the ammount you want >> ")
- number = read()
- if number == "exit" then
- term.clear()
- term.setCursorPos(1,1)
- return
- end
- print("Matching input to color")
- for i,v in ipairs(blocks) do
- if iBlock == v then
- local cor = 1
- term.clear()
- term.setCursorPos(1,1)
- print("Block and Color Matched!")
- term.setCursorPos(1,2)
- print("Block = "..iBlock.." and color = "..tostring(bColor[tonumber(i)]))
- for j = 1,number do
- rs.setBundledOutput("back", bColor[i])
- sleep(0.500)
- rs.setBundledOutput("back", 0)
- sleep(0.500)
- term.setCursorPos(1,3)
- term.clearLine()
- print("Pulse: "..j)
- end
- else
- term.clear()
- term.setCursorPos(1,1)
- print("Matching Block to Cable")
- term.setCursorPos(1,2)
- print("Block = "..tostring(v).." and color = nil")
- sleep(.1)
- end
- end
- if cor == 0 then
- term.clear()
- term.setCursorPos(1,1)
- print("Invalid Block Selection")
- sleep(2)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement