ShadowDisruptor

OreDetector

Jun 2nd, 2022 (edited)
599
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. ar = peripheral.wrap("right")
  2. pd = peripheral.wrap("top")
  3. WIDTH <const> = 520
  4. HEIGHT <const> = 1000
  5.  
  6. function getPos()
  7.     return pd.getPlayerPos("StaticShadow")
  8. end
  9.  
  10. ar.clear()
  11.  
  12. function drawDot(rotation)
  13.     x = math.floor(WIDTH/360*((360+180-rotation)%360))
  14.     print(x)
  15.     ar.drawItemIconWithId("ind", "minecraft:diamond", x, 250)
  16. end
  17.  
  18. while true do
  19.     local timer = os.startTimer(.01)
  20.     local event, id
  21.     repeat
  22.         event, id = os.pullEvent("timer")
  23.     until id == timer
  24.  
  25.     pos = getPos()
  26.     rotation = math.floor(pos.yaw+180)
  27.     drawDot(rotation)
  28. end
Add Comment
Please, Sign In to add comment