1. Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Need Help With Simple AutoHotKey Script

Discussion in 'General Software' started by CK011885, Feb 4, 2013.

  1. CK011885

    Jan 30, 2013
    70 (0.04/day)
    Thanks Received:
    Hi all, I'm trying to make a "simple" script but having some problems. I say "simple" because I've never done this before, but it's probably simple for someone more familiar. Basically, I want to make it where when I hold the right mouse button down, instead of right clicking it continuously Shift+Right Clicks (This is for a game).

    I came up with this:

    RButton::Send +{Click, Right}

    Which basically does what I want only I can't hold down the mouse button to continuously repeat the script. I'm not looking for anything automated, and would like to have it only do this while I hold the mouse button down, and stop when I let go.

    A friend of mine came up with this for me, which is almost perfect but for some reason in the game it causes the character to stutter step in between casts of the spell (Path of Exile). The character will cast the spell, stutter step forward, then cast again. The normal behavior in the game of holding Shift and casting a spell will keep you in place and not moving, which is what I'm looking for. He came up with this:

    #IfWinActive Path of Exile
    GetKeyState, RButtonState, RButton, P
    if (RButtonState = "U") {
    send +{RButton up}
    } else {
    send +{RButton down}
    sleep, 10

    Is anyone here familiar with creating scripts/macros that can possibly tweak this to make it behave like I'd like it to? He suggested removing the sleep line, which I tried and it didn't change the behavior.

    Edit: Issue resolved, the following worked great:

    #IfWinActive Path of Exile
    *rbutton::Send {shift Down}{rbutton down}
    *rbutton Up::Send {shift Up}{rbutton up}
    Last edited: Feb 5, 2013

Currently Active Users Viewing This Thread: 1 (0 members and 1 guest)