Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #singleinstance, force
- #include <cvjoyinterface> ;vjoy interface
- vjoy:=new cvjoyinterface() ;create parent obj
- vjoy.singlestickmode:=0 ;control multiple joys
- joynum:=2 ;how many joysticks
- btnnum:=5 ;how many buttons on each
- delay:=2500 ;delay between inputs
- mindelay:=50 ;minimum delay
- btntur:=5 ;optional turbo button
- while(1) ;loop entire script
- {
- lap:=1 ;init lap for next loop
- while(lap<=joynum) ;init all joys
- {
- joy_%lap%:=vjoy.devices[lap]
- lap_b:=1 ;init lap for next loop
- while(lap_b<=btnnum) ;init buttons for each joy
- {
- joy_%lap%_btn_%lap_b%:=0
- joy_%lap%.setbtn(0,lap_b)
- lap_b++
- }
- lap++
- }
- reset:=0 ;init reset var
- MsgBox, 0, , ;pause until closed
- while(!reset) ;input generation
- {
- if getkeystate("rctrl") ;detect input before
- {
- reset:=1
- }
- random,joysel,1,joynum ;randomize picks
- random,btnsel,1,btnnum ;
- random,delay_b,1,delay ;
- random,delay_c,1,delay_b ;weigh towards low delay
- joy_%joysel%.setbtn(joy_%joysel%_btn_%btnsel%,btnsel) ;actual input
- joy_%joysel%_btn_%btnsel%:=!(joy_%joysel%_btn_%btnsel%) ;invert button state
- joy_%joysel%.setbtn(joy_%joysel%_btn_%btntur%,btntur) ;turbo input
- joy_%joysel%_btn_%btntur%:=!(joy_%joysel%_btn_%btntur%)
- sleep,delay_c/(joynum*btnnum) ;wait depends on number of buttons/joys
- if getkeystate("rctrl") ;detect input after
- {
- reset=1
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement