Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.find("monitor")
- sg = peripheral.find("stargate")
- mon.setBackgroundColor(colors.black)
- mon.clear()
- maxEng = 90000
- dialling = {}
- local function alarmSet(set)
- rs.setOutput("left", set)
- return
- end
- function drawChevrons() --draws cheyvrons on the screen
- x,y = mon.getSize()
- chevX1 = x/3
- chevX2 = x/3*2+1
- chevY1 = y/3-2
- chevY2 = y/3*2 +2
- mon.setBackgroundColor(colors.black)
- for yc = chevY1-2, chevY2-2 do
- for xc = chevX1-2, chevX2-2 do
- mon.setCursorPos(xc, yc)
- mon.write(" ")
- end
- end
- mon.setBackgroundColor(colors.lightGray)
- for i = chevX1+2, chevX2-2 do
- mon.setCursorPos(i,chevY1)
- mon.write(" ")
- end
- for i = chevX1+2, chevX2-2 do
- mon.setCursorPos(i,chevY2)
- mon.write(" ")
- end
- for i = chevY1+2, chevY2-2 do
- mon.setCursorPos(chevX1,i)
- mon.write(" ")
- end
- for i = chevY1+2, chevY2-2 do
- mon.setCursorPos(chevX2, i)
- mon.write(" ")
- end
- chev1pos = {chevX1, chevY2 }
- mon.setBackgroundColor(colors.gray)
- mon.setTextColor(colors.black)
- mon.setCursorPos(math.floor(chev1pos[1]), math.floor(chev1pos[2])-1)
- mon.write(" > ")
- chev2pos = {chevX1, chevY1 + ((chevY2 - chevY1) / 2) }
- mon.setCursorPos(math.floor(chev2pos[1]-1), math.floor(chev2pos[2]))
- mon.write(" > ")
- chev3pos = {chevX1, chevY1 }
- mon.setCursorPos(math.floor(chev3pos[1]), math.floor(chev3pos[2]+1))
- mon.write(" > ")
- chev4pos = {chevX1 + ((chevX2 - chevX1) / 2), chevY1 }
- mon.setCursorPos(math.floor(chev4pos[1]-1), math.floor(chev4pos[2]))
- mon.write(" V ")
- chev5pos = {chevX2, chevY1 }
- mon.setCursorPos(math.floor(chev5pos[1]-2), math.floor(chev5pos[2])+1)
- mon.write(" < ")
- chev6pos = {chevX2, chevY1 + ((chevY2 - chevY1) / 2) }
- mon.setCursorPos(math.floor(chev6pos[1]-1), math.floor(chev6pos[2]))
- mon.write(" < ")
- chev7pos = {chevX2, chevY2 }
- mon.setCursorPos(math.floor(chev7pos[1]-2), math.floor(chev7pos[2]-1))
- mon.write(" < ")
- chev8pos = {chevX1 + ((chevX2 - chevX1) /2), chevY2 }
- mon.setCursorPos(math.floor(chev8pos[1]-1), math.floor(chev8pos[2]))
- mon.write(" ")
- -- chev9pos = {chevX1 + ((chevX2 - chevX1) /2), chevY2 }
- -- mon.setCursorPos(math.floor(chev8pos[1]-1), chevY1 + ((chevY2 - chevY1) / 2))
- -- mon.write(" 9 ")
- mon.setBackgroundColor(colors.black)
- mon.setCursorPos(x/2 - 4, y/2 - 1)
- mon.write(" ")
- mon.setCursorPos(x/2-1, y/2+4)
- mon.write(" ")
- end
- function drawChev( chevInfo )
- mon.setBackgroundColor(colors.gray)
- x,y = mon.getSize()
- chevX1 = x/3
- chevX2 = x/3*2+1
- chevY1 = y/3-2
- chevY2 = y/3*2 +2
- if chevInfo[1] == 1 then
- chev1pos = {chevX1, chevY2 }
- mon.setBackgroundColor(colors.gray)
- mon.setCursorPos(math.floor(chev1pos[1]), math.floor(chev1pos[2])-1)
- mon.write(" "..chevInfo[2].." ")
- elseif chevInfo[1] == 2 then
- chev2pos = {chevX1, chevY1 + ((chevY2 - chevY1) / 2) }
- mon.setCursorPos(math.floor(chev2pos[1]-1), math.floor(chev2pos[2]))
- mon.write(" "..chevInfo[2].." ")
- elseif chevInfo[1] == 3 then
- chev3pos = {chevX1, chevY1 }
- mon.setCursorPos(math.floor(chev3pos[1]), math.floor(chev3pos[2]+1))
- mon.write(" "..chevInfo[2].." ")
- elseif chevInfo[1] == 4 then
- chev4pos = {chevX1 + ((chevX2 - chevX1) / 2), chevY1 }
- mon.setCursorPos(math.floor(chev4pos[1]-1), math.floor(chev4pos[2]))
- mon.write(" "..chevInfo[2].." ")
- elseif chevInfo[1] == 5 then
- chev5pos = {chevX2, chevY1 }
- mon.setCursorPos(math.floor(chev5pos[1]-2), math.floor(chev5pos[2])+1)
- mon.write(" "..chevInfo[2].." ")
- elseif chevInfo[1] == 6 then
- chev6pos = {chevX2, chevY1 + ((chevY2 - chevY1) / 2) }
- mon.setCursorPos(math.floor(chev6pos[1]-1), math.floor(chev6pos[2]))
- mon.write(" "..chevInfo[2].." ")
- elseif chevInfo[1] == 7 then
- chev7pos = {chevX2, chevY2 }
- mon.setCursorPos(math.floor(chev7pos[1]-2), math.floor(chev7pos[2]-1))
- mon.write(" "..chevInfo[2].." ")
- elseif chevInfo[1] == 8 then
- chev8pos = {chevX1 + ((chevX2 - chevX1) /2), chevY2 }
- mon.setCursorPos(math.floor(chev8pos[1]-1), math.floor(chev8pos[2]))
- mon.write(" "..chevInfo[2].." ")
- elseif chevInfo[1] == 9 then
- chev9pos = {chevX1 + ((chevX2 - chevX1) /2), chevY2 }
- mon.setCursorPos(math.floor(chev8pos[1]-1), chevY1 + ((chevY2 - chevY1) / 2))
- mon.write(" "..chevInfo[2].." ")
- mon.setBackgroundColor(colors.black)
- end
- end
- function drawHome() -- draws the home screen
- mon.setBackgroundColor(colors.black)
- x,y = mon.getSize()
- mon.clear()
- mon.setCursorPos(1,y)
- mon.setTextColor(colors.gray)
- mon.setBackgroundColor(colors.black)
- mon.write("AbydOS")
- drawPowerBar()
- drawChevrons()
- end
- function drawRemoteAddress()
- mon.setBackgroundColor(colors.black)
- x,y = mon.getSize()
- mon.setCursorPos((x/2+1) - string.len(sg.remoteAddress())/2, y/2-2)
- mon.write(sg.remoteAddress())
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement