Hello,
I’d like to first make it known that I am by NO MEANS a programmer. A few years ago I bought some working “caution lights” for my racing simulator on my computer. The guy I got it from used these parts and software. The first time I used it, I cut and pasted the script directly into the script tab of the Maestro Windows Controller. I recently upgraded my Motherboard and CPU and have since now lost the functionality. I had to download and reinstall everything including the caution light software. When I tried to cut and paste into the script tab like last time, I either forgot to add/delete something or just plain not doing it right. I keep getting the following error - Subroutine call overflow/underflow
Can someone please examine the below file and reformat so it will work properly? Again, I’m not at all a coder so EVERYTHING in the script might as well be written in Chinese.
Thanks for any and all help and support!
[code]sub greenout
resetlights
0 1023 0 0 1023 0 0 1023 0 0 1023 0 0 1023 0 0 1023 0 0 1023 0 0 1023 0 rgb
5000 delay
0 50 0 0 50 0 0 50 0 0 50 0 0 50 0 0 50 0 0 50 0 0 50 0 rgb
return
sub greenwaving
resetlights
begin
green-flash
repeat
return
sub whiteflag
resetlights
begin
1023 1023 1023 1023 1023 1023 1023 1023 1023 1023 1023 1023 1023 1023 1023 1023 1023 1023 1023 1023 1023 1023 1023 1023 rgb
200 delay
0 50 0 0 50 0 0 50 0 0 50 0 0 50 0 0 50 0 0 50 0 0 50 0 rgb
repeat
return
sub CheckeredFlag
resetlights
Begin
white-flash
repeat
return
sub resetlights
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 rgb
return
sub cautionlights
resetlights
begin
yellow-flash
1023 800 0 1023 800 0 1023 800 0 1023 800 0 1023 800 0 1023 800 0 1023 800 0 1023 800 0 rgb
10000 delay
repeat
return
sub blackflag
begin
1023 0 500 1023 0 500 1023 0 500 1023 0 500 1023 0 500 1023 0 500 1023 0 500 1023 0 500 rgb
100 delay
0 50 0 0 50 0 0 50 0 0 50 0 0 50 0 0 50 0 0 50 0 0 50 0 rgb
repeat
return
sub halfway
begin
0 1023 0 0 30 0 0 1023 0 0 30 0 0 1023 0 0 30 0 0 1023 0 0 30 0 rgb
0 30 0 0 1023 0 0 30 0 0 1023 0 0 30 0 0 1023 0 0 30 0 0 1023 0 rgb
repeat
return
sub blueflag2
begin
0 0 1023 0 0 1023 0 0 1023 0 0 1023 0 0 1023 0 0 1023 0 0 1023 0 0 1023 rgb
0 0 900 0 0 900 0 0 900 0 0 900 0 0 900 0 0 900 0 0 900 0 0 900 rgb
0 0 800 0 0 800 0 0 800 0 0 800 0 0 800 0 0 800 0 0 800 0 0 800 rgb
0 0 700 0 0 700 0 0 700 0 0 700 0 0 700 0 0 700 0 0 700 0 0 700 rgb
0 0 600 0 0 600 0 0 600 0 0 600 0 0 600 0 0 600 0 0 600 0 0 600 rgb
0 0 500 0 0 500 0 0 500 0 0 500 0 0 500 0 0 500 0 0 500 0 0 500 rgb
0 0 400 0 0 400 0 0 400 0 0 400 0 0 400 0 0 400 0 0 400 0 0 400 rgb
0 0 300 0 0 300 0 0 300 0 0 300 0 0 300 0 0 300 0 0 300 0 0 300 rgb
0 0 200 0 0 200 0 0 200 0 0 200 0 0 200 0 0 200 0 0 200 0 0 200 rgb
0 0 100 0 0 100 0 0 100 0 0 100 0 0 100 0 0 100 0 0 100 0 0 100 rgb
0 0 50 0 0 50 0 0 50 0 0 50 0 0 50 0 0 50 0 0 50 0 0 50 rgb
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 rgb
0 0 50 0 0 50 0 0 50 0 0 50 0 0 50 0 0 50 0 0 50 0 0 50 rgb
0 0 100 0 0 100 0 0 100 0 0 100 0 0 100 0 0 100 0 0 100 0 0 100 rgb
0 0 200 0 0 200 0 0 200 0 0 200 0 0 200 0 0 200 0 0 200 0 0 200 rgb
0 0 300 0 0 300 0 0 300 0 0 300 0 0 300 0 0 300 0 0 300 0 0 300 rgb
0 0 400 0 0 400 0 0 400 0 0 400 0 0 400 0 0 400 0 0 400 0 0 400 rgb
0 0 500 0 0 500 0 0 500 0 0 500 0 0 500 0 0 500 0 0 500 0 0 500 rgb
0 0 600 0 0 600 0 0 600 0 0 600 0 0 600 0 0 600 0 0 600 0 0 600 rgb
0 0 700 0 0 700 0 0 700 0 0 700 0 0 700 0 0 700 0 0 700 0 0 700 rgb
0 0 800 0 0 800 0 0 800 0 0 800 0 0 800 0 0 800 0 0 800 0 0 800 rgb
0 0 900 0 0 900 0 0 900 0 0 900 0 0 900 0 0 900 0 0 900 0 0 900 rgb
0 0 1023 0 0 1023 0 0 1023 0 0 1023 0 0 1023 0 0 1023 0 0 1023 0 0 1023 rgb
repeat
return
sub blackflagrepair
begin
1023 0 500 1023 0 0 1023 0 0 1023 0 0 1023 0 500 1023 0 500 1023 0 500 1023 0 500 rgb
1023 0 0 1023 0 500 1023 0 0 1023 0 500 1023 0 0 1023 0 0 1023 0 0 1023 0 0 rgb
repeat
return
setting the RGB value of a ShiftBrite/ShiftBar.
example usage: 1023 511 255 rgb
sub rgb
0 send_bit # this bit does not matter
0 send_bit # the “address” bit - 0 means a color command
swap rot rot
send_10_bit_value
send_10_bit_value
send_10_bit_value
0 send_bit # this bit does not matter
0 send_bit # the “address” bit - 0 means a color command
swap rot rot
send_10_bit_value
send_10_bit_value
send_10_bit_value
0 send_bit # this bit does not matter
0 send_bit # the “address” bit - 0 means a color command
swap rot rot
send_10_bit_value
send_10_bit_value
send_10_bit_value
0 send_bit # this bit does not matter
0 send_bit # the “address” bit - 0 means a color command
swap rot rot
send_10_bit_value
send_10_bit_value
send_10_bit_value
0 send_bit # this bit does not matter
0 send_bit # the “address” bit - 0 means a color command
swap rot rot
send_10_bit_value
send_10_bit_value
send_10_bit_value
0 send_bit # this bit does not matter
0 send_bit # the “address” bit - 0 means a color command
swap rot rot
send_10_bit_value
send_10_bit_value
send_10_bit_value
0 send_bit # this bit does not matter
0 send_bit # the “address” bit - 0 means a color command
swap rot rot
send_10_bit_value
send_10_bit_value
send_10_bit_value
0 send_bit # this bit does not matter
0 send_bit # the “address” bit - 0 means a color command
swap rot rot
send_10_bit_value
send_10_bit_value
send_10_bit_value
0 1 8000 1 servo servo # toggle the latch pin
return
sends a numerical value as a sequence of 10 bits
sub send_10_bit_value
512
begin
dup
while
over over bitwise_and send_bit
1 shift_right
repeat
drop drop
return
sends a single bit
sub send_bit
if 8000 else 0 endif
2 servo # set DATA to 0 or 1
0 0 8000 0 servo servo # toggle CLOCK
return
sub input
5 get_position
dup 150 less_than
if
drop 0
else
1023 min 4 times
endif
return
sub random
20 begin
dup while
input input input rgbn
1 minus repeat
drop return
sub latch
0 1 8000 1 servo servo # toggle the latch pin
return
sub strobeon
16 begin
dup while
1023 1023 1023 RGB2
1 minus repeat
drop return
sub strobeoff
16 begin
dup while
0 0 0 RGB2
1 minus repeat
drop return
sub redstrobe
50
begin
dup
while
red
off
1 minus
repeat
drop return
sub strobe3
5 begin
dup while
strobeon
latch
strobeoff
latch
1 minus repeat
drop return
sub blue-scroll
5 begin
dup while
blue
off
off
off
off
off
off
off
off
off
off
off
off
off
off
off
1 minus repeat
drop return
sub green-scroll
5 begin
dup while
green
off
off
off
off
off
off
off
off
off
off
off
off
off
off
off
1 minus repeat
drop return
sub red-scroll
5 begin
dup while
red
off
off
off
off
off
off
off
off
off
off
off
off
off
off
off
1 minus repeat
drop return
sub blue-flash
20 begin
dup while
blue
off
off
off
off
1 minus
repeat
drop return
sub red-flash
20 begin
dup while
red
off
off
off
off
1 minus
repeat
drop return
sub yellow-flash
20 begin
dup while
yellow
off
off
off
off
1 minus
repeat
drop return
sub green-flash
20 begin
dup while
green
off
off
off
off
1 minus
repeat
drop return
sub white-flash
20 begin
dup while
white
off
off
off
off
1 minus
repeat
drop return
sub yellow
1023 800 0 rgbn
return
sub pink
1000 200 200 rgbn
return
sub green/red
1023 900 0 rgbn
return
sub green
0 1023 0 rgbn
return
sub red
1023 0 0 rgbn
return
sub blue
0 0 1023 rgbn
return
sub greenredflash
10 begin
dup while
green/red
green/red
green/red
green/red
off
1 minus
repeat
drop return
sub pinkflash
10 begin
dup while
pink
pink
pink
off
off
1 minus
repeat
drop return
sub bluestrobe
50
begin
dup
while
blue
off
1 minus
repeat
drop return
10 begin
dup while
pink
pink
pink
pink
off
1 minus
repeat
drop return
sub white5
10 begin
dup while
white
white
white
white
white
off
1 minus repeat
drop return
sub white
1023 1023 1023 rgbn
return
sub white2
1023 1023 1023 rgb2
delay1
return
sub off
0 0 0 rgbn
return
sub on
50
begin
dup
while
white
off
1 minus
repeat
drop return
sub clear
16
begin
dup
while
0 0 0 rgb2
1 minus
repeat
drop return
sub Colour
10
begin
dup
while
1023 0 0 rgbn
delay1
900 0 0 rgbn
delay1
700 0 0 rgbn
delay1
300 0 0 rgbn
delay1
0 0 0 rgbn
delay1
0 300 0 rgbn
delay1
0 700 0 rgbn
delay1
0 900 0 rgbn
delay1
0 1023 0 rgbn
delay1
0 900 0 rgbn
delay1
0 700 0 rgbn
delay1
0 300 0 rgbn
delay1
0 0 0 rgbn
delay1
0 0 300 rgbn
delay1
0 0 700 rgbn
delay1
0 0 900 rgbn
delay1
0 0 1023 rgbn
delay1
0 0 900 rgbn
delay1
0 0 700 rgbn
delay1
0 0 300 rgbn
delay1
300 300 700 rgbn
delay1
300 700 900 rgbn
delay1
700 900 1023 rgbn
delay1
900 1023 1023 rgbn
delay1
1023 1023 1023 rgbn
delay1
1023 900 900 rgbn
delay1
1023 700 700 rgbn
delay1
1023 300 300 rgbn
delay1
1023 0 0 rgbn
delay1
1 minus
repeat
drop return
Subroutine for setting the RGB value of a ShiftBrite/ShiftBar.
example usage: 1023 511 255 rgb
sub rgbn
0 send_bit # this bit does not matter
0 send_bit # the “address” bit - 0 means a color command
swap rot rot
send_10_bit_value
send_10_bit_value
send_10_bit_value
0 1 8000 1 servo servo # toggle the latch pin
return
Subroutine for setting the RGB value of a ShiftBrite/ShiftBar.
example usage: 1023 511 255 rgb
sub rgb2
0 send_bit # this bit does not matter
0 send_bit # the “address” bit - 0 means a color command
swap rot rot
send_10_bit_value
send_10_bit_value
send_10_bit_value
return
sub delay1
50 delay
return[/code]