View difference between Paste ID: gJ2Kw4DJ and tfNtEJKc
SHOW: | | - or go back to the newest paste.
1-
rednet.close("right")
1+
rednet.close("left")
2-
rednet.open("right")
2+
rednet.open("left")
3
4-
local sender = 39 -- Sender Id
4+
local inputSide = "back"
5
local blue = 2048
6
7-
  local sndrId, msg, distance, protocol = rednet.receive("WITHER_KILLING")
7+
function SwitchColor(switch)
8
  if switch then
9-
  if sndrId == sender then
9+
    term.setTextColor(colors.white)
10-
    print("Repeat for: "..msg)
10+
  else
11-
    for i = 0,tonumber(msg) do
11+
    term.setTextColor(colors.red)
12-
      term.setTextColor(colors.red)
12+
  end
13-
      print("STARTING BUILDING PROCESS..")
13+
end
14-
      shell.run("move")
14+
15-
      sleep(.2)
15+
function Move()
16-
      term.setTextColor(colors.green)
16+
  SwitchColor(true)
17-
      print("ENABLING SPIKES..")
17+
  print("-- BUILDING --")
18-
      shell.run("redstone")
18+
  rednet.send(40, "BUILD", "UPDATE")
19-
      term.setTextColor(colors.cyan)
19+
  sleep(.1)
20-
      sleep(1)
20+
  shell.run("move")
21-
      print("STORING AND REFUELING ON ITEMS..")
21+
end
22-
      shell.run("test")
22+
23-
      term.setTextColor(colors.purple)
23+
function Redst()
24-
      print("FINISHED.")
24+
  SwitchColor(false)
25-
      term.setTextColor(colors.white)
25+
  print("-- KILLING --")
26-
    end
26+
  rednet.send(40, "REDST", "UPDATE")
27-
  end	
27+
  sleep(.1)
28
  shell.run("redstone")
29
end
30
31
function Test()
32
  SwitchColor(true)
33
  print("-- DEPOSITING --")
34
  shell.run("test")
35
end
36
37
function Execute()
38
  Move()
39
  sleep(.1)
40
  Redst()
41
  sleep(2)
42
  Test()
43
  sleep(.1)
44
end
45
46
while true do
47
  os.pullEvent("redstone")
48
  local signal = rs.getBundledInput(inputSide)
49
  if signal == blue then
50
    SwitchColor(false)
51
    print("-- INITIATING --")
52
    Execute()
53
    rednet.send(40, "END", "UPDATE")
54
  end 
55
  SwitchColor(false)
56
  print("-- LOOPING --")
57
  SwitchColor(true)
58
  print("-------------")
59
  sleep(1)
60
end