| View previous topic :: View next topic |
| Author |
Message |
peturdowns
Joined: 13 Jan 2009 Posts: 14
|
Posted: Sun Jan 25, 2009 7:10 pm Post subject: Macro |
|
|
I've been using this script lately made by AnimeAim, basically what it does is when I hold C down it clicks it at 175 ms intervals.
All I need is to change the button, so instead of C it will be the mouse side button.. it's called mouse5
thanks!
| Code: | #SingleInstance Force
#NoEnv
c::
{
Loop
{
if !getKeyState("c", "p")
{
break
}
Send, {Click}
Sleep, 175
}
} |
[Title edited. Please write descriptive titles for your topics. ~jaco0646]
Last edited by peturdowns on Sun Jan 25, 2009 9:11 pm; edited 1 time in total |
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 5043 Location: the tunnel(?=light)
|
|
| Back to top |
|
 |
peturdowns
Joined: 13 Jan 2009 Posts: 14
|
Posted: Sun Jan 25, 2009 8:12 pm Post subject: |
|
|
You're right it's xbutton2
but for some reason it doesn't work when I add it to the script like this
| Code: |
#SingleInstance Force
#NoEnv
XButton2::
{
Loop
{
if !getKeyState("XButton2", "p")
{
break
}
Send, {Click}
Sleep, 175
}
} |
|
|
| Back to top |
|
 |
peturdowns
Joined: 13 Jan 2009 Posts: 14
|
Posted: Sun Jan 25, 2009 9:13 pm Post subject: |
|
|
Could someone quickly help please <3
I'm kinda in a hurry to get this ;p |
|
| Back to top |
|
 |
animeaime
Joined: 04 Nov 2008 Posts: 1045
|
Posted: Sun Jan 25, 2009 9:58 pm Post subject: |
|
|
It works fine for me. I hold XButton2 (which is on the right side of my mouse) and it clicks at 175ms intervals. This was on Vista SP1 32-bit.
Are you running Windows 2000 or later?
| KeyList docs wrote: | Supported only in Windows 2000/XP or later:
XButton1 - a button that appears only on certain mice
XButton2 - a button that appears only on certain mice |
_________________ As always, if you have any further questions, don't hesitate to ask.
Add OOP to your scripts via the Class Library. Check out my scripts. |
|
| Back to top |
|
 |
peturdowns
Joined: 13 Jan 2009 Posts: 14
|
Posted: Sun Jan 25, 2009 10:11 pm Post subject: |
|
|
| animeaime wrote: | It works fine for me. I hold XButton2 (which is on the right side of my mouse) and it clicks at 175ms intervals. This was on Vista SP1 32-bit.
Are you running Windows 2000 or later?
| KeyList docs wrote: | Supported only in Windows 2000/XP or later:
XButton1 - a button that appears only on certain mice
XButton2 - a button that appears only on certain mice |
|
I'm running windows xp  |
|
| Back to top |
|
 |
animeaime
Joined: 04 Nov 2008 Posts: 1045
|
Posted: Sun Jan 25, 2009 10:13 pm Post subject: |
|
|
Oh. Does this work?
| Code: | | ~XButton2::MsgBox, It works! |
If not, it might be the same problem I had with my mouse. If the mouse has "special" "abilities" for the different keys (e.g. press XButton1 and it does something), then it might be that AHK never sees the key - check the key history to see if XButton made it to the list after you pressed it. _________________ As always, if you have any further questions, don't hesitate to ask.
Add OOP to your scripts via the Class Library. Check out my scripts. |
|
| Back to top |
|
 |
peturdowns
Joined: 13 Jan 2009 Posts: 14
|
Posted: Sun Jan 25, 2009 10:20 pm Post subject: |
|
|
| animeaime wrote: | Oh. Does this work?
| Code: | | ~XButton2::MsgBox, It works! |
If not, it might be the same problem I had with my mouse. If the mouse has "special" "abilities" for the different keys (e.g. press XButton1 and it does something), then it might be that AHK never sees the key - check the key history to see if XButton made it to the list after you pressed it. |
Where do I add this to the code?
edit: ok I added this and I get a message box that says "it works!"
Last edited by peturdowns on Sun Jan 25, 2009 10:23 pm; edited 1 time in total |
|
| Back to top |
|
 |
Pil
Joined: 26 Feb 2006 Posts: 55 Location: Recife Brazil
|
Posted: Sun Jan 25, 2009 10:23 pm Post subject: |
|
|
Try this code with IO.dll to see keyboard`s scancodes
| Code: | Loop
{
outVar := 0xFF & DllCall("io\PortIn", char, 96)
Tooltip %outVar%
Sleep 100
} |
Download IO.dll at http://www.autohotkey.net/~pil/io.dll
Regards
Noel |
|
| Back to top |
|
 |
animeaime
Joined: 04 Nov 2008 Posts: 1045
|
Posted: Sun Jan 25, 2009 10:25 pm Post subject: |
|
|
Ok. Does this work?
| Code: | | ~XButton2::MsgBox, % getKeyState("XButton2", "P") |
When you activate the hotkey you should see a message box that contains a 1. _________________ As always, if you have any further questions, don't hesitate to ask.
Add OOP to your scripts via the Class Library. Check out my scripts. |
|
| Back to top |
|
 |
peturdowns
Joined: 13 Jan 2009 Posts: 14
|
Posted: Sun Jan 25, 2009 10:28 pm Post subject: |
|
|
| animeaime wrote: | Ok. Does this work?
| Code: | | ~XButton2::MsgBox, % getKeyState("XButton2", "P") |
When you activate the hotkey you should see a message box that contains a 1. |
It says 0,
and yeah I have a razer deathadder mouse and you can configure different abilities for the buttons  |
|
| Back to top |
|
 |
animeaime
Joined: 04 Nov 2008 Posts: 1045
|
Posted: Sun Jan 25, 2009 10:45 pm Post subject: |
|
|
if the message box is zero, then that's because AHK cannot detect that you have pressed the mouse.
Have you checked the key history, does XBUtton2 show up after pressed? Use LButton and RButton as a test to see which show up and which don't.
Now, if it doesn't show up, you will have to disable the mouse features (that's what I did to fix the problem). For me, it was uninstalling the software that came with it - mine works fine without it. Or, if possible, disable the "special features" when using the script. _________________ As always, if you have any further questions, don't hesitate to ask.
Add OOP to your scripts via the Class Library. Check out my scripts. |
|
| Back to top |
|
 |
peturdowns
Joined: 13 Jan 2009 Posts: 14
|
Posted: Sun Jan 25, 2009 11:04 pm Post subject: |
|
|
| animeaime wrote: | if the message box is zero, then that's because AHK cannot detect that you have pressed the mouse.
Have you checked the key history, does XBUtton2 show up after pressed? Use LButton and RButton as a test to see which show up and which don't.
Now, if it doesn't show up, you will have to disable the mouse features (that's what I did to fix the problem). For me, it was uninstalling the software that came with it - mine works fine without it. Or, if possible, disable the "special features" when using the script. |
It does show up and I would really hate uninstalling the drivers I have, they allow me to tweak the mouse settings etc
is there no way around it? : s
06 000 h d 1.38 XButton2 Call of Duty 4
06 000 a u 0.09 XButton2
06 000 h d 0.09 XButton2
06 000 a u 0.11 XButton2
01 000 d 0.30 LButton
01 000 u 0.08 LButton
01 000 d 0.09 LButton
01 000 u 0.09 LButton
06 000 h d 0.33 XButton2
06 000 a u 0.09 XButton2
06 000 h d 0.09 XButton2
06 000 a u 0.09 XButton2
here it is in case you might spot something ;p
 |
|
| Back to top |
|
 |
animeaime
Joined: 04 Nov 2008 Posts: 1045
|
Posted: Sun Jan 25, 2009 11:25 pm Post subject: |
|
|
there might be...since it is seeing them.
Try this:
| Code: | ~XButton2::
{
;don't specify physical mode (can also try this in second code as well)
if getKeyState("XButton2")
MsgBox, It works!
return
} |
Now, if that doesn't work...this might.
| Code: | #SingleInstance Force
#NoEnv
$XButton2::
{
Click, down X2
Loop
{
if !getKeyState("XButton2", "p")
{
break
}
Send, {Click}
Sleep, 175
}
return
}
$XButton2 up::
{
Click, up X2
return
} |
Also, try disabling the feature for XButton2 (leave the rest alone). Try Button Off - that worked for me on my mouse. _________________ As always, if you have any further questions, don't hesitate to ask.
Add OOP to your scripts via the Class Library. Check out my scripts. |
|
| Back to top |
|
 |
peturdowns
Joined: 13 Jan 2009 Posts: 14
|
Posted: Sun Jan 25, 2009 11:36 pm Post subject: |
|
|
How do I add the first one in to the script? (the msgbox popped up though)
The second script sadly didn't work though.
I tried turning the button off, but it seems that just takes the electricity away from the button or something, didn't work either ;(
Anywho lots of <3 for helping me once again
It's weird though, because the button works fine ingame. It's bound to shooting and it shoots just fine, but just doesn't do it at 175 ms intervals like the script tells it to |
|
| Back to top |
|
 |
|