AutoHotkey Community

It is currently May 26th, 2012, 2:36 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Macro
PostPosted: January 25th, 2009, 8:10 pm 
Offline

Joined: January 13th, 2009, 10:25 pm
Posts: 14
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 January 25th, 2009, 10:11 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 25th, 2009, 8:40 pm 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5478
Location: the tunnel(?=light)
Based on this information it's probably designated as XButton1 or XButton2, have you tried either of those?

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 25th, 2009, 9:12 pm 
Offline

Joined: January 13th, 2009, 10:25 pm
Posts: 14
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
   }
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 25th, 2009, 10:13 pm 
Offline

Joined: January 13th, 2009, 10:25 pm
Posts: 14
Could someone quickly help please <3

I'm kinda in a hurry to get this ;p


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 25th, 2009, 10:58 pm 
Offline

Joined: November 4th, 2008, 9:23 am
Posts: 1045
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?

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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 25th, 2009, 11:11 pm 
Offline

Joined: January 13th, 2009, 10:25 pm
Posts: 14
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?

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 :o


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 25th, 2009, 11:13 pm 
Offline

Joined: November 4th, 2008, 9:23 am
Posts: 1045
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 25th, 2009, 11:20 pm 
Offline

Joined: January 13th, 2009, 10:25 pm
Posts: 14
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 January 25th, 2009, 11:23 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 25th, 2009, 11:23 pm 
Offline

Joined: February 26th, 2006, 9:45 am
Posts: 55
Location: Recife Brazil
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 25th, 2009, 11:25 pm 
Offline

Joined: November 4th, 2008, 9:23 am
Posts: 1045
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 25th, 2009, 11:28 pm 
Offline

Joined: January 13th, 2009, 10:25 pm
Posts: 14
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 :o


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 25th, 2009, 11:45 pm 
Offline

Joined: November 4th, 2008, 9:23 am
Posts: 1045
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2009, 12:04 am 
Offline

Joined: January 13th, 2009, 10:25 pm
Posts: 14
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


Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2009, 12:25 am 
Offline

Joined: November 4th, 2008, 9:23 am
Posts: 1045
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2009, 12:36 am 
Offline

Joined: January 13th, 2009, 10:25 pm
Posts: 14
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


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], G. Sperotto, poserpro, Yahoo [Bot] and 22 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group