| View previous topic :: View next topic |
| Author |
Message |
Kerean
Joined: 24 Nov 2009 Posts: 5
|
Posted: Tue Nov 24, 2009 5:26 am Post subject: Conflict between Sends - Very simply only |
|
|
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 |
|
 |
Guest
|
Posted: Tue Nov 24, 2009 5:40 am Post subject: |
|
|
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
|
Posted: Tue Nov 24, 2009 5:43 am Post subject: |
|
|
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 |
|
 |
Guest
|
Posted: Tue Nov 24, 2009 5:45 am Post subject: |
|
|
i1 is a function
u should be adding that to a hotkey, like
|
|
| Back to top |
|
 |
Kerean
Joined: 24 Nov 2009 Posts: 5
|
Posted: Tue Nov 24, 2009 6:08 am Post subject: |
|
|
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] |
|
| Back to top |
|
 |
Guest
|
Posted: Tue Nov 24, 2009 6:36 am Post subject: |
|
|
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
|
Posted: Tue Nov 24, 2009 6:48 am Post subject: |
|
|
| 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.  |
|
| Back to top |
|
 |
Kerean
Joined: 24 Nov 2009 Posts: 5
|
Posted: Tue Nov 24, 2009 7:06 am Post subject: |
|
|
Ah so basically we add an intermediary variable to add the $ inside? That seems to work
| 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 |
|
 |
Kerean
Joined: 24 Nov 2009 Posts: 5
|
Posted: Tue Nov 24, 2009 7:07 am Post subject: |
|
|
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
| 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.  |
|
|
| Back to top |
|
 |
|