View difference between Paste ID: FfEyFUEd and SX96XDnD
SHOW: | | - or go back to the newest paste.
1-
-- FTB Revelations mod pack
1+
-- MC Eternal mod pack
2-
-- places soul sand, wither skulls, kills wither
2+
-- operates the garage door - open at sunrise, close at sunset
3
4-
-- pastebin -f get SX96XDnD witherRev
4+
-- pastebin -f get FfEyFUEd rdoor
5
6-
-- soulsand in slot 1
6+
7-
-- skulls in slot 2
7+
8
local component=require("component")
9
local sides = require("sides")
10
11
-- functions
12
13
-- main
14-
local function MoveLeft()
14+
15-
  robot.turnLeft()
15+
local doorstate = "closed"
16-
  robot.forward()
16+
local daycheck = 1.0
17-
  robot.turnRight()
17+
18
while true do
19
  -- is it sunrise?
20-
local function MoveRight()
20+
  if doorstate == "closed" then
21-
  robot.turnRight()
21+
     daycheck = component.redstone.getInput(sides.back)
22-
  robot.forward()
22+
     daycheck = math.floor(daycheck)
23-
  robot.turnLeft()
23+
     print(daycheck)
24
25
    if daycheck >= 2 then
26-
-- select slot 2
26+
      -- sunrise open the door
27-
-- get count in 2
27+
      robot.use()
28-
-- divide by 3
28+
      robot.use()
29-
-- set i = to that count
29+
      -- set a flag to note that the door is open
30
      doorstate = "open"
31-
for i = 1,16 do  
31+
    end
32-
  -- place the soulsand
32+
33-
  for x = 1, 7 do
33+
34-
    robot.forward()
34+
  -- is it sunset?
35
  if doorstate == "open" then
36-
  robot.select(1)
36+
    daycheck = component.redstone.getInput(sides.back)
37-
  robot.place()
37+
    daycheck = math.floor(daycheck)
38-
  robot.back()
38+
    print(daycheck)
39-
  robot.place()
39+
40-
  MoveLeft()
40+
    if daycheck <= 0 then
41-
  robot.place()
41+
      -- sunset close the door
42-
  MoveRight()
42+
      robot.use()
43-
  MoveRight()
43+
      robot.use()
44-
  robot.place()
44+
      -- set a flag to note that the door is closed
45-
  MoveLeft()
45+
      doorstate = "closed"
46-
  -- place the wither skulls
46+
    end
47-
  robot.select(2)
47+
48-
  robot.turnLeft()
48+
49-
  robot.place()
49+
  -- wait 
50-
  robot.turnRight()
50+
  os.sleep(20)
51-
  robot.turnRight()
51+
52-
  robot.place()
52+