HI guys help me put this 2 scripts into a 1
1 script: this it's for ar weapon
End::Suspend
~RButton & ~LButton::
KeyWait LButton, T0.1
If (ErrorLevel = 1) {
While GetKeyState("LButton", "P") {
sleep, 110
Click
Setmousedelay 120
}
}
return
2 script:this script it's for ak weapon
#NoEnv
;#NoTrayIcon
#KeyHistory, 0
#SingleInstance, Force
SendMode, Input
Delete:: Suspend
Insert:: Reload
Y( a, y ) {
DllCall( "mouse_event", int, 1, int, x, int, y, uint, 0, uint, 0 )
}
X( b, x ) {
DllCall( "mouse_event", int, 1, int, x, int, y, uint, 0, uint, 0 )
}
~RButton & ~LButton::
Loop {
Sleep, 40
Y( moveAmount, 24.2 )
X( moveAmount, -4.2 )
If Not GetKeyState( "LButton" ) {
Break
}
}
Return
PUT THIS 2 TO 1 !! AR TO F1 AK TO F2!!
put 2 cripts into a 1. help! Topic is solved
-
- Posts: 9
- Joined: 05 Nov 2017, 13:18
put 2 cripts into a 1. help!
Last edited by kostakosGR on 05 Nov 2017, 14:06, edited 1 time in total.
Re: put 2 cripts into a 1. help! Topic is solved
These scripts look exactly the same or I must be blind.
-
- Posts: 9
- Joined: 05 Nov 2017, 13:18
Re: put 2 cripts into a 1. help!
oh yes i will chan5e one scriptHIAC wrote:These scripts look exactly the same or I must be blind.
-
- Posts: 9
- Joined: 05 Nov 2017, 13:18
Re: put 2 cripts into a 1. help!
kostakosGR wrote:HI guys help me put this 2 scripts into a 1
1 script: this it's for ar weapon
End::Suspend
~RButton & ~LButton::
KeyWait LButton, T0.1
If (ErrorLevel = 1) {
While GetKeyState("LButton", "P") {
sleep, 110
Click
Setmousedelay 120
}
}
return
2 script:this script it's for ak weapon
#NoEnv
;#NoTrayIcon
#KeyHistory, 0
#SingleInstance, Force
SendMode, Input
Delete:: Suspend
Insert:: Reload
Y( a, y ) {
DllCall( "mouse_event", int, 1, int, x, int, y, uint, 0, uint, 0 )
}
X( b, x ) {
DllCall( "mouse_event", int, 1, int, x, int, y, uint, 0, uint, 0 )
}
~RButton & ~LButton::
Loop {
Sleep, 40
Y( moveAmount, 24.2 )
X( moveAmount, -4.2 )
If Not GetKeyState( "LButton" ) {
Break
}
}
Return
PUT THIS 2 TO 1 !! AR TO F1 AK TO F2!!
-
- Posts: 9
- Joined: 05 Nov 2017, 13:18
Re: put 2 cripts into a 1. help!
i already chan5ed the postHIAC wrote:These scripts look exactly the same or I must be blind.
-
- Posts: 9
- Joined: 05 Nov 2017, 13:18
Re: put 2 cripts into a 1. help!
can you help me ??
-
- Posts: 9
- Joined: 05 Nov 2017, 13:18
Re: put 2 cripts into a 1. help!
guys help me post script code
Re: put 2 cripts into a 1. help!
You are going to need to define what you mean by combine.
You have two scripts that use the exact same hotkey. Do you want to preserve both functions? That would be something like this:
You have two scripts that use the exact same hotkey. Do you want to preserve both functions? That would be something like this:
Code: Select all
#NoEnv
;#NoTrayIcon
#KeyHistory, 0
#SingleInstance, Force
SendMode, Input
Delete:: Suspend
Insert:: Reload
End::Suspend
~RButton & ~LButton::
KeyWait, LButton, T0.1
SetMouseDelay, 120
If ErrorLevel = 1 {
While GetKeyState("LButton","P") {
Sleep, 40
Y( moveAmount, 24.2 )
X( moveAmount, -4.2 )
If Not GetKeyState( "LButton" ) {
Break
}
Click
}
}
Return
; there are a couple pairs of optional brackets in here, but, that's OK
Y( a, y ) {
DllCall( "mouse_event", int, 1, int, x, int, y, uint, 0, uint, 0 )
}
X( b, x ) {
DllCall( "mouse_event", int, 1, int, x, int, y, uint, 0, uint, 0 )
}
-
- Posts: 9
- Joined: 05 Nov 2017, 13:18
Re: put 2 cripts into a 1. help!
Exaskryz wrote:You are going to need to define what you mean by combine.
You have two scripts that use the exact same hotkey. Do you want to preserve both functions? That would be something like this:
Code: Select all
#NoEnv ;#NoTrayIcon #KeyHistory, 0 #SingleInstance, Force SendMode, Input Delete:: Suspend Insert:: Reload End::Suspend ~RButton & ~LButton:: KeyWait, LButton, T0.1 SetMouseDelay, 120 If ErrorLevel = 1 { While GetKeyState("LButton","P") { Sleep, 40 Y( moveAmount, 24.2 ) X( moveAmount, -4.2 ) If Not GetKeyState( "LButton" ) { Break } Click } } Return ; there are a couple pairs of optional brackets in here, but, that's OK Y( a, y ) { DllCall( "mouse_event", int, 1, int, x, int, y, uint, 0, uint, 0 ) } X( b, x ) { DllCall( "mouse_event", int, 1, int, x, int, y, uint, 0, uint, 0 ) }
Np i dont want to preserve both functions!
-
- Posts: 9
- Joined: 05 Nov 2017, 13:18
Re: put 2 cripts into a 1. help!
@Exaskryz no idont want to preserve both functions!
-
- Posts: 9
- Joined: 05 Nov 2017, 13:18
Re: put 2 cripts into a 1. help!
JUST I WANT THIS 2 SCRIPTS INTO A ONE WHEN I WILL PRESS F1 THE AR WEAPON SCRIPT WILL WORK QND F2 AK SCRIPT WILL WORK
Re: put 2 cripts into a 1. help!
Then you'll probably want some #If control.
I'll give an example, and you can put your script into action. Just copy and paste as you please.
Seriously, run my code so you understand what is going on. Then you can figure out what you want to do with your original scripts.
I'll give an example, and you can put your script into action. Just copy and paste as you please.
Code: Select all
#If ; these hotkeys always work:
F1::weapon:="ar"
F2::weapon:="ak"
#If (weapon="ar")
F3::MsgBox You have enabled AR
#If (weapon="ak")
F3::MsgBox You have enabled AK
Re: put 2 cripts into a 1. help!
just send the code for this script f1 to ar code and f2 for ak code! and when i will press f1 ak script will be on and when i press f2 ar script will be on and ak script off !!
Re: put 2 cripts into a 1. help!
i have error in the line 41 can you help me
#If ; these hotkeys always work:
F1::weapon:="ar"
F2::weapon:="ak"
#If (weapon="ar")
F3::MsgBox You have enabled AR
#If (weapon="ak")
F3::MsgBox You have enabled AK
AR:
~RButton & ~LButton::
KeyWait LButton, T0.1
If (ErrorLevel = 1) {
While GetKeyState("LButton", "P") {
sleep, 110
Click
Setmousedelay 120
}
}
return
AK:
#NoEnv
;#NoTrayIcon
#KeyHistory, 0
#SingleInstance, Force
SendMode, Input
Delete:: Suspend
Insert:: Reload
Y( a, y ) {
DllCall( "mouse_event", int, 1, int, x, int, y, uint, 0, uint, 0 )
}
X( b, x ) {
DllCall( "mouse_event", int, 1, int, x, int, y, uint, 0, uint, 0 )
}
~RButton & ~LButton::
Loop {
Sleep, 40
Y( moveAmount, 24.2 )
X( moveAmount, -4.2 )
If Not GetKeyState( "LButton" ) {
Break
}
}
Return
#If ; these hotkeys always work:
F1::weapon:="ar"
F2::weapon:="ak"
#If (weapon="ar")
F3::MsgBox You have enabled AR
#If (weapon="ak")
F3::MsgBox You have enabled AK
AR:
~RButton & ~LButton::
KeyWait LButton, T0.1
If (ErrorLevel = 1) {
While GetKeyState("LButton", "P") {
sleep, 110
Click
Setmousedelay 120
}
}
return
AK:
#NoEnv
;#NoTrayIcon
#KeyHistory, 0
#SingleInstance, Force
SendMode, Input
Delete:: Suspend
Insert:: Reload
Y( a, y ) {
DllCall( "mouse_event", int, 1, int, x, int, y, uint, 0, uint, 0 )
}
X( b, x ) {
DllCall( "mouse_event", int, 1, int, x, int, y, uint, 0, uint, 0 )
}
~RButton & ~LButton::
Loop {
Sleep, 40
Y( moveAmount, 24.2 )
X( moveAmount, -4.2 )
If Not GetKeyState( "LButton" ) {
Break
}
}
Return
Re: put 2 cripts into a 1. help!
LIKE THAT???
#If ; these hotkeys always work:
F1::weapon:="ar"
F2::weapon:="ak"
#If (weapon="ar")
F3::MsgBox You have enabled AR
#If (weapon="ak")
F3::MsgBox You have enabled AK
#If (weapon="ar")
~RButton & ~LButton::
KeyWait LButton, T0.1
If (ErrorLevel = 1) {
While GetKeyState("LButton", "P") {
sleep, 110
Click
Setmousedelay 120
}
}
return
#If (weapon="ak")
#NoEnv
;#NoTrayIcon
#KeyHistory, 0
#SingleInstance, Force
SendMode, Input
Delete:: Suspend
Insert:: Reload
Y( a, y ) {
DllCall( "mouse_event", int, 1, int, x, int, y, uint, 0, uint, 0 )
}
X( b, x ) {
DllCall( "mouse_event", int, 1, int, x, int, y, uint, 0, uint, 0 )
}
#If ; these hotkeys always work:
F1::weapon:="ar"
F2::weapon:="ak"
#If (weapon="ar")
F3::MsgBox You have enabled AR
#If (weapon="ak")
F3::MsgBox You have enabled AK
#If (weapon="ar")
~RButton & ~LButton::
KeyWait LButton, T0.1
If (ErrorLevel = 1) {
While GetKeyState("LButton", "P") {
sleep, 110
Click
Setmousedelay 120
}
}
return
#If (weapon="ak")
#NoEnv
;#NoTrayIcon
#KeyHistory, 0
#SingleInstance, Force
SendMode, Input
Delete:: Suspend
Insert:: Reload
Y( a, y ) {
DllCall( "mouse_event", int, 1, int, x, int, y, uint, 0, uint, 0 )
}
X( b, x ) {
DllCall( "mouse_event", int, 1, int, x, int, y, uint, 0, uint, 0 )
}
Re: put 2 cripts into a 1. help!
What you have is very close. For future reference, you can use [ code ] [ /code ](no spaces) tags to create:
Your most recent code looks right. The only problem is you haven't included your second ~RButton & ~LButton:: hotkey. You fixed the duplicate hotkey error on Line 41 problem by putting in the #If (weapon="ar") and #If (weapon="ak") lines correctly.
So just add
To the very bottom and it should work.
There are a few other small problems, but they should not affect your script at all. The only other thing missing is your End::Suspend hotkey which you had in AR script; this should go underneath #If (weapon="ar") if you want to keep it.
Code: Select all
Code blocks
So just add
Code: Select all
~RButton & ~LButton::
Loop {
Sleep, 40
Y( moveAmount, 24.2 )
X( moveAmount, -4.2 )
If Not GetKeyState( "LButton" ) {
Break
}
}
Return
There are a few other small problems, but they should not affect your script at all. The only other thing missing is your End::Suspend hotkey which you had in AR script; this should go underneath #If (weapon="ar") if you want to keep it.