View difference between Paste ID: MuKVe9dy and mhQFr8b8
SHOW: | | - or go back to the newest paste.
1-
print("Press M to Activate Horizontal Mining System, Press J to Activate Laser Guided Warp System")
1+
-- Set up colors: black text on light gray background
2
term.setTextColor(colors.black)
3
term.setBackgroundColor(colors.lightGray)
4-
    shell.run("pastebin get rfXW7SiN jzc")
4+
term.clear()  -- apply background to entire screen
5
6
print("Press M to Activate Horizontal Mining System")
7
print("           ")
8-
    shell.run("pastebin get S9SW0zHJ ztc")
8+
print("Press J to Activate Laser Guided Warp System")
9
10
-- Restore default colors for pasted scripts if they rely on them
11
local function resetColors()
12
  term.setTextColor(colors.white)
13-
    local event, key = os.pullEvent("key")
13+
  term.setBackgroundColor(colors.black)
14-
    -- Use keys.m and keys.j instead of hardcoding 77 and 74.
14+
15-
    if key == keys.m then
15+
16-
        print("Booting Horizontal Mining System...")
16+
17-
        shell.run("jzc")
17+
  resetColors()
18-
    elseif key == keys.j then
18+
  shell.run("pastebin get rfXW7SiN jzc")
19-
        print("Booting Laser Guided Warp System...")
19+
  term.clear()
20-
        shell.run("ztc")
20+
  term.setTextColor(colors.black)
21-
    end
21+
  term.setBackgroundColor(colors.lightGray)
22
end
23
24
if not fs.exists("ztc") then
25
  resetColors()
26
  shell.run("pastebin get S9SW0zHJ ztc")
27
  term.clear()
28
  term.setTextColor(colors.black)
29
  term.setBackgroundColor(colors.lightGray)
30
end
31
32
while true do
33
  local event, key = os.pullEvent("key")
34
  if key == keys.m then
35
    print("Booting Horizontal Mining System...")
36
    resetColors()
37
    shell.run("jzc")
38
    -- when it returns, restore our colors
39
    term.clear()
40
    term.setTextColor(colors.black)
41
    term.setBackgroundColor(colors.lightGray)
42
  elseif key == keys.j then
43
    print("Booting Laser Guided Warp System...")
44
    resetColors()
45
    shell.run("ztc")
46
    term.clear()
47
    term.setTextColor(colors.black)
48
    term.setBackgroundColor(colors.lightGray)
49
  end
50
end
51