Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("ocs/apis/sensor")
- senI = sensor.wrap("back")
- monSide = "back"
- senSide = "top"
- Tcolor = colors.white
- Bcolor1 = colors.black
- Bcolor2 = colors.gray
- Rside = "bottom"
- mon = peripheral.wrap("back")
- sen = sensor.wrap(senSide)
- xMax,yMax = mon.getSize()
- mon.setTextColor(Tcolor)
- function BG()
- mon.setBackgroundColor(Bcolor1)
- for yPos = 1,yMax do
- for xPos = 1,xMax do
- mon.setCursorPos(xPos,yPos)
- mon.write(" ")
- end
- end
- end
- while true do
- BG()
- rs.setOutput(Rside, false)
- zieleinv = sen.getTargets()
- for k,v in pairs(zieleinv) do
- if v.Name == "Player"
- and v.Position.X <= 1 and v.Position.X >= -1
- and v.Position.Y <= 0 and v.Position.Y >= -4
- and v.Position.Z <= 4 and v.Position.Z >= 1.5
- then
- name = k
- details = sen.getTargetDetails(k)
- for i = 1,40 do
- item = details.Inventory[i].Name
- if item == "Stick of Truth" then
- BG()
- mon.setCursorPos(1,1)
- mon.setBackgroundColor(Bcolor2)
- mon.write(name)
- mon.setCursorPos(1,2)
- mon.setBackgroundColor(colors.lime)
- mon.write("Item akzeptiert")
- rs.setOutput(Rside, true)
- for wait = 10,1,-1 do
- mon.setCursorPos(1,4)
- mon.setBackgroundColor(colors.red)
- mon.write("Refresh in "..wait.." ")
- mon.setCursorPos(1,5)
- mon.write("seconds ")
- sleep(1)
- end
- end
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment