View difference between Paste ID: ZZvyRsYh and JjFsqCMD
SHOW: | | - or go back to the newest paste.
1-
local fullname = "Lightspeed Alpha v1.0"
1+
2
  PROGDOR SELF-EXTRACT
3-
local data = {
3+
 INSTRUCTIONS
4-
  [ "/eShip6_broken.img" ] = {
4+
5-
    "                 777b77",
5+
 1. Use a CC emulator, such as CCEmuRedux, so you can access your filesystem ("~/.ccemuredux/sessions/computer" on linux, something else for windows)
6-
    "               bbbfff7ff",
6+
 2. Put all the files you want to archive in a single folder.
7-
    "              777bfff7",
7+
 3. Get progdor (pastebin get YXx5jjMV progdor), and choose whether or not to edit the 11th line to compress or not. (Uses CCA algorithm)
8-
    "             7fffbbbbbb",
8+
 4. Use progdor on that folder. It should be a file now!
9-
    "             fffffffffff",
9+
 5. Get out of CCEmuRedux, and navigate to the file in the .ccemuredux/sessions/computer/[ID] folder.
10-
    "             fffffffffff",
10+
 6. Open it up with a text editor, remove the first line (true or false), then select all and copy it as 'data' (defined below).
11-
    "             7fffb77777",
11+
    Don't paste it INSIDE of data; replace the existing {}.
12-
    "              bbbbfff7",
12+
 7. If it is compressed, set the doCompress (defined below) to true. Otherwise, set it to false.
13-
    "               777fff7ff",
13+
 8. Set the variable fullname (defined below) to the full name of your program/files.
14-
    "                 777b77",
14+
15-
  },
15+
 You are done! Be sure to remove this whole comment.
16-
  [ "/ui" ] = {
16+
17-
    "0000 00000000000000000000                   00000",
17+
18-
    "",
18+
local fullname = "full_name_here"
19-
    "00000000000000",
19+
20-
    "",
20+
local data = {} --paste archive data here
21-
    "00000",
21+
22-
    "0000             000000",
22+
23-
    "0000000000       00000000",
23+
local outpath = ((tArg[1] ~= "") and tArg[1]) or (shell and shell.getRunningProgram() or "")
24-
    "0                   00000000",
24+
25-
    "                     00000000",
25+
26-
    "                    00000000",
26+
27-
    "                 0000000",
27+
28-
    "                 000000",
28+
29-
    "",
29+
30-
    "",
30+
31-
    "",
31+
32-
    "                    00000 00000",
32+
33-
  },
33+
34-
  [ "/eShip3_broken.img" ] = {
34+
35-
    "                 eeeeeee",
35+
36-
    "                e1111111f",
36+
37-
    "              eeffe1e11ff",
37+
38-
    "              fffffffef",
38+
39-
    "              ff11fffff",
39+
40-
    "              e11e111f1ff",
40+
41-
    "                1eeeee1ef",
41+
42-
    "                 1111111",
42+
43-
  },
43+
44-
  [ "/eShip11_broken.img" ] = {
44+
45-
    "",
45+
46-
    "                777779",
46+
47-
    "              777ff779f",
47+
48-
    "             7999f7799f",
48+
49-
    "             97ff9997ff",
49+
50-
    "             f7ffff7f",
50+
51-
    "             ff7f7fff",
51+
52-
    "             7f777777ff",
52+
53-
    "             7777ff779f",
53+
54-
    "              7977ff79f",
54+
55-
    "                999999",
55+
56-
  },
56+
57-
  [ "/eShip8_broken.img" ] = {
57+
58-
    "",
58+
59-
    "                    7b",
59+
60-
    "              7777bbbbf",
60+
61-
    "             77ff77777f",
61+
62-
    "             fffff7f7f",
62+
63-
    "             ff7ffffff",
63+
64-
    "             bb77ff7f7f",
64+
65-
    "              bbbbbbbbf",
65+
66-
    "                    7b",
66+
67-
  },
67+
68-
  [ "/eShip4.img" ] = {
68+
69-
    "                     eee",
69+
70-
    "               eeeeee111",
70+
71-
    "              e      e",
71+
72-
    "              1      1",
72+
73-
    "               1111ee1ee",
73+
74-
    "                     111",
74+
75-
  },
75+
76-
  [ "/Lightspeed" ] = {
76+
77-
    "world = {}",
77+
78-
    "playerX = 0",
78+
79-
    "playerY = 0",
79+
80-
    "",
80+
81-
    "p = shell.dir()..\"/\"",
81+
82-
    "",
82+
83-
    "pShips = {",
83+
84-
    "	{name = \"The Gillian\", laserx = 12, lasery = 6.5, maxHull = 18, fire = {{x = -1, y = 0}, {x = -1, y = 1}, {x = -1, y = 4}, {x = -1, y = 5}},",
84+
85-
    "	wCooldown = 20, image = paintutils.loadImage(p..\"pShip1.img\"),",
85+
86-
    "	rooms = {{rType = \"controll\", x = 8, y = 2, level = 9, damage = 0, repair = 0}, {rType = \"weapons\", x = 5, y = 2, level = 4, damage = 0, repair = 0}}},",
86+
87-
    "",
87+
88-
    "	{name = \"Sinjin\", laserx = 12, lasery = 6.5, maxHull = 20, fire = {{x = -1, y = 0}, {x = -1, y = 1}, {x = -1, y = 4}, {x = -1, y = 5}},",
88+
89-
    "	wCooldown = 20, image = paintutils.loadImage(p..\"pShip2.img\"),",
89+
90-
    "	rooms = {{rType = \"controll\", x = 7, y = 2, level = 4, damage = 0, repair = 0}, {rType = \"weapons\", x = 3, y = 1, level = 3, damage = 0, repair = 0}, {rType = \"shields\", x = 3, y = 3, level = 1, damage = 0, repair = 0}}},",
90+
91-
    "}",
91+
92-
    "",
92+
93-
    "eShips = {",
93+
94-
    "	{laserx = 13, lasery = 6.5, maxHull = 10, fire = {{x = 24, y = 0}, {x = 24, y = 5}},",
94+
95-
    "	wCooldown = 20, image = paintutils.loadImage(p..\"eShip1.img\"), image_broken = paintutils.loadImage(\"eShip1_broken.img\"),",
95+
			if entry then --exists in dictionary
96-
    "	rooms = {{rType = \"controll\", x = 17, y = 1, level = 3, damage = 0, repair = 0}, {rType = \"weapons\", x = 17, y = 3, level = 5, damage = 0, repair = 0}}},",
96+
97-
    "",
97+
98-
    "	{laserx = 13, lasery = 6.5, maxHull = 7, fire = {{x = 24, y = 0}, {x = 24, y = 1}, {x = 24, y = 4}, {x = 24, y = 5}},",
98+
99-
    "	wCooldown = 20, image = paintutils.loadImage(p..\"eShip2.img\"), image_broken = paintutils.loadImage(\"eShip2_broken.img\"),",
99+
100-
    "	rooms = {{rType = \"controll\", x = 18, y = 1, level = 5, damage = 0, repair = 0}, {rType = \"weapons\", x = 18, y = 3, level = 4, damage = 0, repair = 0}}},",
100+
101-
    "",
101+
102-
    "	{laserx = 13, lasery = 6.5, maxHull = 5, fire = {{x = 24, y = 0}, {x = 24, y = 1}, {x = 24, y = 4}, {x = 24, y = 5}},",
102+
103-
    "	wCooldown = 20, image = paintutils.loadImage(p..\"eShip3.img\"), image_broken = paintutils.loadImage(\"eShip3_broken.img\"),",
103+
104-
    "	rooms = {{rType = \"controll\", x = 16, y = 2, level = 7, damage = 0, repair = 0}, {rType = \"weapons\", x = 19, y = 2, level = 2, damage = 0, repair = 0}}},",
104+
105-
    "",
105+
106-
    "	{laserx = 13, lasery = 6.5, maxHull = 2, fire = {{x = 24, y = 0}, {x = 24, y = 1}, {x = 24, y = 4}, {x = 24, y = 5}},",
106+
107-
    "	wCooldown = 20, image = paintutils.loadImage(p..\"eShip4.img\"), image_broken = paintutils.loadImage(\"eShip4_broken.img\"),",
107+
108-
    "	rooms = {{rType = \"controll\", x = 15, y = 2, level = 8, damage = 0, repair = 0}, {rType = \"weapons\", x = 18, y = 2, level = 2, damage = 0, repair = 0}}},",
108+
109-
    "",
109+
110-
    "	{laserx = 13, lasery = 6.5, maxHull = 12, fire = {{x = 24, y = 0}, {x = 24, y = 1}, {x = 24, y = 4}, {x = 24, y = 5}},",
110+
111-
    "	wCooldown = 20, image = paintutils.loadImage(p..\"eShip5.img\"), image_broken = paintutils.loadImage(\"eShip5_broken.img\"),",
111+
112-
    "	rooms = {{rType = \"controll\", x = 16, y = 1, level = 1, damage = 0, repair = 0}, {rType = \"weapons\", x = 16, y = 3, level = 5, damage = 0, repair = 0}}},",
112+
113-
    "",
113+
114-
    "",
114+
115-
    "	{laserx = 13, lasery = 6.5, maxHull = 12, fire = {{x = 23, y = 0}, {x = 23, y = 3}, {x = 23, y = 4}, {x = 23, y = 7}},",
115+
116-
    "	wCooldown = 20, image = paintutils.loadImage(p..\"eShip6.img\"), image_broken = paintutils.loadImage(\"eShip6_broken.img\"),",
116+
117-
    "	rooms = {{rType = \"controll\", x = 14, y = 3, level = 4, damage = 0, repair = 0}, {rType = \"weapons\", x = 18, y = 1, level = 3, damage = 0, repair = 0}, {rType = \"shields\", x = 18, y = 5, level = 1, damage = 0, repair = 0}}},",
117+
118-
    "",
118+
119-
    "	{laserx = 13, lasery = 6.5, maxHull = 10, fire = {{x = 22, y = 1}, {x = 22, y = 2}, {x = 22, y = 5}, {x = 22, y = 6}},",
119+
120-
    "	wCooldown = 20, image = paintutils.loadImage(p..\"eShip7.img\"), image_broken = paintutils.loadImage(\"eShip7_broken.img\"),",
120+
121-
    "	rooms = {{rType = \"controll\", x = 15, y = 2, level = 1, damage = 0, repair = 0}, {rType = \"weapons\", x = 15, y = 4, level = 5, damage = 0, repair = 0}}},",
121+
122-
    "",
122+
123-
    "	{laserx = 13, lasery = 6.5, maxHull = 6, fire = {{x = 22, y = 1}, {x = 22, y = 2}, {x = 22, y = 5}, {x = 22, y = 6}},",
123+
124-
    "	wCooldown = 20, image = paintutils.loadImage(p..\"eShip8.img\"), image_broken = paintutils.loadImage(\"eShip8_broken.img\"),",
124+
			coroutine.yield()
125-
    "	rooms = {{rType = \"controll\", x = 15, y = 3, level = 10, damage = 0, repair = 0}, {rType = \"weapons\", x = 18, y = 3, level = 4, damage = 0, repair = 0}}},",
125+
126-
    "",
126+
127-
    "	{laserx = 13, lasery = 6.5, maxHull = 8, fire = {{x = 22, y = 1}, {x = 22, y = 2}, {x = 22, y = 5}, {x = 22, y = 6}},",
127+
128-
    "	wCooldown = 20, image = paintutils.loadImage(p..\"eShip9.img\"), image_broken = paintutils.loadImage(\"eShip9_broken.img\"),",
128+
129-
    "	rooms = {{rType = \"controll\", x = 14, y = 3, level = 8, damage = 0, repair = 0}, {rType = \"weapons\", x = 17, y = 3, level = 5, damage = 0, repair = 0}}},",
129+
130-
    "",
130+
131-
    "	{laserx = 13, lasery = 6.5, maxHull = 10, fire = {{x = 23, y = 0}, {x = 23, y = 3}, {x = 23, y = 4}, {x = 23, y = 7}},",
131+
132-
    "	wCooldown = 20, image = paintutils.loadImage(p..\"eShip10.img\"), image_broken = paintutils.loadImage(\"eShip10_broken.img\"),",
132+
133-
    "	rooms = {{rType = \"controll\", x = 18, y = 3, level = 3, damage = 0, repair = 0}, {rType = \"weapons\", x = 18, y = 1, level = 4, damage = 0, repair = 0}, {rType = \"shields\", x = 18, y = 5, level = 1, damage = 0, repair = 0}}},",
133+
134-
    "",
134+
135-
    "",
135+
		coroutine.yield()
136-
    "	{laserx = 13, lasery = 8, maxHull = 13, fire = {{x = 22, y = 1}, {x = 22, y = 2}, {x = 22, y = 3}, {x = 22, y = 6}, {x = 22, y = 7}, {x = 22, y = 8}},",
136+
137-
    "	wCooldown = 20, image = paintutils.loadImage(p..\"eShip11.img\"), image_broken = paintutils.loadImage(\"eShip11_broken.img\"),",
137+
138-
    "	rooms = {{rType = \"controll\", x = 14, y = 4, level = 3, damage = 0, repair = 0}, {rType = \"weapons\", x = 17, y = 2, level = 7, damage = 0, repair = 0}, {rType = \"shields\", x = 17, y = 6, level = 2, damage = 0, repair = 0}}},",
138+
139-
    "",
139+
140-
    "	{laserx = 13, lasery = 8, maxHull = 13, fire = {{x = 22, y = 1}, {x = 22, y = 2}, {x = 22, y = 3}, {x = 22, y = 6}, {x = 22, y = 7}, {x = 22, y = 8}},",
140+
141-
    "	wCooldown = 20, image = paintutils.loadImage(p..\"eShip12.img\"), image_broken = paintutils.loadImage(\"eShip12_broken.img\"),",
141+
142-
    "	rooms = {{rType = \"controll\", x = 14, y = 4, level = 3, damage = 0, repair = 0}, {rType = \"weapons\", x = 17, y = 2, level = 7, damage = 0, repair = 0}, {rType = \"shields\", x = 17, y = 6, level = 2, damage = 0, repair = 0}}},",
142+
143-
    "}",
143+
144-
    "",
144+
145-
    "pShip = {}",
145+
146-
    "eShip = {}",
146+
147-
    "unlockedShips = {}",
147+
148-
    "killCount = 0",
148+
149-
    "",
149+
150-
    "laserPhase = 0",
150+
151-
    "miss = 0",
151+
152-
    "missTime = 8",
152+
153-
    "tick = 1",
153+
154-
    "scrapSymbol = string.char(21)",
154+
155-
    "stop = false",
155+
156-
    "",
156+
157-
    "scrap = 0",
157+
158-
    "fuel = 0",
158+
159-
    "score = 0",
159+
160-
    "",
160+
161-
    "target = -1",
161+
162-
    "repeatShot = false",
162+
163-
    "",
163+
164-
    "screenWidth, screenHeight = term.getSize()",
164+
165-
    "",
165+
166-
    "x1 = 3",
166+
167-
    "y1 = 4",
167+
168-
    "",
168+
169-
    "x2 = 26",
169+
170-
    "y2 = 4",
170+
171-
    "",
171+
172-
    "function deepCopy(table)",
172+
173-
    "	local copy = {}",
173+
174-
    "",
174+
175-
    "	for k, v in pairs(table) do",
175+
176-
    "		local subcopy = v",
176+
177-
    "",
177+
178-
    "		if (type(v) == \"table\") then",
178+
179-
    "			subcopy = deepCopy(v)",
179+
180-
    "		end",
180+
181-
    "",
181+
182-
    "		copy[k] = subcopy",
182+
183-
    "	end",
183+
184-
    "",
184+
185-
    "	return copy",
185+
186-
    "end",
186+
187-
    "",
187+
188-
    "function drawSpaceBackground()",
188+
189-
    "	term.setBackgroundColor(colors.black)",
189+
190-
    "	term.setTextColor(colors.white)",
190+
191-
    "	term.clear()",
191+
192-
    "",
192+
193-
    "	for i = 1, 100 do",
193+
194-
    "		local x = math.random(screenWidth)",
194+
195-
    "		local y = math.random(screenHeight)",
195+
196-
    "		term.setCursorPos(x, y)",
196+
197-
    "		write(\".\")",
197+
198-
    "	end",
198+
199-
    "end",
199+
200-
    "",
200+
201-
    "function drawBattle()",
201+
202-
    "	while true do",
202+
203-
    "		if (laserPhase > 0) then",
203+
204-
    "			if (laserPhase ~= 1) then",
204+
205-
    "				term.setBackgroundColor(colors.black)",
205+
206-
    "				term.setTextColor(colors.red)",
206+
207-
    "				for x = x1 + pShip.laserx + 2, x2 + eShip.laserx - 2 do",
207+
208-
    "					term.setCursorPos(x, math.ceil((pShip.lasery + eShip.lasery) / 2))",
208+
209-
    "					write(string.char(131))",
209+
210-
    "				end",
210+
211-
    "			else",
211+
212-
    "				term.setBackgroundColor(colors.black)",
212+
213-
    "				term.setTextColor(colors.black)",
213+
214-
    "				for x = x1 + pShip.laserx + 2, x2 + eShip.laserx - 2 do",
214+
215-
    "					term.setCursorPos(x, math.ceil((pShip.lasery + eShip.lasery) / 2))",
215+
216-
    "					write(\" \")",
216+
217-
    "				end",
217+
218-
    "			end",
218+
219-
    "			laserPhase = laserPhase - 1",
219+
220-
    "		end",
220+
221-
    "",
221+
222-
    "		term.setBackgroundColor(colors.black)",
222+
223-
    "		term.setTextColor(colors.white)",
223+
224-
    "		term.setCursorPos(math.floor(screenWidth / 2) - 1, 8)",
224+
225-
    "",
225+
226-
    "		if (miss > 0) then",
226+
227-
    "			write(\"Miss\")",
227+
228-
    "			miss = miss - 1",
228+
229-
    "		else",
229+
230-
    "			write(\"    \")",
230+
231-
    "		end",
231+
232-
    "",
232+
233-
    "		term.setBackgroundColor(colors.lightBlue)",
233+
234-
    "		term.setTextColor(colors.blue)",
234+
235-
    "		for i = 1, 20 do",
235+
236-
    "			term.setCursorPos(i, screenHeight)",
236+
237-
    "			if (i <= pShip.wCooldown) then",
237+
238-
    "				write(\"=\")",
238+
239-
    "			else",
239+
240-
    "				paintutils.drawPixel(i, screenHeight, colors.black)",
240+
241-
    "			end",
241+
242-
    "		end",
242+
243-
    "		for roomNr, room in pairs(pShip.rooms) do",
243+
244-
    "			if (room.rType == \"weapons\") then",
244+
245-
    "				for i = 1, room.level - room.damage do",
245+
246-
    "					pShip.wCooldown = pShip.wCooldown + 0.125",
246+
247-
    "				end",
247+
248-
    "			end",
248+
249-
    "		end",
249+
250-
    "",
250+
251-
    "		term.setBackgroundColor(colors.lightBlue)",
251+
252-
    "		term.setTextColor(colors.blue)",
252+
253-
    "		for i = 1, 20 do",
253+
254-
    "			term.setCursorPos(screenWidth + 1 - i, screenHeight)",
254+
255-
    "			if (i <= eShip.wCooldown) then",
255+
256-
    "				write(\"=\")",
256+
257-
    "			else",
257+
258-
    "				paintutils.drawPixel(screenWidth + 1 - i, screenHeight, colors.black)",
258+
259-
    "			end",
259+
260-
    "		end",
260+
261-
    "		for roomNr, room in pairs(eShip.rooms) do",
261+
262-
    "			if (room.rType == \"weapons\") then",
262+
263-
    "				for i = 1, room.level - room.damage do",
263+
264-
    "					eShip.wCooldown = eShip.wCooldown + 0.125",
264+
265-
    "				end",
265+
local success, res = pcall( function() return doPack(data,outpath,doCompress,true) end )
266-
    "			end",
266+
267-
    "		end",
267+
268-
    "",
268+
269-
    "		for fNr, fire in pairs(pShip.fire) do",
269+
270-
    "			if (tick == 0) then",
270+
271-
    "				fType = 187",
271+
272-
    "				if (fire.x % 2 ~= fire.y % 2) then",
272+
273-
    "					fType = 127",
273+
274-
    "				end",
274+
275-
    "			else",
275+
276-
    "				fType = 127",
276+
277-
    "				if (fire.x % 2 ~= fire.y % 2) then",
277+
278-
    "					fType = 187",
278+
279-
    "				end",
279+