AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Conflict between Sends - Very simply only

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Kerean



Joined: 24 Nov 2009
Posts: 5

PostPosted: Tue Nov 24, 2009 5:26 am    Post subject: Conflict between Sends - Very simply only Reply with quote

I believe this is a very simple question (but obviously something difficult enough for me to ask for help since I'm new at all this).

I have in my AHK file something defined like this:

i1: SendInput, {Numpad7}
return

+^q::
SendInput {enter}top ms{enter}
return

i1 is defined as a variable somewhere else to be "t".

The problem comes because t is defined to send 7, the resultant text sent becomes 7op ms

Any help would be appreciated.
Back to top
View user's profile Send private message
Guest






PostPosted: Tue Nov 24, 2009 5:40 am    Post subject: Reply with quote

if i1 is a function, it should be
Code:

i1:
SendInput, {Numpad7}
return 

and u can use modifier symbol $ in front of the hotkey
Back to top
Kerean



Joined: 24 Nov 2009
Posts: 5

PostPosted: Tue Nov 24, 2009 5:43 am    Post subject: Reply with quote

Yup it is actually written as such, I forgotten to add the CR.

Are you telling me that I can just set it to:

Code:
$i1:
SendInput, {Numpad7}
return 


Because I did try that and the rest of the script failed for some reason or other. I think i1 is a variable defined somewhere else (I didn't write the script).

Anonymous wrote:
if i1 is a function, it should be
Code:

i1:
SendInput, {Numpad7}
return 

and u can use modifier symbol $ in front of the hotkey
Back to top
View user's profile Send private message
Guest






PostPosted: Tue Nov 24, 2009 5:45 am    Post subject: Reply with quote

i1 is a function
u should be adding that to a hotkey, like
Code:
Hotkey, $a, i1
 
Back to top
Kerean



Joined: 24 Nov 2009
Posts: 5

PostPosted: Tue Nov 24, 2009 6:08 am    Post subject: Reply with quote

Hmm, I'm not really sure if I understand you, but the original script can be found at http://www.autohotkey.net/paste/1nn06xf - maybe you can decipher it better than me.

This script relies on reading a particular file, the relevant portion of which is set out below as well:

Code:
////////////////////////////////////////////////////
//                   Inventory                    //
////////////////////////////////////////////////////
// [item1]=t
// [item2]=y
// [item3]=g
// [item4]=h
// [item5]=b
// [item6]=n




Anonymous wrote:
i1 is a function
u should be adding that to a hotkey, like
Code:
Hotkey, $a, i1
 
[/code]
Back to top
View user's profile Send private message
Guest






PostPosted: Tue Nov 24, 2009 6:36 am    Post subject: Reply with quote

which is this line:
Code:
Hotkey, %hotkey%, i%A_Index%, ON
 

u can change it to:
Code:

this_hotkey = $%hotkey%
Hotkey, %this_hotkey%, i%A_Index%, ON
 
Back to top
Guest






PostPosted: Tue Nov 24, 2009 6:48 am    Post subject: Reply with quote

Anonymous wrote:
if i1 is a function, it should be
Code:

i1:
SendInput, {Numpad7}
return 

and u can use modifier symbol $ in front of the hotkey


PLEASE use the proper nomenclature. The above code is NOT A FUNCTION, it is a subroutine (also refered to as a "label"). A "Function" is a very different thing!
Calling a subroutine/label a function will only lead to confusing noobs. Rolling Eyes
Back to top
Kerean



Joined: 24 Nov 2009
Posts: 5

PostPosted: Tue Nov 24, 2009 7:06 am    Post subject: Reply with quote

Ah so basically we add an intermediary variable to add the $ inside? That seems to work Smile

Anonymous wrote:
which is this line:
Code:
Hotkey, %hotkey%, i%A_Index%, ON
 

u can change it to:
Code:

this_hotkey = $%hotkey%
Hotkey, %this_hotkey%, i%A_Index%, ON
 


Thanks!!
Back to top
View user's profile Send private message
Kerean



Joined: 24 Nov 2009
Posts: 5

PostPosted: Tue Nov 24, 2009 7:07 am    Post subject: Reply with quote

As a noob, I was confused either way haha; but what I was more confused about is how come eeryone seems to show up as "Guest" rahter than with user accounts?

Can't quite follow who's saying what Razz


Anonymous wrote:
Anonymous wrote:
if i1 is a function, it should be
Code:

i1:
SendInput, {Numpad7}
return 

and u can use modifier symbol $ in front of the hotkey


PLEASE use the proper nomenclature. The above code is NOT A FUNCTION, it is a subroutine (also refered to as a "label"). A "Function" is a very different thing!
Calling a subroutine/label a function will only lead to confusing noobs. Rolling Eyes
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group