Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("ocs/apis/sensor")
- prox = sensor.wrap("back")
- while true do
- local target = prox.getTargets()
- for tarName, _ in pairs(target) do
- --fetch the detailed information table for the current target.
- local details = prox.getTargetDetails(tarName)
- if details ~= nil then
- if details.Riding ~= nil then
- if details.Riding.Name == "Creeper" then
- --while rs.testBundledInput("left", colors.green) == false do
- --print("Wait")
- rs.setBundledOutput("right", colors.white)
- --os.sleep(0.5)
- --end
- --rs.setBundledOutput("right",0)
- break
- elseif details.Riding.Name == "Spider" then
- --while rs.testBundledInput("left", colors.green) == false do
- --print("Wait")
- rs.setBundledOutput("right", colors.black)
- --os.sleep(0.5)
- --end
- --rs.setBundledOutput("right",0)
- break
- elseif details.Riding.Name == "Skeleton" then
- --while rs.testBundledInput("left", colors.green) == false do
- --print("Wait")
- rs.setBundledOutput("right", colors.gray)
- -- os.sleep(0.5)
- --end
- --rs.setBundledOutput("right",0)
- break
- elseif details.Riding.Name == "Zombie" then
- --while rs.testBundledInput("left", colors.green) == false do
- -- print("Wait")
- rs.setBundledOutput("right", colors.green)
- --os.sleep(0.5)
- --end
- --rs.setBundledOutput("right",0)
- break
- else
- rs.setBundledOutput("right", 0)
- --os.sleep(1.5)
- break
- end
- else
- --print("Mob absent")
- break
- end
- else
- break
- end
- os.sleep(1.2)
- end
- os.sleep(1.2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement