scriding

Rainbow Illumintator x4

Jan 21st, 2021 (edited)
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. r = 250              --Starts at pure RED
  2. g = 0
  3. b = 0
  4. c = peripheral.wrap("cofh_thermalexpansion_lamp_0")
  5. d = peripheral.wrap("cofh_thermalexpansion_lamp_1")
  6. e = peripheral.wrap("cofh_thermalexpansion_lamp_2")
  7. f = peripheral.wrap("cofh_thermalexpansion_lamp_3")
  8.  
  9. t = 1
  10.  
  11. while t == 1 do
  12.  
  13. repeat  --this loop goes 0-255 in Green
  14.  
  15.         form = string.format("%02x%02x%02x", r, g, b)
  16.         sub = string.gsub(form, ", ", "")
  17.         dec = tonumber(sub, 16)
  18.         c.setColor(dec)
  19.         d.setColor(dec)
  20.         e.setColor(dec)
  21.         f.setColor(dec)
  22.  
  23.         g = g + 50
  24.  
  25.         sleep(.05)
  26. until g == 250
  27.  
  28.  
  29.  
  30.  
  31. repeat  --this loop goes from 255-0 in Red
  32.  
  33.         form = string.format("%02x%02x%02x", r, g, b)
  34.         sub = string.gsub(form, ", ", "")
  35.         dec = tonumber(sub, 16)
  36.         c.setColor(dec)
  37.         d.setColor(dec)
  38.         e.setColor(dec)
  39.         f.setColor(dec)
  40.  
  41.         r = r - 50
  42.  
  43.         sleep(.05)
  44. until r == 0
  45.  
  46.  
  47.  
  48.  
  49. repeat  --this loop goes from 0-255 in Blue
  50.  
  51.         form = string.format("%02x%02x%02x", r, g, b)
  52.         sub = string.gsub(form, ", ", "")
  53.         dec = tonumber(sub, 16)
  54.         c.setColor(dec)
  55.         d.setColor(dec)
  56.         e.setColor(dec)
  57.         f.setColor(dec)
  58.         b = b + 50
  59.  
  60.         sleep(.05)
  61. until b == 250
  62.  
  63.  
  64.  
  65.  
  66. repeat  --this loop goes from 255-0 in Green
  67.  
  68.         form = string.format("%02x%02x%02x", r, g, b)
  69.         sub = string.gsub(form, ", ", "")
  70.         dec = tonumber(sub, 16)
  71.         c.setColor(dec)
  72.         d.setColor(dec)
  73.         e.setColor(dec)
  74.         f.setColor(dec)
  75.  
  76.         g = g - 50
  77.  
  78.         sleep(.05)
  79. until g == 0
  80.  
  81.  
  82.  
  83.  
  84. repeat  --this loop goes from 0-255 in Red
  85.  
  86.         form = string.format("%02x%02x%02x", r, g, b)
  87.         sub = string.gsub(form, ", ", "")
  88.         dec = tonumber(sub, 16)
  89.         c.setColor(dec)
  90.         d.setColor(dec)
  91.         e.setColor(dec)
  92.         f.setColor(dec)
  93.  
  94.         r = r + 50
  95.  
  96.     sleep(.05)
  97. until r == 250
  98.  
  99.  
  100.  
  101.  
  102. repeat  --this loop goes from 255-0 in Blue
  103.  
  104.         form = string.format("%02x%02x%02x", r, g, b)
  105.         sub = string.gsub(form, ", ", "")
  106.         dec = tonumber(sub, 16)
  107.         c.setColor(dec)
  108.         d.setColor(dec)
  109.         e.setColor(dec)
  110.         f.setColor(dec)
  111.  
  112.         b = b - 50
  113.  
  114.         sleep(.05)
  115. until b == 0
  116.  
  117. end
  118.  
  119.  
  120.  
  121.  
Add Comment
Please, Sign In to add comment