Hack-much

test

Apr 18th, 2021
636
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local canvas = peripheral.wrap("back").canvas()
  2. canvas.clear() -- Get rid of our previous clock
  3.  
  4. local group = canvas.addGroup({ 0, 0 })
  5.  
  6. -- Look, we add items to our group instead
  7. group.addRectangle(0, 0, 240, 30, 0xFF000064)
  8.  
  9. local text = group.addText({ 5, 5 }, "")
  10. text.setScale(3)
  11.  
  12. local x, y, dx, dy = 0, 0, 5, 5
  13.  
  14. -- Compute the dimensions we can move within
  15. local width, height = canvas.getSize()
  16. width = width - 240
  17. height = height - 30
  18.  
  19. while true do
  20.   -- Bounce the group around the canvas
  21.   x = x + dx
  22.   if x < 0 then x, dx = 0, -dx end
  23.   if x > width then x, dx = width, -dx end
  24.  
  25.   y = y + dy
  26.   if y < 0 then y, dy = 0, -dy end
  27.   if y > height then y, dy = height, -dy end
  28.  
  29.   group.setPosition(x, y)
  30.  
  31.   -- And update the time
  32.   text.setText("Time is " .. textutils.formatTime(os.time()))
  33.  
  34.   sleep(0.05)
  35. end
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×