Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- xc,yc = term.getCursorPos()
- back = colors.black
- args = {...}
- function dfb(x1,x2,y1,y2, c)
- paintutils.drawFilledBox(x1,x2,y1,y2,c)
- end
- function hKK(c0,c1,c2,c3,c4)
- c0=tonumber(c0)
- c1=tonumber(c1)
- c2=tonumber(c2)
- c3=tonumber(c3)
- if c4 == "white" then
- dfb(c0,c1,c2,c3,colors.white)
- elseif c4 == "magenta" then
- dfb(c0,c1,c2,c3,colors.magenta)
- elseif c4 == "light_blue" then
- dfb(c0,c1,c2,c3,colors.lightBlue)
- elseif c4 == "yellow" then
- dfb(c0,c1,c2,c3,colors.yellow)
- elseif c4 == "lime" then
- dfb(c0,c1,c2,c3,colors.lime)
- elseif c4 == "pink" then
- dfb(c0,c1,c2,c3,colors.pink)
- elseif c4 == "gray" then
- dfb(c0,c1,c2,c3,colors.gray)
- elseif c4 == "light_gray" then
- dfb(c0,c1,c2,c3,colors.lightGray)
- elseif c4 == "cyan" then
- dfb(c0,c1,c2,c3,colors.cyan)
- elseif c4 == "purple" then
- dfb(c0,c1,c2,c3,colors.purple)
- elseif c4 == "blue" then
- dfb(c0,c1,c2,c3,colors.blue)
- elseif c4 == "brown" then
- dfb(c0,c1,c2,c3,colors.brown)
- elseif c4 == "green" then
- dfb(c0,c1,c2,c3,colors.green)
- elseif c4 == "red" then
- dfb(c0,c1,c2,c3,colors.red)
- elseif c4 == "black" then
- dfb(c0,c1,c2,c3,colors.black)
- elseif c4 == "orange" then
- dfb(c0,c1,c2,c3,colors.orange)
- end
- end
- f = fs.open(args[1], "r")
- for line in f.readLine do
- term.setBackgroundColor(back)
- if line:find("sleep:") then
- parse = line:gsub("sleep:", "")
- sleep(tonumber(parse))
- end
- if line:find("background=") then
- parse = line:gsub("background=", "")
- w, h = term.getSize()
- if parse == "white" then
- dfb(1,1,w,h,colors.white)
- elseif parse == "magenta" then
- dfb(1,1,w,h,colors.magenta)
- elseif parse == "light_blue" then
- dfb(1,1,w,h,colors.lightBlue)
- elseif parse == "yellow" then
- dfb(1,1,w,h,colors.yellow)
- elseif parse == "lime" then
- dfb(1,1,w,h,colors.lime)
- elseif parse == "pink" then
- dfb(1,1,w,h,colors.pink)
- elseif parse == "gray" then
- dfb(1,1,w,h,colors.gray)
- elseif parse == "light_gray" then
- dfb(1,1,w,h,colors.lightGray)
- elseif parse == "cyan" then
- dfb(1,1,w,h,colors.cyan)
- elseif parse == "purple" then
- dfb(1,1,w,h,colors.purple)
- elseif parse == "blue" then
- dfb(1,1,w,h,colors.blue)
- elseif parse == "brown" then
- dfb(1,1,w,h,colors.brown)
- elseif parse == "green" then
- dfb(1,1,w,h,colors.green)
- elseif parse == "red" then
- dfb(1,1,w,h,colors.red)
- elseif parse == "black" then
- dfb(1,1,w,h,colors.black)
- elseif parse == "orange" then
- dfb(1,1,w,h,colors.orange)
- end
- end
- if line:find("background_color=") then
- parse = line:gsub("background_color=", "")
- term.setCursorPos(9,9)
- if parse == "white" then
- term.setBackgroundColor(colors.white)
- back=colors.white
- elseif parse == "magenta" then
- term.setBackgroundColor(colors.magenta)
- back=colors.magenta
- elseif parse == "light_blue" then
- term.setBackgroundColor(colors.lightBlue)
- back=colors.lightBlue
- elseif parse == "yellow" then
- term.setBackgroundColor(colors.yellow)
- back=colors.yellow
- elseif parse == "lime" then
- term.setBackgroundColor(colors.lime)
- back=colors.lime
- elseif parse == "pink" then
- term.setBackgroundColor(colors.pink)
- back=colors.pink
- elseif parse == "gray" then
- term.setBackgroundColor(colors.gray)
- back=colors.gray
- elseif parse == "light_gray" then
- term.setBackgroundColor(colors.lightGray)
- back=colors.lightGray
- elseif parse == "cyan" then
- term.setBackgroundColor(colors.cyan)
- back=colors.cyan
- elseif parse == "purple" then
- term.setBackgroundColor(colors.purple)
- back=colors.purple
- elseif parse == "blue" then
- term.setBackgroundColor(colors.blue)
- back=colors.blue
- elseif parse == "brown" then
- term.setBackgroundColor(colors.brown)
- back=colors.brown
- elseif parse == "green" then
- term.setBackgroundColor(colors.green)
- back=colors.green
- elseif parse == "red" then
- term.setBackgroundColor(colors.red)
- back=colors.red
- elseif parse == "black" then
- term.setBackgroundColor(colors.black)
- back=colors.black
- elseif parse == "orange" then
- term.setBackgroundColor(colors.orange)
- back=colors.orange
- end
- end
- if line:find("box=") then
- parse = line:gsub("box=", "") .. " "
- c = {}
- c2 = 0
- c[c2] = ""
- for i7 = 1, #parse do
- local char = parse:sub(i7,i7)
- -- do something with c
- if char == " " then
- d = c[c2]:gsub(' ', '')
- c2 = c2 + 1
- c[c2] = ""
- end
- c[c2] = c[c2] .. char
- end
- c21 = tostring(c[0]):gsub(' ', '')
- c22 = tostring(c[1]):gsub(' ', '')
- c23 = tostring(c[2]):gsub(' ', '')
- c24 = tostring(c[3]):gsub(' ', '')
- c25 = tostring(c[4]):gsub(' ', '')
- hKK(c21,c22,c23,c24,c25)
- end
- if line:find("text=") then
- parse = line:gsub("text=", "") .. " "
- c = {}
- c2 = 0
- c[c2] = ""
- for i7 = 1, #parse do
- local char = parse:sub(i7,i7)
- -- do something with c
- if char == " " then
- d = c[c2]:gsub(' ', '')
- c2 = c2 + 1
- c[c2] = ""
- end
- c[c2] = c[c2] .. char
- end
- term.setCursorPos(tonumber(c[0]), tonumber(c[1]))
- if c[3] == "white" then
- term.setTextColor(colors.white)
- elseif c[3] == "magenta" then
- term.setTextColor(colors.magenta)
- elseif c[3] == "light_blue" then
- term.setTextColor(colors.lightBlue)
- elseif c[3] == "yellow" then
- term.setTextColor(colors.yellow)
- elseif c[3] == "lime" then
- term.setTextColor(colors.lime)
- elseif c[3] == "pink" then
- term.setTextColor(colors.pink)
- elseif c[3] == "gray" then
- term.setTextColor(colors.gray)
- elseif c[3] == "light_gray" then
- term.setTextColor(colors.lightGray)
- elseif c[3] == "cyan" then
- term.setTextColor(colors.cyan)
- elseif c[3] == "purple" then
- term.setTextColor(colors.purple)
- elseif c[3] == "blue" then
- term.setTextColor(colors.blue)
- elseif c[3] == "brown" then
- term.setTextColor(colors.brown)
- elseif c[3] == "green" then
- term.setTextColor(colors.green)
- elseif c[3] == "red" then
- term.setTextColor(colors.red)
- elseif c[3] == "black" then
- term.setTextColor(colors.black)
- elseif c[3] == "orange" then
- term.setTextColor(colors.orange)
- end
- term.write(c[2])
- end
- end
- f.close()
- term.setCursorPos(xc,yc)
Advertisement
Add Comment
Please, Sign In to add comment