Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- arg1=basin/table, arg2=(1)numberOfPulsesPerHarvest, arg3=(1)numberOfHarvests
- -- (#)=defaultValue
- tArgs = {...}
- -- setting the variables to the value of the argument passed, or 1 if no argument passed.
- pulses = tArgs[2] or 1
- harvests = tArgs[3] or 1
- -- function which pulses redstone with a delay appropriate to the depth of the cast, 5 seconds base time for pouring and cooling and extracting one unit, an additional 1.11 seconds for each unit to be poured
- local function castTable(depth)
- for i=1,pulses do
- redstone.setOutput("bottom", true)
- sleep(2)
- redstone.setOutput("bottom", false)
- if depth < 2 then
- sleep(5)
- else
- sleep(5+(1.11*depth))
- end
- end
- end
- -- function which pulses redstone with a delay appropriate to the depth of the basin (9 units)
- local function castBasin()
- for i=1,pulses do
- redstone.setOutput("bottom", true)
- sleep(2)
- redstone.setOutput("bottom", false)
- sleep(15)
- end
- end
- -- loop which calls the appropriate function as many times as requested by the parameter
- for i=1, harvests do
- if tArgs[1] == 't' then
- castTable()
- elseif tArgs[1] == 'b' then
- castBasin()
- else
- print("Invalid Parameters")
- print("arg1=basin/table, arg2=(1)numberOfPulsesPerHarvest, arg3=(1)numberOfHarvests")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement