Advertisement
Guest User

DiscoScript G510/G19

a guest
Mar 15th, 2012
2,469
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.21 KB | None | 0 0
  1. --Script for G510:
  2.  
  3. --Press G1 to 15 to change between colors and G15 to 18 to activate the Disco Mod (different speed)
  4. --to deactivate the Disco Mod press M1 or M3
  5.  
  6. function OnEvent(event, arg)
  7. if (event == "PROFILE_ACTIVATED") then
  8. r1, g1, b1 = 0, 0, 0
  9. color( 255, 0, 0, 25)
  10. end
  11. if (event == "M_PRESSED" and arg == 2) then
  12. color( 255, 0, 0, 25)
  13. end
  14. if (event == "PROFILE_DEACTIVATED") then
  15. color( 255, 0, 0, 15)
  16. end
  17. if (event == "G_PRESSED" and arg == 1) then
  18. color( 255, 45, 0, 25)
  19. end
  20. if (event == "G_PRESSED" and arg == 2) then
  21. color( 255, 120, 0, 25)
  22. end
  23. if (event == "G_PRESSED" and arg == 3) then
  24. color( 255, 175, 0, 25)
  25. end
  26. if (event == "G_PRESSED" and arg == 4) then
  27. color( 255, 255, 0, 25)
  28. end
  29. if (event == "G_PRESSED" and arg == 5) then
  30. color( 175, 255, 0, 25)
  31. end
  32. if (event == "G_PRESSED" and arg == 6) then
  33. color( 100, 255, 0, 25)
  34. end
  35. if (event == "G_PRESSED" and arg == 7) then
  36. color( 0, 255, 0, 25)
  37. end
  38. if (event == "G_PRESSED" and arg == 8) then
  39. color( 0, 255, 50, 25)
  40. end
  41. if (event == "G_PRESSED" and arg == 9) then
  42. color( 0, 255, 150, 25)
  43. end
  44. if (event == "G_PRESSED" and arg == 10) then
  45. color( 0, 255, 255, 25)
  46. end
  47. if (event == "G_PRESSED" and arg == 11) then
  48. color( 0, 150, 255, 25)
  49. end
  50. if (event == "G_PRESSED" and arg == 12) then
  51. color( 0, 0, 255, 25)
  52. end
  53. if (event == "G_PRESSED" and arg == 13) then
  54. color( 100, 0, 255, 25)
  55. end
  56. if (event == "G_PRESSED" and arg == 14) then
  57. color( 255, 0, 255, 25)
  58. end
  59.  
  60. if (event == "G_PRESSED" and arg == 15) then
  61. color( 255, 0, 80, 25)
  62. end
  63.  
  64. if (event == "G_PRESSED" and arg == 16) then
  65. m = GetMKeyState()
  66. while (GetMKeyState() == m) do
  67. color( 255, 0, 0, 1)
  68. color( 255, 45, 0, 1)
  69. color( 255, 120, 0, 1)
  70. color( 255, 175, 0, 1)
  71. color( 255, 255, 0, 1)
  72. color( 175, 255, 0, 1)
  73. color( 100, 255, 0, 1)
  74. color( 0, 255, 0, 1)
  75. color( 0, 255, 50, 1)
  76. color( 0, 255, 150, 1)
  77. color( 0, 255, 255, 1)
  78. color( 0, 150, 255, 1)
  79. color( 0, 0, 255, 1)
  80. color( 100, 0, 255, 1)
  81. color( 255, 0, 255, 1)
  82. color( 255, 0, 80, 1)
  83. end
  84. end
  85.  
  86. if (event == "G_PRESSED" and arg == 17) then
  87. m = GetMKeyState()
  88. while (GetMKeyState() == m) do
  89. color( 255, 0, 0, 5)
  90. color( 255, 45, 0, 5)
  91. color( 255, 120, 0, 5)
  92. color( 255, 175, 0, 5)
  93. color( 255, 255, 0, 5)
  94. color( 175, 255, 0, 5)
  95. color( 100, 255, 0, 5)
  96. color( 0, 255, 0, 5)
  97. color( 0, 255, 50, 5)
  98. color( 0, 255, 150, 5)
  99. color( 0, 255, 255, 5)
  100. color( 0, 150, 255, 5)
  101. color( 0, 0, 255, 5)
  102. color( 100, 0, 255, 5)
  103. color( 255, 0, 255, 5)
  104. color( 255, 0, 80, 5)
  105. end
  106. end
  107.  
  108. if (event == "G_PRESSED" and arg == 18) then
  109. m = GetMKeyState()
  110. while (GetMKeyState() == m) do
  111. color( 255, 0, 0, 30)
  112. color( 255, 45, 0, 30)
  113. color( 255, 120, 0, 30)
  114. color( 255, 175, 0, 30)
  115. color( 255, 255, 0, 30)
  116. color( 175, 255, 0, 30)
  117. color( 100, 255, 0, 30)
  118. color( 0, 255, 0, 30)
  119. color( 0, 255, 50, 30)
  120. color( 0, 255, 150, 30)
  121. color( 0, 255, 255, 30)
  122. color( 0, 150, 255, 30)
  123. color( 0, 0, 255, 30)
  124. color( 100, 0, 255, 30)
  125. color( 255, 0, 255, 30)
  126. color( 255, 0, 80, 30)
  127. end
  128. end
  129. end
  130.  
  131. --color(_r2, g2, b2, speed)
  132.  
  133. function color(r2, g2, b2, speed)
  134. for loop = 5, 255, 50 do
  135. SetBacklightColor((r2*loop+r1*(255-loop) )/255, (g2*loop+g1*(255-loop))/255, (b2*loop+b1*(255-loop))/255);
  136. Sleep(speed)
  137. end
  138. r1 = r2
  139. g1 = g2
  140. b1 = b2
  141. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement