muchas gracias
Moderator: Flipeador
Re: COMBINAR 2 SCRIPTS EN UNO SOLO
Hola Thorx,
¿Puedes poner ambos scripts?
--------------------------------------------
¿Puedes poner ambos scripts?
--------------------------------------------
Re: COMBINAR 2 SCRIPTS EN UNO SOLO
Hola gracias
Last edited by Thorx on 27 Nov 2015, 09:09, edited 1 time in total.
Re: COMBINAR 2 SCRIPTS EN UNO SOLO
No se bien cual es la funcion de los scripts , pero acá los tienes unidos (sin probar):
F1 = activar/desactivar no-recoil
F2 = activar/desactivar crosshair
F11 = salir
F12 = recargar
Nota: debes ponerlo en el mismo directorio junto con el archivo Crosshair.ini y la carpeta IMG
F1 = activar/desactivar no-recoil
F2 = activar/desactivar crosshair
F11 = salir
F12 = recargar
Code: Select all
#NoEnv
#SingleInstance, Force
SetBatchLines, -1
SetWorkingDir, %A_ScriptDir% ; Ensures a consistent starting directory.
CoordMode, ToolTip, Screen
Hotkey, ~LButton, Auto_Fire, Off
Hotkey, PGDN, _PGDN, Off
Hotkey, HOME, _HOME, Off
Hotkey, ^Up, _Up, Off
Hotkey, ^Down, _Down, Off
Hotkey, ^Right, _Right, Off
Hotkey, ^Left, _Left, Off
Hotkey, NumpadDiv, _NumpadDiv, Off
Hotkey, NumpadMult, _NumpadMult, Off
Hotkey, NumpadSub, _NumpadSub, Off
Hotkey, NumpadAdd, _NumpadAdd, Off
return
;on/off
F1::
Hotkey, ~LButton, Toggle
return
F2::
_f2 := !_f2
ToolTip
if (_f2) {
gosub, Load_Settings
} else {
SetTimer, Menu, Off
} Hotkey, PGDN, Toggle
Hotkey, HOME, Toggle
Hotkey, ^Up, Toggle
Hotkey, ^Down, Toggle
Hotkey, ^Right, Toggle
Hotkey, ^Left, Toggle
Hotkey, NumpadDiv, Toggle
Hotkey, NumpadMult, Toggle
Hotkey, NumpadSub, Toggle
Hotkey, NumpadAdd, Toggle
return
;recargar
F12::Reload
;salir
F11::ExitApp
;no-recoil
Auto_Fire:
while (GetKeyState("LButton", "P")) {
SendInput, {LButton DownTemp}
Sleep, 22
DllCall("User32.dll\mouse_event", "UInt", 1, "UInt", 0, "UInt", 1, "UInt", 0, "UPtr", 0)
SendInput {LButton Up}
Sleep 22
}
return
Load_Settings:
ScriptName := "Crosshair" ;SplitPath, A_ScriptName,,,, ScriptName
vm := ft := 1, chv := 0
IniRead, chxt, %ScriptName%.ini, Crochair tol,chxt
IniRead, chyt, %ScriptName%.ini, Crochair tol,chyt
IniRead, chp, %ScriptName%.ini, Crochair Picture, PictureNum
IniRead, chcl, %ScriptName%.ini, Crochair Picture, Picturecolor
IniRead, chc, %ScriptName%.ini, Crochair Picture, Picturecolorval
IniRead, chimg, %ScriptName%.ini, Crochair Picture, PictureFile
IniRead, chimgw, %ScriptName%.ini, Crochair Picture, PictureWidth
IniRead, chimgh, %ScriptName%.ini, Crochair Picture, PictureHeight
SetTimer, menu, 200
goto, menu
return
;cross-hair
_PGDN:
vm := !vm
SetTimer, Menu, % vm?200:"Off"
if !(vm)
ToolTip,,,, 1
else gosub, Menu
return
Menu:
ToolTip, % "Crosshair Type:" A_Tab chp
. "`nCrosshair Color:" A_Tab chcl
. "`nCrosshair Size:" A_Tab chimgw
. "`n---------------------------------------------"
. "`nPageDown:" A_Tab "Show/Hide Menu"
. "`nHome:" A_Tab A_Tab "Show/Hide Crosshair"
. "`n/:" A_Tab A_Tab "Change Crosshair type"
. "`n*:" A_Tab A_Tab "Change Crosshair color"
. "`n+:" A_Tab A_Tab "Increase Crosshair Size"
. "`n-:" A_Tab A_Tab "Decrease Crosshair Size"
. "`nCtrl+Arows:" A_Tab "Move Crosshair Position", 0, 0
return
_HOME:
if (chv) {
Gui, Hide
SetTimer, tick, Off
chv := 0
} else {
gosub, % ft?"showch":"drawch"
chv := 1
SetTimer, tick, 200
}
return
showch:
if !(ft)
return
wint := WinExist("A")
WinGetPos, winx, winy, winw, winh, ahk_id %wint%
gosub, posch
Gui, +AlwaysOnTop -Caption +LastFound
WinSet, TransColor, White
Gui, Add, Picture, w%chimgw% h%chimgh% AltSubmit, %A_ScriptDir%\IMG\%chimg%
Gui, Color, FFFFFF
Gui, Show, NA x%chx% y%chy%
ft := 0
return
posch:
chx := winx + (winw / 2) + chxt - chimgw
chy := winy + (winh / 2) + chyt - chimgh
return
drawch:
gosub, posch
Gui, Show, NA x%chx% y%chy%
return
tick:
if (WinActive("ahk_id " wint)) {
WinGetPos, winx1, winy1, winw1, winh1, ahk_id %wint%
if !(winx1=winx) || !(winy1=winy) || !(winw1=winw) || !(winh1=winh) {
WinGetPos, winx, winy, winw, winh, ahk_id %wint%
if (chv)
gosub, drawch
}
} else Gui, Hide
return
_Up:
chyt--
gosub, drawch
IniWrite, %chyt%, %ScriptName%.ini, Crochair tol, chyt
return
_Down:
chyt++
gosub, drawch
IniWrite, %chyt%, %ScriptName%.ini, Crochair tol, chyt
return
_Left:
chxt--
gosub, drawch
IniWrite, %chxt%, %ScriptName%.ini, Crochair tol, chxt
return
_Right:
chxt++
gosub, drawch
IniWrite, %chxt%, %ScriptName%.ini, Crochair tol, chxt
return
_NumpadDiv:
if !(chv)
return
if chp between 1 and 5
chp++
else chp := 1
chimg := "CH" chp chc
IniWrite, %chimg%, %ScriptName%.ini , Crochair Picture, PictureFile
IniWrite, %chp%, %ScriptName%.ini , Crochair Picture, PictureNum
Gui, Destroy
ft := 1
gosub, showch
return
_NumpadMult:
if !(chv)
return
chc := chc=1?2:chc=2?3:chc=3?4:chc=4?1:chc
chcl := chc=1?"Green":chc=2?"Red":chc=3?"Yellow":chc=4?"Blue":chcl
chimg := "CH" chp chc
IniWrite, %chimg%, %ScriptName%.ini , Crochair Picture, PictureFile
IniWrite, %chcl%, %ScriptName%.ini , Crochair Picture, Picturecolor
IniWrite, %chc%, %ScriptName%.ini , Crochair Picture, Picturecolorval
Gui, Destroy
ft := 1
gosub, showch
return
_NumpadSub:
if !(chv)
return
chimgw--
chimgw := chimgw<5?5:chimgw
chimgh--
chimgh := chimgh<5?5:chimgh
IniWrite, %chimgw%, %ScriptName%.ini , Crochair Picture, PictureWidth
IniWrite, %chimgh%, %ScriptName%.ini , Crochair Picture, PictureHeight
Gui, Destroy
ft := 1
gosub, showch
return
_NumpadAdd:
if !(chv)
return
chimgw++
chimgw := chimgw>200?20:chimgw
chimgh++
chimgh := chimgh>200?200:chimgh
IniWrite, %chimgw%, %ScriptName%.ini , Crochair Picture, PictureWidth
IniWrite, %chimgh%, %ScriptName%.ini , Crochair Picture, PictureHeight
Gui, Destroy
ft := 1
gosub, showch
return
Re: COMBINAR 2 SCRIPTS EN UNO SOLO
¿a que te refieres con menú desplegable?
el ¿ToolTip?
lo puedes ocultar con la tecla "Page Down", en mi teclado "AV PÁG"
le hice algunos pequeños cambios:
el ¿ToolTip?
lo puedes ocultar con la tecla "Page Down", en mi teclado "AV PÁG"
le hice algunos pequeños cambios:
Code: Select all
#NoEnv
#SingleInstance, Force
SetBatchLines, -1
SetWorkingDir, %A_ScriptDir% ; Ensures a consistent starting directory.
CoordMode, ToolTip, Screen
Hotkey, ~LButton, Auto_Fire, Off
Hotkey, PGDN, _PGDN, Off
Hotkey, HOME, _HOME, Off
Hotkey, ^Up, _Up, Off
Hotkey, ^Down, _Down, Off
Hotkey, ^Right, _Right, Off
Hotkey, ^Left, _Left, Off
Hotkey, NumpadDiv, _NumpadDiv, Off
Hotkey, NumpadMult, _NumpadMult, Off
Hotkey, NumpadSub, _NumpadSub, Off
Hotkey, NumpadAdd, _NumpadAdd, Off
return
;on/off
F1::
Hotkey, ~LButton, Toggle
return
F2::
_f2 := !_f2
ToolTip
Gui, Destroy
if (_f2) {
gosub, Load_Settings
} else {
SetTimer, Menu, Off
} Hotkey, PGDN, Toggle
Hotkey, HOME, Toggle
Hotkey, ^Up, Toggle
Hotkey, ^Down, Toggle
Hotkey, ^Right, Toggle
Hotkey, ^Left, Toggle
Hotkey, NumpadDiv, Toggle
Hotkey, NumpadMult, Toggle
Hotkey, NumpadSub, Toggle
Hotkey, NumpadAdd, Toggle
return
;recargar
F12::Reload
;salir
F11::ExitApp
;no-recoil
Auto_Fire:
while (GetKeyState("LButton", "P")) {
SendInput, {LButton DownTemp}
Sleep, 22
DllCall("User32.dll\mouse_event", "UInt", 1, "UInt", 0, "UInt", 1, "UInt", 0, "UPtr", 0)
SendInput {LButton Up}
Sleep 22
}
return
Load_Settings:
ScriptName := "Crosshair" ;SplitPath, A_ScriptName,,,, ScriptName
vm := ft := 1, chv := 0
IniRead, chxt, %ScriptName%.ini, Crochair tol,chxt
IniRead, chyt, %ScriptName%.ini, Crochair tol,chyt
IniRead, chp, %ScriptName%.ini, Crochair Picture, PictureNum
IniRead, chcl, %ScriptName%.ini, Crochair Picture, Picturecolor
IniRead, chc, %ScriptName%.ini, Crochair Picture, Picturecolorval
IniRead, chimg, %ScriptName%.ini, Crochair Picture, PictureFile
IniRead, chimgw, %ScriptName%.ini, Crochair Picture, PictureWidth
IniRead, chimgh, %ScriptName%.ini, Crochair Picture, PictureHeight
SetTimer, menu, 200
goto, menu
return
;cross-hair
_PGDN:
vm := !vm
SetTimer, Menu, % vm?200:"Off"
if !(vm)
ToolTip,,,, 1
else gosub, Menu
return
Menu:
ToolTip, % "Crosshair Type:" A_Tab chp
. "`nCrosshair Color:" A_Tab chcl
. "`nCrosshair Size:" A_Tab chimgw
. "`n---------------------------------------------"
. "`nPageDown:" A_Tab "Show/Hide Menu"
. "`nHome:" A_Tab A_Tab "Show/Hide Crosshair"
. "`n/:" A_Tab A_Tab "Change Crosshair type"
. "`n*:" A_Tab A_Tab "Change Crosshair color"
. "`n+:" A_Tab A_Tab "Increase Crosshair Size"
. "`n-:" A_Tab A_Tab "Decrease Crosshair Size"
. "`nCtrl+Arows:" A_Tab "Move Crosshair Position", 0, 0
return
_HOME:
if (chv) {
Gui, Hide
SetTimer, tick, Off
chv := 0
} else {
gosub, % ft?"showch":"drawch"
chv := 1
SetTimer, tick, 200
}
return
showch:
if !(ft)
return
wint := WinExist("A")
WinGetPos, winx, winy, winw, winh, ahk_id %wint%
gosub, posch
Gui, +AlwaysOnTop -Caption +LastFound +ToolWindow
WinSet, TransColor, White
Gui, Color, FFFFFF
Gui, Add, Picture, w%chimgw% h%chimgh% AltSubmit, %A_ScriptDir%\IMG\%chimg%
Gui, Show, NA x%chx% y%chy%
ft := 0
return
posch:
chx := winx + (winw / 2) + chxt - chimgw
chy := winy + (winh / 2) + chyt - chimgh
return
drawch:
gosub, posch
Gui, Show, NA x%chx% y%chy%
return
tick:
if (WinActive("ahk_id " wint)) {
WinGetPos, winx1, winy1, winw1, winh1, ahk_id %wint%
if !(winx1=winx) || !(winy1=winy) || !(winw1=winw) || !(winh1=winh) {
WinGetPos, winx, winy, winw, winh, ahk_id %wint%
if (chv)
gosub, drawch
}
} else Gui, Hide
return
_Up:
chyt--
gosub, drawch
IniWrite, %chyt%, %ScriptName%.ini, Crochair tol, chyt
return
_Down:
chyt++
gosub, drawch
IniWrite, %chyt%, %ScriptName%.ini, Crochair tol, chyt
return
_Left:
chxt--
gosub, drawch
IniWrite, %chxt%, %ScriptName%.ini, Crochair tol, chxt
return
_Right:
chxt++
gosub, drawch
IniWrite, %chxt%, %ScriptName%.ini, Crochair tol, chxt
return
_NumpadDiv:
if !(chv)
return
if chp between 1 and 5
chp++
else chp := 1
chimg := "CH" chp chc
IniWrite, %chimg%, %ScriptName%.ini , Crochair Picture, PictureFile
IniWrite, %chp%, %ScriptName%.ini , Crochair Picture, PictureNum
Gui, Destroy
ft := 1
gosub, showch
return
_NumpadMult:
if !(chv)
return
chc := chc=1?2:chc=2?3:chc=3?4:chc=4?1:chc
chcl := chc=1?"Green":chc=2?"Red":chc=3?"Yellow":chc=4?"Blue":chcl
chimg := "CH" chp chc
IniWrite, %chimg%, %ScriptName%.ini , Crochair Picture, PictureFile
IniWrite, %chcl%, %ScriptName%.ini , Crochair Picture, Picturecolor
IniWrite, %chc%, %ScriptName%.ini , Crochair Picture, Picturecolorval
Gui, Destroy
ft := 1
gosub, showch
return
_NumpadSub:
if !(chv)
return
chimgw--
chimgw := chimgw<5?5:chimgw
chimgh--
chimgh := chimgh<5?5:chimgh
IniWrite, %chimgw%, %ScriptName%.ini , Crochair Picture, PictureWidth
IniWrite, %chimgh%, %ScriptName%.ini , Crochair Picture, PictureHeight
Gui, Destroy
ft := 1
gosub, showch
return
_NumpadAdd:
if !(chv)
return
chimgw++
chimgw := chimgw>200?20:chimgw
chimgh++
chimgh := chimgh>200?200:chimgh
IniWrite, %chimgw%, %ScriptName%.ini , Crochair Picture, PictureWidth
IniWrite, %chimgh%, %ScriptName%.ini , Crochair Picture, PictureHeight
Gui, Destroy
ft := 1
gosub, showch
return
Re: COMBINAR 2 SCRIPTS EN UNO SOLO
• Cuando apretas F2 te da error, porque tenes que poner el script con el archivo .ini (en el mismo directorio).Algo me da error pero como que ya casi casi , algo falla cuando presiono f2
Ejemplo:
----- ..\Script.ahk
----- ..\Crosshair.ini
----- ..\IMG
----- ..\IMG\*
Ejemplo del contenido de larchivo .ini (Crosshair.ini)
Code: Select all
[Crochair tol]
chxt=44
chyt=-2
[Crochair Picture]
PictureNum=4
Picturecolor=Red
Picturecolorval=3
PictureFile=CH43
PictureWidth=19
PictureHeight=19
• Si eso no lo soluciona, deja una imagen con el error.
• no entiendo, ¿que códigos en color rojo?, ¿imagen?Extrayendo solamente los codigos del croshair en color rojo y de cruz + [...]
• ¿que "ventanita"?, si puedes poner imágenes seria mejor.tiene muchas cosas incluido el menu que parpadea aun desactivandolo , queda una ventanita parpadeante [...]
• ¿a que te refieres con "Menu desplegable"?.la ventana del menu desplegable genera una corrupcion en la ventana del juego
• ¿con "ventana" te refieres a "la ventanita" de lo que puse arriba o la ventana del punto de mira?.
-----------
Si quieres pon imágenes y lo vemos bien
También puedes probar si te funciona este:
Nota: F3 hace la misma funcion que HOME
Ejemplo: pon el script con la carpeta de imagenes y Crosshair.ini, preciona F2, luego AV PÁG (para ocultar el ToolTip), luego con la ventana activa del juego, preciona F3.
Code: Select all
#NoEnv
#SingleInstance, Force
SetBatchLines, -1
SetWorkingDir, %A_ScriptDir% ; Ensures a consistent starting directory.
CoordMode, ToolTip, Screen
Hotkey, ~LButton, Auto_Fire, Off
Hotkey, PGDN, _PGDN, Off
Hotkey, HOME, _HOME, Off
Hotkey, ^Up, _Up, Off
Hotkey, ^Down, _Down, Off
Hotkey, ^Right, _Right, Off
Hotkey, ^Left, _Left, Off
Hotkey, NumpadDiv, _NumpadDiv, Off
Hotkey, NumpadMult, _NumpadMult, Off
Hotkey, NumpadSub, _NumpadSub, Off
Hotkey, NumpadAdd, _NumpadAdd, Off
return
;on/off
F1::
Hotkey, ~LButton, Toggle
return
F2::
_f2 := !_f2
ToolTip
Gui, Destroy
if (_f2) {
gosub, Load_Settings
} else {
SetTimer, Menu, Off
} Hotkey, PGDN, Toggle
Hotkey, HOME, Toggle
Hotkey, ^Up, Toggle
Hotkey, ^Down, Toggle
Hotkey, ^Right, Toggle
Hotkey, ^Left, Toggle
Hotkey, NumpadDiv, Toggle
Hotkey, NumpadMult, Toggle
Hotkey, NumpadSub, Toggle
Hotkey, NumpadAdd, Toggle
return
;recargar
F12::Reload
;salir
F11::ExitApp
;no-recoil
Auto_Fire:
while (GetKeyState("LButton", "P")) {
SendInput, {LButton DownTemp}
Sleep, 22
DllCall("User32.dll\mouse_event", "UInt", 1, "UInt", 0, "UInt", 1, "UInt", 0, "UPtr", 0)
SendInput {LButton Up}
Sleep 22
}
return
Load_Settings:
ScriptName := "Crosshair" ;SplitPath, A_ScriptName,,,, ScriptName
vm := ft := 1, chv := 0
IniRead, chxt, %ScriptName%.ini, Crochair tol,chxt
IniRead, chyt, %ScriptName%.ini, Crochair tol,chyt
IniRead, chp, %ScriptName%.ini, Crochair Picture, PictureNum
IniRead, chcl, %ScriptName%.ini, Crochair Picture, Picturecolor
IniRead, chc, %ScriptName%.ini, Crochair Picture, Picturecolorval
IniRead, chimg, %ScriptName%.ini, Crochair Picture, PictureFile
IniRead, chimgw, %ScriptName%.ini, Crochair Picture, PictureWidth
IniRead, chimgh, %ScriptName%.ini, Crochair Picture, PictureHeight
SetTimer, menu, 200
goto, menu
return
;cross-hair
_PGDN:
vm := !vm
SetTimer, Menu, % vm?200:"Off"
if !(vm)
ToolTip,,,, 1
else gosub, Menu
return
Menu:
ToolTip, % "Crosshair Type:" A_Tab chp
. "`nCrosshair Color:" A_Tab chcl
. "`nCrosshair Size:" A_Tab chimgw
. "`n---------------------------------------------"
. "`nPageDown:" A_Tab "Show/Hide Menu"
. "`nHome:" A_Tab A_Tab "Show/Hide Crosshair"
. "`n/:" A_Tab A_Tab "Change Crosshair type"
. "`n*:" A_Tab A_Tab "Change Crosshair color"
. "`n+:" A_Tab A_Tab "Increase Crosshair Size"
. "`n-:" A_Tab A_Tab "Decrease Crosshair Size"
. "`nCtrl+Arows:" A_Tab "Move Crosshair Position", 0, 0
return
F3::
_HOME:
if (chv) {
Gui, Hide
SetTimer, tick, Off
chv := 0
} else {
gosub, % ft?"showch":"drawch"
chv := 1
SetTimer, tick, 200
}
return
showch:
if !(ft)
return
Gui, Destroy
wint := WinExist("A")
WinGetPos, winx, winy, winw, winh, ahk_id %wint%
gosub, posch
Gui, -Caption +LastFound +ToolWindow +Owner%wint%
WinSet, TransColor, White
Gui, Color, FFFFFF
Gui, Add, Picture, w%chimgw% h%chimgh%, %A_ScriptDir%\IMG\%chimg%
Gui, Show, NA x%chx% y%chy%
ft := 0
return
posch:
chx := winx + (winw / 2) + chxt - chimgw
chy := winy + (winh / 2) + chyt - chimgh
return
drawch:
gosub, posch
ft := 1
gosub, showch
;Gui, Show, NA x%chx% y%chy%
return
tick:
if (WinActive("ahk_id " wint)) {
WinGetPos, winx1, winy1, winw1, winh1, ahk_id %wint%
if !(winx1=winx) || !(winy1=winy) || !(winw1=winw) || !(winh1=winh) {
WinGetPos, winx, winy, winw, winh, ahk_id %wint%
if (chv)
gosub, drawch
}
} else Gui, Hide
return
_Up:
chyt--
gosub, drawch
IniWrite, %chyt%, %ScriptName%.ini, Crochair tol, chyt
return
_Down:
chyt++
gosub, drawch
IniWrite, %chyt%, %ScriptName%.ini, Crochair tol, chyt
return
_Left:
chxt--
gosub, drawch
IniWrite, %chxt%, %ScriptName%.ini, Crochair tol, chxt
return
_Right:
chxt++
gosub, drawch
IniWrite, %chxt%, %ScriptName%.ini, Crochair tol, chxt
return
_NumpadDiv:
if !(chv)
return
if chp between 1 and 5
chp++
else chp := 1
chimg := "CH" chp chc
IniWrite, %chimg%, %ScriptName%.ini , Crochair Picture, PictureFile
IniWrite, %chp%, %ScriptName%.ini , Crochair Picture, PictureNum
Gui, Destroy
ft := 1
gosub, showch
return
_NumpadMult:
if !(chv)
return
chc := chc=1?2:chc=2?3:chc=3?4:chc=4?1:chc
chcl := chc=1?"Green":chc=2?"Red":chc=3?"Yellow":chc=4?"Blue":chcl
chimg := "CH" chp chc
IniWrite, %chimg%, %ScriptName%.ini , Crochair Picture, PictureFile
IniWrite, %chcl%, %ScriptName%.ini , Crochair Picture, Picturecolor
IniWrite, %chc%, %ScriptName%.ini , Crochair Picture, Picturecolorval
Gui, Destroy
ft := 1
gosub, showch
return
_NumpadSub:
if !(chv)
return
chimgw--
chimgw := chimgw<5?5:chimgw
chimgh--
chimgh := chimgh<5?5:chimgh
IniWrite, %chimgw%, %ScriptName%.ini , Crochair Picture, PictureWidth
IniWrite, %chimgh%, %ScriptName%.ini , Crochair Picture, PictureHeight
Gui, Destroy
ft := 1
gosub, showch
return
_NumpadAdd:
if !(chv)
return
chimgw++
chimgw := chimgw>200?20:chimgw
chimgh++
chimgh := chimgh>200?200:chimgh
IniWrite, %chimgw%, %ScriptName%.ini , Crochair Picture, PictureWidth
IniWrite, %chimgh%, %ScriptName%.ini , Crochair Picture, PictureHeight
Gui, Destroy
ft := 1
gosub, showch
return
Re: COMBINAR 2 SCRIPTS EN UNO SOLO
Eso lo puedes modificar a gusto: ver documentación (hotkeys)
Quedaría: F1 y F2 que antes activaban el script, ahora no hacen nada, activar/desactivar con |. F3 quitado, usar HOME.
Quedaría: F1 y F2 que antes activaban el script, ahora no hacen nada, activar/desactivar con |. F3 quitado, usar HOME.
Code: Select all
#NoEnv
#SingleInstance, Force
SetBatchLines, -1
SetWorkingDir, %A_ScriptDir% ; Ensures a consistent starting directory.
CoordMode, ToolTip, Screen
Hotkey, ~LButton, Auto_Fire, Off
Hotkey, PGDN, _PGDN, Off
Hotkey, HOME, _HOME, Off
Hotkey, ^Up, _Up, Off
Hotkey, ^Down, _Down, Off
Hotkey, ^Right, _Right, Off
Hotkey, ^Left, _Left, Off
Hotkey, NumpadDiv, _NumpadDiv, Off
Hotkey, NumpadMult, _NumpadMult, Off
Hotkey, NumpadSub, _NumpadSub, Off
Hotkey, NumpadAdd, _NumpadAdd, Off
return
;on/off
|::
Hotkey, ~LButton, Toggle
_f2 := !_f2
ToolTip
Gui, Destroy
if (_f2) {
gosub, Load_Settings
} else {
SetTimer, Menu, Off
} Hotkey, PGDN, Toggle
Hotkey, HOME, Toggle
Hotkey, ^Up, Toggle
Hotkey, ^Down, Toggle
Hotkey, ^Right, Toggle
Hotkey, ^Left, Toggle
Hotkey, NumpadDiv, Toggle
Hotkey, NumpadMult, Toggle
Hotkey, NumpadSub, Toggle
Hotkey, NumpadAdd, Toggle
return
;recargar
F12::Reload
;salir
F11::ExitApp
;no-recoil
Auto_Fire:
while (GetKeyState("LButton", "P")) {
SendInput, {LButton DownTemp}
Sleep, 22
DllCall("User32.dll\mouse_event", "UInt", 1, "UInt", 0, "UInt", 1, "UInt", 0, "UPtr", 0)
SendInput {LButton Up}
Sleep 22
}
return
Load_Settings:
ScriptName := "Crosshair" ;SplitPath, A_ScriptName,,,, ScriptName
vm := ft := 1, chv := 0
IniRead, chxt, %ScriptName%.ini, Crochair tol,chxt
IniRead, chyt, %ScriptName%.ini, Crochair tol,chyt
IniRead, chp, %ScriptName%.ini, Crochair Picture, PictureNum
IniRead, chcl, %ScriptName%.ini, Crochair Picture, Picturecolor
IniRead, chc, %ScriptName%.ini, Crochair Picture, Picturecolorval
IniRead, chimg, %ScriptName%.ini, Crochair Picture, PictureFile
IniRead, chimgw, %ScriptName%.ini, Crochair Picture, PictureWidth
IniRead, chimgh, %ScriptName%.ini, Crochair Picture, PictureHeight
SetTimer, menu, 200
goto, menu
return
;cross-hair
_PGDN:
vm := !vm
SetTimer, Menu, % vm?200:"Off"
if !(vm)
ToolTip,,,, 1
else gosub, Menu
return
Menu:
ToolTip, % "Crosshair Type:" A_Tab chp
. "`nCrosshair Color:" A_Tab chcl
. "`nCrosshair Size:" A_Tab chimgw
. "`n---------------------------------------------"
. "`nPageDown:" A_Tab "Show/Hide Menu"
. "`nHome:" A_Tab A_Tab "Show/Hide Crosshair"
. "`n/:" A_Tab A_Tab "Change Crosshair type"
. "`n*:" A_Tab A_Tab "Change Crosshair color"
. "`n+:" A_Tab A_Tab "Increase Crosshair Size"
. "`n-:" A_Tab A_Tab "Decrease Crosshair Size"
. "`nCtrl+Arows:" A_Tab "Move Crosshair Position", 0, 0
return
_HOME:
if (chv) {
Gui, Hide
SetTimer, tick, Off
chv := 0
} else {
gosub, % ft?"showch":"drawch"
chv := 1
SetTimer, tick, 200
}
return
showch:
if !(ft)
return
Gui, Destroy
wint := WinExist("A")
WinGetPos, winx, winy, winw, winh, ahk_id %wint%
gosub, posch
Gui, -Caption +LastFound +ToolWindow +Owner%wint%
WinSet, TransColor, White
Gui, Color, FFFFFF
Gui, Add, Picture, w%chimgw% h%chimgh%, %A_ScriptDir%\IMG\%chimg%
Gui, Show, NA x%chx% y%chy%
ft := 0
return
posch:
chx := winx + (winw / 2) + chxt - chimgw
chy := winy + (winh / 2) + chyt - chimgh
return
drawch:
gosub, posch
ft := 1
gosub, showch
;Gui, Show, NA x%chx% y%chy%
return
tick:
if (WinActive("ahk_id " wint)) {
WinGetPos, winx1, winy1, winw1, winh1, ahk_id %wint%
if !(winx1=winx) || !(winy1=winy) || !(winw1=winw) || !(winh1=winh) {
WinGetPos, winx, winy, winw, winh, ahk_id %wint%
if (chv)
gosub, drawch
}
} else Gui, Hide
return
_Up:
chyt--
gosub, drawch
IniWrite, %chyt%, %ScriptName%.ini, Crochair tol, chyt
return
_Down:
chyt++
gosub, drawch
IniWrite, %chyt%, %ScriptName%.ini, Crochair tol, chyt
return
_Left:
chxt--
gosub, drawch
IniWrite, %chxt%, %ScriptName%.ini, Crochair tol, chxt
return
_Right:
chxt++
gosub, drawch
IniWrite, %chxt%, %ScriptName%.ini, Crochair tol, chxt
return
_NumpadDiv:
if !(chv)
return
if chp between 1 and 5
chp++
else chp := 1
chimg := "CH" chp chc
IniWrite, %chimg%, %ScriptName%.ini , Crochair Picture, PictureFile
IniWrite, %chp%, %ScriptName%.ini , Crochair Picture, PictureNum
Gui, Destroy
ft := 1
gosub, showch
return
_NumpadMult:
if !(chv)
return
chc := chc=1?2:chc=2?3:chc=3?4:chc=4?1:chc
chcl := chc=1?"Green":chc=2?"Red":chc=3?"Yellow":chc=4?"Blue":chcl
chimg := "CH" chp chc
IniWrite, %chimg%, %ScriptName%.ini , Crochair Picture, PictureFile
IniWrite, %chcl%, %ScriptName%.ini , Crochair Picture, Picturecolor
IniWrite, %chc%, %ScriptName%.ini , Crochair Picture, Picturecolorval
Gui, Destroy
ft := 1
gosub, showch
return
_NumpadSub:
if !(chv)
return
chimgw--
chimgw := chimgw<5?5:chimgw
chimgh--
chimgh := chimgh<5?5:chimgh
IniWrite, %chimgw%, %ScriptName%.ini , Crochair Picture, PictureWidth
IniWrite, %chimgh%, %ScriptName%.ini , Crochair Picture, PictureHeight
Gui, Destroy
ft := 1
gosub, showch
return
_NumpadAdd:
if !(chv)
return
chimgw++
chimgw := chimgw>200?20:chimgw
chimgh++
chimgh := chimgh>200?200:chimgh
IniWrite, %chimgw%, %ScriptName%.ini , Crochair Picture, PictureWidth
IniWrite, %chimgh%, %ScriptName%.ini , Crochair Picture, PictureHeight
Gui, Destroy
ft := 1
gosub, showch
return
Re: COMBINAR 2 SCRIPTS EN UNO SOLO
Hola de nuevo, y que bueno que te haya servido.
Nota: adicional, la tecla END suspende/restaura todas las combinaciones de teclas.
no hay problema.No se mucho de esto , ni deseo incomodar tu valioso tiempo
Si.¿es posible unir el macro no recoil (para rifle) con mi macro rapidscope (para sniper)?
Hecho. Aquí está todo combinado y con las teclas deseadas, sin probar.No puedo usar ninguna tecla de F1 al F12 , ni Insert , ni [...] activacion y desactivacion del macro no recoil [...] flecha direccional izquierda. activacion y desactivacion del macro sniper [...] flecha direccional derecha. salir [...] F4
Nota: adicional, la tecla END suspende/restaura todas las combinaciones de teclas.
Code: Select all
#NoEnv
#SingleInstance, Force
SetBatchLines, -1
SetWorkingDir, %A_ScriptDir% ; Ensures a consistent starting directory.
CoordMode, ToolTip, Screen
Hotkey, ~LButton, Auto_Fire, Off
Hotkey, PGDN, _PGDN, Off
Hotkey, HOME, _HOME, Off
Hotkey, ^Up, _Up, Off
Hotkey, ^Down, _Down, Off
Hotkey, ^Right, _Right, Off
Hotkey, ^Left, _Left, Off
Hotkey, NumpadDiv, _NumpadDiv, Off
Hotkey, NumpadMult, _NumpadMult, Off
Hotkey, NumpadSub, _NumpadSub, Off
Hotkey, NumpadAdd, _NumpadAdd, Off
Hotkey, ~*LButton, rapid_scope, Off
return
;on/off
|::
Hotkey, ~LButton, Toggle
_f2 := !_f2
ToolTip
Gui, Destroy
if (_f2) {
gosub, Load_Settings
} else {
SetTimer, Menu, Off
} Hotkey, PGDN, Toggle
Hotkey, HOME, Toggle
Hotkey, ^Up, Toggle
Hotkey, ^Down, Toggle
Hotkey, ^Right, Toggle
Hotkey, ^Left, Toggle
Hotkey, NumpadDiv, Toggle
Hotkey, NumpadMult, Toggle
Hotkey, NumpadSub, Toggle
Hotkey, NumpadAdd, Toggle
return
;activar/desactivar no-recoil
Left::Hotkey, ~LButton, Toggle
;activar/desactivar
Right::Hotkey, ~*LButton, Toggle
End::Suspend, Toggle
rapid_scope:
SendInput, {LButton down}
SendInput, {LButton up}
SendInput, {q down}
SendInput, {q up}
SendInput, {q down}
SendInput, {q up}
return
;recargar
;F12::Reload
;salir
F4::ExitApp
;no-recoil
Auto_Fire:
while (GetKeyState("LButton", "P")) {
SendInput, {LButton DownTemp}
Sleep, 22
DllCall("User32.dll\mouse_event", "UInt", 1, "UInt", 0, "UInt", 1, "UInt", 0, "UPtr", 0)
SendInput {LButton Up}
Sleep 22
}
return
Load_Settings:
ScriptName := "Crosshair" ;SplitPath, A_ScriptName,,,, ScriptName
vm := ft := 1, chv := 0
IniRead, chxt, %ScriptName%.ini, Crochair tol,chxt
IniRead, chyt, %ScriptName%.ini, Crochair tol,chyt
IniRead, chp, %ScriptName%.ini, Crochair Picture, PictureNum
IniRead, chcl, %ScriptName%.ini, Crochair Picture, Picturecolor
IniRead, chc, %ScriptName%.ini, Crochair Picture, Picturecolorval
IniRead, chimg, %ScriptName%.ini, Crochair Picture, PictureFile
IniRead, chimgw, %ScriptName%.ini, Crochair Picture, PictureWidth
IniRead, chimgh, %ScriptName%.ini, Crochair Picture, PictureHeight
SetTimer, menu, 200
goto, menu
return
;cross-hair
_PGDN:
vm := !vm
SetTimer, Menu, % vm?200:"Off"
if !(vm)
ToolTip,,,, 1
else gosub, Menu
return
Menu:
ToolTip, % "Crosshair Type:" A_Tab chp
. "`nCrosshair Color:" A_Tab chcl
. "`nCrosshair Size:" A_Tab chimgw
. "`n---------------------------------------------"
. "`nPageDown:" A_Tab "Show/Hide Menu"
. "`nHome:" A_Tab A_Tab "Show/Hide Crosshair"
. "`n/:" A_Tab A_Tab "Change Crosshair type"
. "`n*:" A_Tab A_Tab "Change Crosshair color"
. "`n+:" A_Tab A_Tab "Increase Crosshair Size"
. "`n-:" A_Tab A_Tab "Decrease Crosshair Size"
. "`nCtrl+Arows:" A_Tab "Move Crosshair Position", 0, 0
return
_HOME:
if (chv) {
Gui, Hide
SetTimer, tick, Off
chv := 0
} else {
gosub, % ft?"showch":"drawch"
chv := 1
SetTimer, tick, 200
}
return
showch:
if !(ft)
return
Gui, Destroy
wint := WinExist("A")
WinGetPos, winx, winy, winw, winh, ahk_id %wint%
gosub, posch
Gui, -Caption +LastFound +ToolWindow +Owner%wint%
WinSet, TransColor, White
Gui, Color, FFFFFF
Gui, Add, Picture, w%chimgw% h%chimgh%, %A_ScriptDir%\IMG\%chimg%
Gui, Show, NA x%chx% y%chy%
ft := 0
return
posch:
chx := winx + (winw / 2) + chxt - chimgw
chy := winy + (winh / 2) + chyt - chimgh
return
drawch:
gosub, posch
ft := 1
gosub, showch
;Gui, Show, NA x%chx% y%chy%
return
tick:
if (WinActive("ahk_id " wint)) {
WinGetPos, winx1, winy1, winw1, winh1, ahk_id %wint%
if !(winx1=winx) || !(winy1=winy) || !(winw1=winw) || !(winh1=winh) {
WinGetPos, winx, winy, winw, winh, ahk_id %wint%
if (chv)
gosub, drawch
}
} else Gui, Hide
return
_Up:
chyt--
gosub, drawch
IniWrite, %chyt%, %ScriptName%.ini, Crochair tol, chyt
return
_Down:
chyt++
gosub, drawch
IniWrite, %chyt%, %ScriptName%.ini, Crochair tol, chyt
return
_Left:
chxt--
gosub, drawch
IniWrite, %chxt%, %ScriptName%.ini, Crochair tol, chxt
return
_Right:
chxt++
gosub, drawch
IniWrite, %chxt%, %ScriptName%.ini, Crochair tol, chxt
return
_NumpadDiv:
if !(chv)
return
if chp between 1 and 5
chp++
else chp := 1
chimg := "CH" chp chc
IniWrite, %chimg%, %ScriptName%.ini , Crochair Picture, PictureFile
IniWrite, %chp%, %ScriptName%.ini , Crochair Picture, PictureNum
Gui, Destroy
ft := 1
gosub, showch
return
_NumpadMult:
if !(chv)
return
chc := chc=1?2:chc=2?3:chc=3?4:chc=4?1:chc
chcl := chc=1?"Green":chc=2?"Red":chc=3?"Yellow":chc=4?"Blue":chcl
chimg := "CH" chp chc
IniWrite, %chimg%, %ScriptName%.ini , Crochair Picture, PictureFile
IniWrite, %chcl%, %ScriptName%.ini , Crochair Picture, Picturecolor
IniWrite, %chc%, %ScriptName%.ini , Crochair Picture, Picturecolorval
Gui, Destroy
ft := 1
gosub, showch
return
_NumpadSub:
if !(chv)
return
chimgw--
chimgw := chimgw<5?5:chimgw
chimgh--
chimgh := chimgh<5?5:chimgh
IniWrite, %chimgw%, %ScriptName%.ini , Crochair Picture, PictureWidth
IniWrite, %chimgh%, %ScriptName%.ini , Crochair Picture, PictureHeight
Gui, Destroy
ft := 1
gosub, showch
return
_NumpadAdd:
if !(chv)
return
chimgw++
chimgw := chimgw>200?20:chimgw
chimgh++
chimgh := chimgh>200?200:chimgh
IniWrite, %chimgw%, %ScriptName%.ini , Crochair Picture, PictureWidth
IniWrite, %chimgh%, %ScriptName%.ini , Crochair Picture, PictureHeight
Gui, Destroy
ft := 1
gosub, showch
return
Re: COMBINAR 2 SCRIPTS EN UNO SOLO
¿quieres quitar el crosshair y dejar solo el rapidscope y el norecoil?
en el script anterior estaba todo junto pero no interfería uno con el otro, ya que usaban teclas distintas.
Pero aún así, si quieres solo estos dos últimos:
Flecha IZ: activar/desactivar norecoil
Flecha DE: activar/desactivar rapidscope
Home: activar/desactivar todo
F4: salir
Nota: estoy viendo que me vuelves a poner el código de vuelta, el código que me pusiste lo modifiqué un poco para hacerlo mas compacto y de fácil lectura, pero funciona exactamente igual, o debería, si no es así, lo arreglamos. La próxima que pongas un script te recomiendo que uses la etiqueta "Code" en "Select code --> AHK".
Ha, y lee la documentación, en especial Hotkeys y Hotkey
en el script anterior estaba todo junto pero no interfería uno con el otro, ya que usaban teclas distintas.
Pero aún así, si quieres solo estos dos últimos:
Flecha IZ: activar/desactivar norecoil
Flecha DE: activar/desactivar rapidscope
Home: activar/desactivar todo
F4: salir
Code: Select all
#NoEnv
#SingleInstance, Force
SetBatchLines, -1
Hotkey, ~LButton, no_recoil, Off
Hotkey, ~*LButton, rapid_scope, Off
return
Left::Hotkey, ~LButton, Toggle
Right::Hotkey, ~*LButton, Toggle
F4::ExitApp
HOME::Suspend, Toggle
rapid_scope:
SendInput, {LButton down}
SendInput, {LButton up}
SendInput, {q down}
SendInput, {q up}
SendInput, {q down}
SendInput, {q up}
return
no_recoil:
while (GetKeyState("LButton", "P")) {
SendInput, {LButton DownTemp}
Sleep, 22
DllCall("User32.dll\mouse_event", "UInt", 1, "UInt", 0, "UInt", 1, "UInt", 0, "UPtr", 0)
SendInput {LButton Up}
Sleep 22
}
return
Ha, y lee la documentación, en especial Hotkeys y Hotkey
muchas gracias
muchas gracias
Who is online
Users browsing this forum: No registered users and 20 guests