-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram
More file actions
32 lines (32 loc) · 883 Bytes
/
Copy pathProgram
File metadata and controls
32 lines (32 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
term.clear()
term.setCursorPos(1,1)
print"From Which Printer You Want Some Details"
print"Printer 1 Downstairs"
print"Printer 2 OS Development"
print"Define as p and the number of the printer"
print"Example: Printer 1 = p1"
local choice = read()
if choice == "p1" then
printer = peripheral.wrap("printer_2")
term.clear()
term.setCursorPos(1,1)
print"Printer 1 Downstairs"
local paperAmount = printer.getPaperLevel()
local inkAmount = printer.getInkLevel()
print("Ink:" .. inkAmount .. "")
print("Paper:" .. paperAmount .. "")
elseif choice == "p2" then
printer = peripheral.wrap("printer_4")
term.clear()
term.setCursorPos(1,1)
local paperAmount = printer.getPaperLevel()
local inkAmount = printer.getInkLevel()
print("Printer 2 OS Development")
print("Ink:" ..inkAmount.. "")
print("Paper:" ..paperAmount.. "")
else
print"Bad Input"
sleep(4)
term.clear()
term.setCursorPos(1,1)
end