#include joylib joynum:=2 ;how many joysticks butnum:=5 ;how many buttons on each delay:=1000 ;delay between inputs buttur:=5 ;optional turbo button while(1) ;loop entire script { lap:=1 ;init lap for next loop while(lap<=joynum) ;init all joys { joy_%lap%.initialize[%lap%] lap_b:=1 ;init lap for next loop while(lap_b<=butnum) ;init buttons for each joy { joy_%lap%_but_%lap2%=0 lap_b++ } lap++ } reset:=0 ;init reset var while(!reset) ;input generation { if getkeystate("rctrl") ;detect input before { reset:=1 } joysel=random,1,joynum ;randomize picks butsel=random,1,butnum ; delay_b=random,1,delay ; delay_c=random,1,delay_b ;weigh towards low delay joy_%joysel%.setbtn(joy_%joysel%_but_%butsel%,butsel) ;actual input joy_%joysel%_but_%butsel%:=!(joy_%joysel%_but_%butsel%) ;invert button state wait,delay_c/(joynum*butnum) ;wait depends on number of buttons/joys joy_%joysel%.setbtn(0,buttur) ;turbo input wait,10 ; joy_%joysel%.setbtn(1,buttur) ; if getkeyval("rctrl") ;detect input after { reset=1 } } }