Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Script for G510:
- --Press G1 to 15 to change between colors and G15 to 18 to activate the Disco Mod (different speed)
- --to deactivate the Disco Mod press M1 or M3
- function OnEvent(event, arg)
- if (event == "PROFILE_ACTIVATED") then
- r1, g1, b1 = 0, 0, 0
- color( 255, 0, 0, 25)
- end
- if (event == "M_PRESSED" and arg == 2) then
- color( 255, 0, 0, 25)
- end
- if (event == "PROFILE_DEACTIVATED") then
- color( 255, 0, 0, 15)
- end
- if (event == "G_PRESSED" and arg == 1) then
- color( 255, 45, 0, 25)
- end
- if (event == "G_PRESSED" and arg == 2) then
- color( 255, 120, 0, 25)
- end
- if (event == "G_PRESSED" and arg == 3) then
- color( 255, 175, 0, 25)
- end
- if (event == "G_PRESSED" and arg == 4) then
- color( 255, 255, 0, 25)
- end
- if (event == "G_PRESSED" and arg == 5) then
- color( 175, 255, 0, 25)
- end
- if (event == "G_PRESSED" and arg == 6) then
- color( 100, 255, 0, 25)
- end
- if (event == "G_PRESSED" and arg == 7) then
- color( 0, 255, 0, 25)
- end
- if (event == "G_PRESSED" and arg == 8) then
- color( 0, 255, 50, 25)
- end
- if (event == "G_PRESSED" and arg == 9) then
- color( 0, 255, 150, 25)
- end
- if (event == "G_PRESSED" and arg == 10) then
- color( 0, 255, 255, 25)
- end
- if (event == "G_PRESSED" and arg == 11) then
- color( 0, 150, 255, 25)
- end
- if (event == "G_PRESSED" and arg == 12) then
- color( 0, 0, 255, 25)
- end
- if (event == "G_PRESSED" and arg == 13) then
- color( 100, 0, 255, 25)
- end
- if (event == "G_PRESSED" and arg == 14) then
- color( 255, 0, 255, 25)
- end
- if (event == "G_PRESSED" and arg == 15) then
- color( 255, 0, 80, 25)
- end
- if (event == "G_PRESSED" and arg == 16) then
- m = GetMKeyState()
- while (GetMKeyState() == m) do
- color( 255, 0, 0, 1)
- color( 255, 45, 0, 1)
- color( 255, 120, 0, 1)
- color( 255, 175, 0, 1)
- color( 255, 255, 0, 1)
- color( 175, 255, 0, 1)
- color( 100, 255, 0, 1)
- color( 0, 255, 0, 1)
- color( 0, 255, 50, 1)
- color( 0, 255, 150, 1)
- color( 0, 255, 255, 1)
- color( 0, 150, 255, 1)
- color( 0, 0, 255, 1)
- color( 100, 0, 255, 1)
- color( 255, 0, 255, 1)
- color( 255, 0, 80, 1)
- end
- end
- if (event == "G_PRESSED" and arg == 17) then
- m = GetMKeyState()
- while (GetMKeyState() == m) do
- color( 255, 0, 0, 5)
- color( 255, 45, 0, 5)
- color( 255, 120, 0, 5)
- color( 255, 175, 0, 5)
- color( 255, 255, 0, 5)
- color( 175, 255, 0, 5)
- color( 100, 255, 0, 5)
- color( 0, 255, 0, 5)
- color( 0, 255, 50, 5)
- color( 0, 255, 150, 5)
- color( 0, 255, 255, 5)
- color( 0, 150, 255, 5)
- color( 0, 0, 255, 5)
- color( 100, 0, 255, 5)
- color( 255, 0, 255, 5)
- color( 255, 0, 80, 5)
- end
- end
- if (event == "G_PRESSED" and arg == 18) then
- m = GetMKeyState()
- while (GetMKeyState() == m) do
- color( 255, 0, 0, 30)
- color( 255, 45, 0, 30)
- color( 255, 120, 0, 30)
- color( 255, 175, 0, 30)
- color( 255, 255, 0, 30)
- color( 175, 255, 0, 30)
- color( 100, 255, 0, 30)
- color( 0, 255, 0, 30)
- color( 0, 255, 50, 30)
- color( 0, 255, 150, 30)
- color( 0, 255, 255, 30)
- color( 0, 150, 255, 30)
- color( 0, 0, 255, 30)
- color( 100, 0, 255, 30)
- color( 255, 0, 255, 30)
- color( 255, 0, 80, 30)
- end
- end
- end
- --color(_r2, g2, b2, speed)
- function color(r2, g2, b2, speed)
- for loop = 5, 255, 50 do
- SetBacklightColor((r2*loop+r1*(255-loop) )/255, (g2*loop+g1*(255-loop))/255, (b2*loop+b1*(255-loop))/255);
- Sleep(speed)
- end
- r1 = r2
- g1 = g2
- b1 = b2
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement