ayuda con script Topic is solved

Esta sección es para preguntas sobre programación/scripting usando AutoHotkey.

Moderator: Flipeador

Guest

ayuda con script  Topic is solved

23 Oct 2021, 04:45

Hola soy Franterrssa y soy nuevo por aquí. Estoy modificando un script y me e encontrado con un problema, al iniciar uno de los switch que hay va bien y puedo iniciar el otro también pero si deseo quitar el primero no me deja asta que no apague el segundo, hay alguna manera de que los dos se puedan encender y apagar si que se molesten?

Code: Select all

#IfWinActive Euro Truck Simulator 2 ; Replace "Euro Truck Simulator 2" with "American Truck Simulator" if you plan to use it in ATS
SetKeyDelay, 0, 1
firstrun = 1

; Off/Markers/Low beam switch function

2joy5::
Send L ; Markers on
KeyWait 2joy5 ; On release, switch off
Send L
Send L
return

2joy11::
Send L ; Low beam on
KeyWait 2joy11 ; On release, back to markers
Send L
Send L
return


; High beam

2joy4::
Send K
KeyWait 2joy4
Send K
return


; Next & Previous Gear

2joy16:: ; Front fog light
if (firstrun = 1) {
	firstrun = 0
	KeyWait 2joy12
	Send {RShift} ; Right Shift Key
} else {
	Send {RCtrl} ; Right Ctrl Key
	KeyWait 2joy12
	Send {RShift}
}
return

2joy1:: ; Back fog light
Send {RCtrl}
KeyWait 2joy1
Send {RShift}
return


; Left Blinker

2joy6::
Send A
KeyWait 2joy6
Send A
return


; Right Blinker

2joy18::
Send Z
KeyWait 2joy18
Send Z
return


; Horn

2joy2::
Send {H Down}
KeyWait 2joy2
Send {H Up}
return


; Flash

2joy3::
Send {J Down}
KeyWait 2joy3
Send {J Up}
return


; Off/Parking break/Warning switch function

2joy12::
Send w ; Parking break on
KeyWait 2joy12 ; On release, switch off
Send w
return

2joy10::
Send F ; Warning on
KeyWait 2joy10 ; On release, back to Parking break
Send F
return
safetycar
Posts: 435
Joined: 12 Aug 2017, 04:27

Re: ayuda con script

27 Oct 2021, 09:00

Al no saber que botones te dan problemas es un poco dificil saber que pasa.
Aunque hay algo que no parece tener sentido aquí:

Code: Select all

2joy16:: ; Front fog light
if (firstrun = 1) {
	firstrun = 0
	KeyWait 2joy12 ; <----- ???
	Send {RShift} ; Right Shift Key
} else {
	Send {RCtrl} ; Right Ctrl Key
	KeyWait 2joy12 ; <----- ???
	Send {RShift}
}
return
La intuición (sin saber que es lo que tiene que hacer) me dice que ambos KeyWait probablemente deberían ser con el texto 2joy16 (no 2joy12)

Return to “Pedir Ayuda”

Who is online

Users browsing this forum: No registered users and 33 guests