Yorbo

KPW OS Beta.0.0.4

Oct 21st, 2021
880
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. local answer = ""
  16. rednet.open("right")
  17.  
  18. local afk = false
  19. local width, height = canvas.getSize()
  20. local rec_alpha = 100
  21.  
  22. rect.setSize(20, 25)
  23. rect.setAlpha(100)
  24. text.setScale(2)
  25.  
  26. while progress < 100 do
  27.     progress = progress + 1
  28.     rect.setSize(50 + progress * 2, 25)
  29.     text.setText("KPW OS BOOTING / " .. progress .. "%")
  30.     sleep(0.01)
  31. end
  32.  
  33. while rec_alpha > 0 do
  34.     rec_alpha = rec_alpha - 2
  35.     text.setAlpha(rec_alpha)
  36.     rect.setAlpha(rec_alpha)
  37.     sleep(0.01)
  38. end
  39.  
  40. rect.setSize(200, 200)
  41. rect.setPosition(width / 2 - 100, height / 2 - 100)
  42. text.setText("KPW")
  43. text.setPosition(width / 2 - 85, height / 2 - 40)
  44. text.setScale(10)
  45.  
  46. while rec_alpha < 180 do
  47.     rec_alpha = rec_alpha + 2
  48.     text.setAlpha(rec_alpha)
  49.     rect.setAlpha(rec_alpha)
  50.     sleep(0.01)
  51. end
  52. while rec_alpha > 0 do
  53.     rec_alpha = rec_alpha - 2
  54.     text.setAlpha(rec_alpha)
  55.     rect.setAlpha(rec_alpha)
  56.     sleep(0.01)
  57. end
  58.  
  59.  
  60.  
  61. while true do
  62.     local _, player, message, uuid = os.pullEvent("chat_message")
  63.     senderID, answer, distance = os.pullEvent("rednet_message")
  64.  
  65.     if message:find("[Yy][aä]nn") and afk then
  66.         chat.say("Bin grad nüsch da, schreib mir auf dc dann seh ichs")
  67.     elseif uuid == "cc05c242-fc7b-4813-b568-3f0fe94e9b18" and message:find("afk") then
  68.         if not afk then
  69.             afk = true
  70.         else
  71.             afk = false
  72.         end
  73.     end
  74.  
  75.     chat.say(answer)
  76.     rednet.send(2, message)
  77. end
  78. rednet.close()
RAW Paste Data