AutoHotkey Community

It is currently May 26th, 2012, 10:06 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 14 posts ] 
Author Message
PostPosted: September 7th, 2008, 6:03 am 
Offline

Joined: September 7th, 2008, 5:53 am
Posts: 5
Hi, I'm new to AHK, and I've always been bad at scripting, but I am trying to assign ALT + `(the tilde button) to the middle mouse button for use in a game. I've tried everything I can think of and nothing is succesful.

I have tried the SC code for the ` button, different ways of applying ALT to it, and I've troubleshot different maps using the ` button, and alt-combinations, all of which work fine within the game.

The simplest method I've tried:
MButton::!`

The most complicated method:
MButton::Send {LAlt Down}{sc029}{LAlt Up}

I'm sure I'm overlooking something simple, but would really appreciate help with this problem. It's driving me crazy!!

thanks :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 7th, 2008, 7:11 am 
Offline

Joined: May 28th, 2008, 2:11 am
Posts: 739
Location: Minnesota, USA
Do you actually want to send a tilde (~) or the grave key (`)? If you're going for the tilde, use
Code:
MButton::!~
Otherwise, the first one you posted should work just fine.

_________________
Unless otherwise stated, all code is untested

(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 7th, 2008, 7:17 am 
Offline

Joined: September 7th, 2008, 5:53 am
Posts: 5
I want the grave key, but I tested, and it doesn't matter if it's tilde. So my code is correct then, but it still wont work. I think the problem is combining the ALT with the character? is there a special method for games that I'm not aware of? I did try searching, but don't even know where to begin - its such a seemingly simple problem.

Thanks for replying.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 7th, 2008, 8:21 am 
Offline

Joined: May 28th, 2008, 2:11 am
Posts: 739
Location: Minnesota, USA
Maybe something like this?
Code:
MButton::SendPlay, !``

_________________
Unless otherwise stated, all code is untested

(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 7th, 2008, 8:59 am 
Offline

Joined: September 7th, 2008, 5:53 am
Posts: 5
hmm.. still no joy..

I've been doing further experimentation, and I can remap to a single keypress, but combining alt with any keypress (tested on F10) is unsuccessful.

I've been scouring the forums, and am beginning to think this may be a game where it wont work. But the forums for the game itself say there is no hack-detection software.

The game is Angels Online, and all I want to do is change weapon with my Middle Button!!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 7th, 2008, 9:59 am 
Online
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3328
Location: Simi Valley, CA
Code:
SetKeyDelay, 20, 80
#IfWinActive, YourGame'sWindowTitleHere
  $MButton::Send {LAlt Downtemp}{``}{LAlt Up}
:?:
Some games use their own hooks and/or ignore key presses that are released too quickly.

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 7th, 2008, 8:10 pm 
Offline

Joined: September 7th, 2008, 5:53 am
Posts: 5
Awesome!!! that worked! :) You're my hero! :) Thank you so much

I'm about to look through the help and make sense of it (I'm terrible at scripting

Thanks again!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2008, 12:46 am 
Offline

Joined: September 7th, 2008, 5:53 am
Posts: 5
I have been looking around at examples and scripts and I have 2 questions about that code:

what is $Mbutton? and why does that work where Mbutton doesn't?

why does Downtemp make a difference?

I have tried to find the answers myself, but haven't been able to work it out.

Thanks!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2008, 3:00 am 
Offline

Joined: May 28th, 2008, 2:11 am
Posts: 739
Location: Minnesota, USA
The Manual wrote:
Hotkey $ Prefix:
This is usually only necessary if the script uses the Send command to send the keys that comprise the hotkey itself, which might otherwise cause it to trigger itself. The exact behavior of the $ prefix varies depending on operating system:

On Windows NT4/2k/XP or later: The $ prefix forces the keyboard hook to be used to implement this hotkey, which as a side-effect prevents the Send command from triggering it. The $ prefix is equivalent to having specified #UseHook somewhere above the definition of this hotkey.

On Windows 95/98/Me: The hotkey is disabled during the execution of its thread and re-enabled afterward. As a side-effect, if #MaxThreadsPerHotkey is set higher than 1, it will behave as though set to 1 for such hotkeys.
From the Hotkey page. Guessing this is just because it forces the script to use the keyboard hook.

The Manual wrote:
The word DownTemp may also be used. Its effect is the same as Down except for the modifer keys (Control/Shift/Alt/Win). In those cases, DownTemp tells subsequent sends that the key is not permanently down, and may be released whenever a keystroke calls for it. For example, Send {Control DownTemp} followed later by Send a would produce a normal "a" keystroke, not a control-A keystroke.
From the Send page. I think this one is like this just so LAlt doesn't get stuck down somehow.

_________________
Unless otherwise stated, all code is untested

(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 16th, 2008, 10:32 pm 
Hi..
i'm also still new here and don't know everything..
but i still can understand about da basically script learned from the tutorial...

i'm also playing angels online..
and i'm also looking on how to make center scroll button mouse can use same function with alt+` when in game..

the code that [VxE] give to rerail that rerail said its work,but i still don't work for me..and i cannot understand it..

Code:
SetKeyDelay, 20, 80
#IfWinActive, Angels Online - Archillies(Malaysia-1)
  $MButton::Send {LAlt Downtemp}{``}{LAlt Up}


is it still have something code i need to put before that code?

pls someone help me..thanx[/code]


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 17th, 2008, 1:04 pm 
Offline

Joined: February 13th, 2008, 6:14 pm
Posts: 17
Location: Jakarta-Indonesia
Code:
SetKeyDelay, 20, 80
#IfWinActive, Angels Online - Archillies(Malaysia-1)
  $MButton::SendPlay {LAlt Downtemp}{``}{LAlt Up}


Maybe change Send to SendPlay should work.

_________________
Image I need knowledge to feed my brain.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 17th, 2008, 3:32 pm 
Offline

Joined: July 21st, 2008, 4:16 pm
Posts: 726
Location: Calgary, AB, Canada
If you do that, also change:
Code:
SetKeyDelay, 20, 80, Play
#IfWinActive, Angels Online - Archillies(Malaysia-1)
  $MButton::SendPlay {LAlt Downtemp}{``}{LAlt Up}

If that doesn't work, try this:

Code:
SetTitleMatchMode, 2
SetKeyDelay, 20, 80, Play
#IfWinActive, Angels Online
  $MButton::SendPlay {LAlt Downtemp}{``}{LAlt Up}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 21st, 2008, 2:25 am 
Offline

Joined: October 16th, 2008, 10:22 pm
Posts: 1
oh thanx a lot guyz..
dat code worked...
juz with one click in center button [scroll button] of da mouse same just like click "alt+~" on keyboard.
but can i know,what code needed to change dat function from one click to scroll up down using scroll button same just like click alt+~..

example:
if i scroll up...same juz like click alt+~
and..
if i scroll down..it also same juz like click alt+~


Report this post
Top
 Profile  
Reply with quote  
 Post subject: ahk for angels online
PostPosted: June 18th, 2010, 6:42 pm 
nothing of this doesnt work for me so im wondering if u can make one for me that will use F1 F2 F3 F4 at once when i press number 1
pls and ty :D


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: [VxE], Google Feedfetcher, iBob35555VR, Tilter_of_Windmills and 77 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