SHOW:
|
|
- or go back to the newest paste.
1 | - | -- Designed for an 8 wide by 5 tall advanced monitor |
1 | + | --[[ |
2 | This program is designed for use with Computercraft | |
3 | This is a modern version of the billboard program designed for newer versions of Minecraft (above 1.6.4) | |
4 | Custom version for: The Condemned Network - The 1.12 Pack player mall | |
5 | Billboard Specs: 8 blocks wide by 5 blocks tall advanced monitor | |
6 | ||
7 | Programmed by Rolcam | |
8 | You can copy/modify this program as you wish, just please leave the documentation intact | |
9 | ||
10 | ]]-- | |
11 | ||
12 | -- Time variable for how long (in seconds) to display each sign | |
13 | t = 5 | |
14 | ||
15 | - | local monitor = peripheral.wrap(side) |
15 | + | |
16 | tSides = {"left","right","bottom","top","front","back"} | |
17 | ||
18 | for i = 1, #tSides do | |
19 | monitor = peripheral.wrap(tSides[i]) | |
20 | if monitor then | |
21 | side = tSides[i] | |
22 | break | |
23 | end | |
24 | end | |
25 | --Prevents program termination | |
26 | os.pullEvent = os.pullEventRaw | |
27 | ||
28 | local currentTerm = term.current() | |
29 | ||
30 | - | local img = paintutils.loadImage("boot") |
30 | + | |
31 | function adText() | |
32 | term.setTextColor(colors.orange) | |
33 | term.setBackgroundColor(colors.black) | |
34 | term.setCursorPos(2,19) | |
35 | term.write(" Your Ad Here! ") | |
36 | term.setCursorPos(2,20) | |
37 | term.write("Contact Rolcam for details!") | |
38 | term.setTextColor(colors.white) | |
39 | term.setCursorPos(1,1) | |
40 | end | |
41 | ||
42 | if not fs.exists("boot") then | |
43 | term.setTextColor(colors.red) | |
44 | print("Warning: boot image missing!") | |
45 | - | print("Warning: beach image missing!") |
45 | + | |
46 | term.setTextColor(colors.white) | |
47 | shell.run("pastebin get edscQ8zU boot") | |
48 | term.setTextColor(colors.green) | |
49 | print("Boot image downloaded.") | |
50 | term.setTextColor(colors.white) | |
51 | else | |
52 | term.setTextColor(colors.green) | |
53 | print("boot image found!") | |
54 | term.setTextColor(colors.white) | |
55 | end | |
56 | img = paintutils.loadImage("boot") | |
57 | - | if not fs.exists("night") then |
57 | + | |
58 | term.redirect(monitor) | |
59 | - | print("Warning: night image missing!") |
59 | + | |
60 | term.redirect(currentTerm) | |
61 | term.setBackgroundColor(colors.blue) | |
62 | - | shell.run("pastebin get KizP2jiT night") |
62 | + | |
63 | term.clear() | |
64 | print("Rolcam's Billboard Program V3") | |
65 | term.setTextColor(colors.white) | |
66 | print(" ") | |
67 | print("Beginning system check...") | |
68 | - | print("night image found!") |
68 | + | |
69 | print("Checking signs...") | |
70 | ||
71 | - | if not fs.exists("moon") then |
71 | + | |
72 | term.setTextColor(colors.red) | |
73 | - | print("Warning: moon image missing!") |
73 | + | print("Warning: advert image missing!") |
74 | term.setTextColor(colors.white) | |
75 | print("Downloading image...") | |
76 | - | shell.run("pastebin get LL7rSBmx moon") |
76 | + | |
77 | term.setTextColor(colors.green) | |
78 | print("File downloaded") | |
79 | term.setTextColor(colors.white) | |
80 | else | |
81 | term.setTextColor(colors.green) | |
82 | - | print("moon image found!") |
82 | + | |
83 | term.setTextColor(colors.white) | |
84 | end | |
85 | - | if not fs.exists("village") then |
85 | + | adSign = paintutils.loadImage("image") |
86 | ||
87 | - | print("Warning: village image missing!") |
87 | + | if not fs.exists("mall") then |
88 | term.setTextColor(colors.red) | |
89 | print("Warning: Mall sign is missing!") | |
90 | - | shell.run("pastebin get ncJRFq5J village") |
90 | + | |
91 | print("Downloading image...") | |
92 | shell.run("pastebin get k1dsWddA mall") | |
93 | term.setTextColor(colors.green) | |
94 | print("File downloaded") | |
95 | term.setTextColor(colors.white) | |
96 | - | print("village image found!") |
96 | + | |
97 | term.setTextColor(colors.green) | |
98 | print("Mall sign image found!") | |
99 | - | if not fs.exists("mars") then |
99 | + | |
100 | end | |
101 | - | print("Warning: mars image missing!") |
101 | + | |
102 | term.setTextColor(colors.red) | |
103 | print("Warning: bar image missing!") | |
104 | - | shell.run("pastebin get Xh9Lnr1u mars") |
104 | + | term.setTextColor(colors.white) |
105 | print("Downloading image...") | |
106 | shell.run("pastebin get T2r2qxNj bar") | |
107 | term.setTextColor(colors.green) | |
108 | print("File downloaded") | |
109 | term.setTextColor(colors.white) | |
110 | - | print("mars image found!") |
110 | + | |
111 | term.setTextColor(colors.green) | |
112 | print("bar image found!") | |
113 | term.setTextColor(colors.white) | |
114 | end | |
115 | - | print("Warning: bar image missing!") |
115 | + | bar = paintutils.loadImage("bar") |
116 | mallImg = paintutils.loadImage("mall") | |
117 | ||
118 | - | shell.run("pastebin get T2r2qxNj bar") |
118 | + | |
119 | print("Checking for computer label") | |
120 | if os.getComputerLabel() == nil then | |
121 | term.setTextColor(colors.red) | |
122 | print("Warning: Computer is not labeled!") | |
123 | print("Labelling Computer") | |
124 | - | print("bar image found!") |
124 | + | |
125 | term.setTextColor(colors.white) | |
126 | else | |
127 | term.setTextColor(colors.green) | |
128 | print("Computer is already labelled. Great!") | |
129 | term.setTextColor(colors.white) | |
130 | end | |
131 | print("System Check Completed!") | |
132 | sleep(1) | |
133 | print("Starting Billboard!") | |
134 | term.redirect(monitor) | |
135 | ||
136 | mallImg = paintutils.loadImage("mall") | |
137 | ||
138 | while true do | |
139 | paintutils.drawImage(mallImg, 1, 1) | |
140 | sleep(15) | |
141 | paintutils.drawImage(adSign, 1, 1) | |
142 | sleep(t) | |
143 | paintutils.drawImage(bar, 1, 1) | |
144 | - | local img2 = paintutils.loadImage("image") |
144 | + | sleep(t) |
145 | - | local img3 = paintutils.loadImage("bar") |
145 | + |