Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --#################################################################################################################
- -- Computer Wither Redstone Clock
- -- v. 3.0
- -- (c)2021 CTekkLP
- --#################################################################################################################
- --#################################################################################################################
- -- Local Variables
- --#################################################################################################################
- local sideSkull = "top" --Redstone side of the Computer for Skulls
- local sideSoulSand = "bottom" --Redstone side of the Computer for SoulSand
- local timeSkull = 1 --Time for Skulls
- local timeSoulSand = 1.2 --Time for SoulSand
- local timeBetweenRuns = 2 --Time between Runs
- local rsBridgeName = "rsBridge_0" --Name of the RS Bridge
- --#################################################################################################################
- -- Load Peripherals
- --#################################################################################################################
- local rsBridge = peripheral.wrap(rsBridgeName)
- --#################################################################################################################
- -- FunctionΒ΄s
- --#################################################################################################################
- print("How many Runs?")
- local runs = read()
- local num = tonumber(runs)
- function waiting(time)
- local myTimer = os.startTimer(time)
- while true do
- local event, timerID = os.pullEvent("timer")
- if timerID == myTimer then break end
- end
- end
- function actRed()
- redstone.setOutput(sideSoulSand, true)
- waiting(timeSoulSand)
- redstone.setOutput(sideSoulSand, false)
- redstone.setOutput(sideSkull, true)
- waiting(timeSkull)
- redstone.setOutput(sideSkull, false)
- end
- function checkItems()
- soul_sand = rsBridge.getItem({name="minecraft:soul_sand"})
- if soul_sand ~= nil then
- if tonumber(soul_sand[1]["amount"]) < 4 then
- error("Not enough Soul Sand! min 4")
- end
- else
- error("Not enough Soul Sand! min 4")
- end
- ws_skull = rsBridge.getItem({name="minecraft:wither_skeleton_skull"})
- if ws_skull~= nil then
- if tonumber(ws_skull[1]["amount"]) < 3 then
- error("Not enough Wither Skeleton Skulls! min 3")
- end
- else
- error("Not enough Wither Skeleton Skulls! min 3")
- end
- end
- --#################################################################################################################
- -- Main
- --#################################################################################################################
- if num ~= nil then
- for i= 1, runs, 1 do
- checkItems()
- print("Start Run ", i)
- actRed()
- waiting(timeBetweenRuns)
- end
- else
- print("Error")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement