Yorbo

KPW OS Beta.0.0.2

Oct 21st, 2021
822
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ---
  2. --- Created by yannb.
  3. --- DateTime: 22/10/2021 02:36
  4. ---
  5.  
  6. local interface = peripheral.wrap("back")
  7. local clearing = interface.canvas()
  8. clearing.clear()
  9. local canvas = interface.canvas()
  10. local group = canvas.addGroup({0, 0})
  11. local text = group.addText({ 5, 5 }, "KPW OS BOOTING / 0%")
  12. local rect = group.addRectangle(0, 0, 100, 100, 0xFF34e8eb)
  13. local progress = 0
  14. local chat = peripheral.wrap("back")
  15. rednet.open("right")
  16.  
  17. local afk = false
  18. local width, height = canvas.getSize()
  19. local rec_alpha = 100
  20.  
  21. rect.setSize(20, 25)
  22. rect.setAlpha(100)
  23. text.setScale(2)
  24.  
  25. while progress < 100 do
  26.     progress = progress + 1
  27.     rect.setSize(50 + progress * 2, 25)
  28.     text.setText("KPW OS BOOTING / " .. progress .. "%")
  29.     sleep(0.01)
  30. end
  31.  
  32. while rec_alpha > 0 do
  33.     rec_alpha = rec_alpha - 2
  34.     text.setAlpha(rec_alpha)
  35.     rect.setAlpha(rec_alpha)
  36.     sleep(0.01)
  37. end
  38.  
  39. rect.setSize(200, 200)
  40. rect.setPosition(width / 2 - 100, height / 2 - 100)
  41. text.setText("KPW")
  42. text.setPosition(width / 2 - 85, height / 2 - 40)
  43. text.setScale(10)
  44.  
  45. while rec_alpha < 180 do
  46.     rec_alpha = rec_alpha + 2
  47.     text.setAlpha(rec_alpha)
  48.     rect.setAlpha(rec_alpha)
  49.     sleep(0.01)
  50. end
  51. while rec_alpha > 0 do
  52.     rec_alpha = rec_alpha - 2
  53.     text.setAlpha(rec_alpha)
  54.     rect.setAlpha(rec_alpha)
  55.     sleep(0.01)
  56. end
  57.  
  58.  
  59.  
  60. while true do
  61.     local _, player, message, uuid = os.pullEvent("chat_message")
  62.     senderID, answer, distance = rednet.receive()
  63.  
  64.     if message:find("[Yy][aä]nn") and afk then
  65.         chat.say("Bin grad nüsch da, schreib mir auf dc dann seh ichs")
  66.     elseif uuid == "cc05c242-fc7b-4813-b568-3f0fe94e9b18" and message:find("afk") then
  67.         if not afk then
  68.             afk = true
  69.         else
  70.             afk = false
  71.         end
  72.     end
  73.  
  74.     chat.say(answer)
  75.     rednet.send(2, message)
  76. end
  77. rednet.close()
RAW Paste Data