Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Custom monitor program 0-0-3
- -- Works with: Advanced Computer & Monitor
- -- Environment Tested: Minecraft 1.6.4 Computer Craft version 1.5
- -- By RCMilkshakebunny @
- -- Download this file here >> http://pastebin.com/fBKRSMqN
- -- ##########################
- -- DEFINE VARIABLES -- BEGIN
- -- Define peripheral monitor side
- m = peripheral.wrap("monitor_19")
- -- DEFINE VARIABLES -- END
- -- ##########################
- -- ##########################
- -- FUNCTIONS - BEGIN
- -- set the cursor position on the monitor ready to write
- -- in this case 1,1 means the first line at the first character. so for western based code that would be TOP,LEFT
- -- if we were to put (5,10) then the cursor would begin at the 5th line down and the 10th character position in from the left
- -- in this case the function requires the value to be given in the call
- function cursor(p1,p2)
- m.setCursorPos(p1,p2)
- end
- -- clear any content on the monitor function
- function clearMon()
- m.clear()
- end
- -- set text color function
- function textColor(setTo)
- -- set the color the text will be
- -- in this case blue
- -- the choices: white | orange | magenta | lightBlue | yellow | lime | pink | gray
- -- contd.. | lightGray | cyan | purple | blue | brown | green | red | black
- -- you can also reference colors by a 'decimal value' without the requirement of the use of 'colors'
- -- an example of referencing a color for text by decimal is
- -- m.setTextColor(512) and this would produce the same result as m.setTextColor(colors.cyan)
- -- m.setTextColor(colors.blue) -- << basic usage
- m.setTextColor(setTo)-- << dynamic usage
- end
- -- write to monitor function
- function monitorWrite(txt)
- m.write(txt)
- end
- -- monitor set new line
- function nl()
- local _,cY= m.getCursorPos()
- m.setCursorPos(1,cY+1)
- end
- -- Monitor Center text
- function monCenterText(text)
- local x,y = m.getSize()
- local x2,y2 = m.getCursorPos()
- m.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
- m.write(text)
- end
- --initialise monitor function
- function mInit()
- clearMon()
- cursor(1,1)
- textColor(512)
- end
- -- ##########################
- -- TERMINAL FUNCTIONS -- BEGIN
- -- clears terminal
- function clearTerm()
- term.clear()
- end
- -- writes to the terminal
- function writeTerm(termtext)
- term.write(termtext)
- end
- -- set terminal cursor position -- Dynamic
- function termCursor(p1,p2)
- term.setCursorPos(p1,p2)
- end
- -- terminal set new line
- function term_nl()
- local _,cY= term.getCursorPos()
- term.setCursorPos(1,cY+1)
- end
- -- TERMINAL FUNCTIONS -- END
- -- ##########################
- -- ##########################
- -- PAGES BEGIN
- function bottomSec()
- nl()
- monitorWrite(" /survival - /pvp - /factions - /games ")
- end
- function bottomBar()
- nl()
- nl()
- nl()
- monitorWrite(" Welcome to RC-Tekkit ")
- nl()
- monitorWrite(" - /warp from the hub to the game you want to play.")
- nl()
- m.setTextColor(32)
- monitorWrite(" Open: /survival")
- nl()
- m.setTextColor(128)
- monitorWrite(" - Closed: /pvp /factions /games (In development) ")
- nl()
- monitorWrite(" Type /warp followed by the gametype. Ex. /warp survival")
- end
- function page1()
- nl()
- monitorWrite("--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--")
- nl()
- monitorWrite(" _______ ______ _ __ _ __ _____ _______ ")
- nl()
- monitorWrite(" |__ __|| ____|| |/ /| |/ /|_ _||__ __| ")
- nl()
- monitorWrite(" | | | |__ | ' / | ' / | | | | ")
- nl()
- monitorWrite(" | | | __| | < | < | | | | ")
- nl()
- monitorWrite(" | | | |____ | . \\ | . \\ _| |_ | | ")
- nl()
- monitorWrite(" |_| |______||_|\\_\\|_|\\_\\|_____| |_| ")
- nl()
- nl()
- monitorWrite("..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..")
- bottomSec()
- bottomBar()
- end
- function page2()
- nl()
- monitorWrite("..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..")
- nl()
- monitorWrite(" _______ ______ _ __ _ __ _____ _______ ")
- nl()
- monitorWrite(" |__ __|| ____|| |/ /| |/ /|_ _||__ __| ")
- nl()
- monitorWrite(" | | | |__ | ' / | ' / | | | | ")
- nl()
- monitorWrite(" | | | __| | < | < | | | | ")
- nl()
- monitorWrite(" | | | |____ | . \\ | . \\ _| |_ | | ")
- nl()
- monitorWrite(" |_| |______||_|\\_\\|_|\\_\\|_____| |_| ")
- nl()
- nl()
- monitorWrite("--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--")
- bottomSec()
- bottomBar()
- end
- function page3()
- nl()
- monitorWrite("--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--")
- nl()
- monitorWrite(" _______ ______ _ __ _ __ _____ _______ ")
- nl()
- monitorWrite(" |__ __|| ____|| |/ /| |/ /|_ _||__ __| ")
- nl()
- monitorWrite(" | | | |__ | ' / | ' / | | | | ")
- nl()
- monitorWrite(" | | | __| | < | < | | | | ")
- nl()
- monitorWrite(" | | | |____ | . \\ | . \\ _| |_ | | ")
- nl()
- monitorWrite(" |_| |______||_|\\_\\|_|\\_\\|_____| |_| ")
- nl()
- nl()
- monitorWrite("..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..")
- bottomSec()
- bottomBar()
- end
- function page4()
- nl()
- monitorWrite("..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..")
- nl()
- monitorWrite(" _______ ______ _ __ _ __ _____ _______ ")
- nl()
- monitorWrite(" |__ __|| ____|| |/ /| |/ /|_ _||__ __| ")
- nl()
- monitorWrite(" | | | |__ | ' / | ' / | | | | ")
- nl()
- monitorWrite(" | | | __| | < | < | | | | ")
- nl()
- monitorWrite(" | | | |____ | . \\ | . \\ _| |_ | | ")
- nl()
- monitorWrite(" |_| |______||_|\\_\\|_|\\_\\|_____| |_| ")
- nl()
- nl()
- monitorWrite("--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--")
- bottomSec()
- bottomBar()
- end
- function page5()
- nl()
- monitorWrite("--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--")
- nl()
- monitorWrite(" _______ ______ _ __ _ __ _____ _______ ")
- nl()
- monitorWrite(" |__ __|| ____|| |/ /| |/ /|_ _||__ __| ")
- nl()
- monitorWrite(" | | | |__ | ' / | ' / | | | | ")
- nl()
- monitorWrite(" | | | __| | < | < | | | | ")
- nl()
- monitorWrite(" | | | |____ | . \\ | . \\ _| |_ | | ")
- nl()
- monitorWrite(" |_| |______||_|\\_\\|_|\\_\\|_____| |_| ")
- nl()
- nl()
- monitorWrite("..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..")
- bottomSec()
- bottomBar()
- end
- function page6()
- nl()
- monitorWrite("..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..")
- nl()
- monitorWrite(" _______ ______ _ __ _ __ _____ _______ ")
- nl()
- monitorWrite(" |__ __|| ____|| |/ /| |/ /|_ _||__ __| ")
- nl()
- monitorWrite(" | | | |__ | ' / | ' / | | | | ")
- nl()
- monitorWrite(" | | | __| | < | < | | | | ")
- nl()
- monitorWrite(" | | | |____ | . \\ | . \\ _| |_ | | ")
- nl()
- monitorWrite(" |_| |______||_|\\_\\|_|\\_\\|_____| |_| ")
- nl()
- nl()
- monitorWrite("--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--")
- bottomSec()
- bottomBar()
- end
- function page7()
- nl()
- monitorWrite("--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--")
- nl()
- monitorWrite(" _______ ______ _ __ _ __ _____ _______ ")
- nl()
- monitorWrite(" |__ __|| ____|| |/ /| |/ /|_ _||__ __| ")
- nl()
- monitorWrite(" | | | |__ | ' / | ' / | | | | ")
- nl()
- monitorWrite(" | | | __| | < | < | | | | ")
- nl()
- monitorWrite(" | | | |____ | . \\ | . \\ _| |_ | | ")
- nl()
- monitorWrite(" |_| |______||_|\\_\\|_|\\_\\|_____| |_| ")
- nl()
- nl()
- monitorWrite("..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..")
- bottomSec()
- bottomBar()
- end
- function page8()
- nl()
- monitorWrite("..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..")
- nl()
- monitorWrite(" _______ ______ _ __ _ __ _____ _______ ")
- nl()
- monitorWrite(" |__ __|| ____|| |/ /| |/ /|_ _||__ __| ")
- nl()
- monitorWrite(" | | | |__ | ' / | ' / | | | | ")
- nl()
- monitorWrite(" | | | __| | < | < | | | | ")
- nl()
- monitorWrite(" | | | |____ | . \\ | . \\ _| |_ | | ")
- nl()
- monitorWrite(" |_| |______||_|\\_\\|_|\\_\\|_____| |_| ")
- nl()
- nl()
- monitorWrite("--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--..--")
- bottomSec()
- bottomBar()
- end
- function leftRight()
- mInit()
- page1()
- sleep(0.1)
- mInit()
- page2()
- sleep(0.1)
- mInit()
- page3()
- sleep(0.1)
- mInit()
- page4()
- sleep(0.1)
- mInit()
- page5()
- sleep(0.1)
- mInit()
- page6()
- sleep(0.1)
- mInit()
- page7()
- sleep(0.1)
- mInit()
- page8()
- sleep(0.1)
- end
- function rightLeft()
- mInit()
- page8()
- sleep(0.1)
- mInit()
- page7()
- sleep(0.1)
- mInit()
- page6()
- sleep(0.1)
- mInit()
- page5()
- sleep(0.1)
- mInit()
- page4()
- sleep(0.1)
- mInit()
- page3()
- sleep(0.1)
- mInit()
- page2()
- sleep(0.1)
- mInit()
- page1()
- sleep(0.1)
- end
- -- PAGES - END
- -- ##########################
- -- ##########################
- -- SCENES -- BEGIN
- function scene1()
- leftRight()
- rightLeft()
- leftRight()
- rightLeft()
- leftRight()
- rightLeft()
- leftRight()
- rightLeft()
- end
- -- SCENES -- END
- -- ##########################
- -- the program function
- function program()
- -- ##########################
- -- PROGRAM OUTPUT - BEGIN
- clearTerm()
- termCursor(1,1)
- writeTerm("Program Running")
- term_nl()
- while true do
- scene1()
- end
- -- Test Output to Monitor
- -- monitorWrite("Monitor write completed")
- -- nl()
- -- monCenterText("Centered Text")
- -- nl()
- -- Test output to Terminal
- -- writeTerm("Terminal write completed")
- -- term_nl()
- -- PROGRAM OUTPUT - END
- -- ##########################
- end
- -- FUNCTIONS -- END
- -- ##########################
- -- ############################################################
- -- ############################################################
- -- ##########################
- -- SEQUENCE -- BEGIN
- mInit()
- program()
- -- SEQUENCE -- END
- -- ##########################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement