Automatic left mouse click is HERE

Users who are viewing this thread

Mr. Ninja

Recruit
I don't know about you guys, but having 1 million denars -let alone 50 million- is a pain in the finger to deposit in the bank. I decide to make our lives easier and brush up on my programming skills.

To do- Download .exe and run it:  uploadmb.com/dw.php?id=1311539784
OR​
get autohotkey (google it), copy the script into a notepad file, save and run.

$F1::  ; Make the F1 key into a hotkey (the $ symbol facilitates the "P" mode of GetKeyState below).
Loop  ; Since no number is specified with it, this is an infinite loop unless "break" or "return" is encountered inside.
{
    if not GetKeyState("F1", "P")  ; If this statement is true, the user has physically released the F1 key.
        break  ; Break out of the loop.
    ; Otherwise (since the above didn't "break"), keep clicking the mouse.
    Click  ; Click the left mouse button at the cursor's current position.
}
return

To use: Place your cursor over what you want to spam with clicks and hold F1.
 
Have been playing with AutoIT and AutoHotkey for the last hour! For some reason no method (SendMode Play / Input etc.) worked - Probably due to exclusive DirectX usage of Warband(?).

A million thanks for this post!!!
 
How would I make it use another button instead? :?:

EDIT: I changed it to F9, but I don't know how to make it use CTRL+X or something, anyone know how?
 
Hi Guys,

Building on the code here I have 3 functions working now:

hotkey-1: press and hold this = produces repeatitive LMB clicking
[using this to add to garrison/party many troops/PoWs without clicking more than once]

hotkey-2: press and hold this = produces repeatitive CTRL+LMB clicking
[using this to add/remove to/from inventory many items without clickingmore than once]

hotkey-3: press and hold this = produces continuous CTRL+SPACE BAR
[using this to time compress with a single key]


I'll post my script here later tonight (on mobile now).


EDIT - Ok as promised, Autohotkey code is at the bottom of this post. Feel free to modify for your taste and hotkeys of your choice. Code below as is uses x,b,m keys.
[These keys may seem like a weird choice but on my DVORAK keyboard layout they are next to each other].

Now, this code works for me providing the 3 functions listed above. Having said that, I gotta admit it sometimes keeps sending CTRL+LMB even when you release the hotkey, solution is to press and release the CTRL+LMB hotkey once again, this fixes the issue. Code needs improvement to fix this issue but I can't justify spending any more time on it as it works good enough for me already.

And a tip on using hotkeys to type names etc. summary
if you run this code, you can't use the three hotkeys (in my case x,b,m) to type a new saved game name or character/Kingdom name. One option is ALT+TAB to go back to Windows desktop and disable hotkeys in the system tray however I do not prefer this at it takes too long.

Here is the WORKAROUND I use:

Summary: Use CAPS LOCK and SHIFT keys as required.

Detailed explanation...
Keep in mind that script will only 'catch' single key presses. If you would like to type in a new character name, say 'Mike', when you press SHIFT+M, it will *NOT* trigger the hotkey since it will be a SHIFT+M rather than a single 'm'.

Similarly, if you want to type 'bummer' as the save game, turn the CAPS LOCK ON then type 'bummer' while holding SHIFT key, reversing the reverse effect of CAPS LOCK key and sending the key strokes two by two [SHIFT+b, SHIFT+u etc.] thus not triggering the hotkeys.

AUTOHOTKEY CODE
Code:
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

#IfWinActive Mount&Blade ;This script works only if Mount&Blade window is active.

$x::  ; Make the 'x' key a hotkey (the $ symbol facilitates the "P" mode of GetKeyState below).
Loop  ; Since no number is specified with it, this is an infinite loop unless "break" or "return" is encountered inside.
{
    if not GetKeyState("x", "P")  ; If this statement is true, the user has physically released the x key.
        break  ; Break out of the loop.

    ; Otherwise (since the above didn't "break"), keep clicking the mouse.
    Click  ; Click the left mouse button at the cursor's current position.
}

$b::  ; Make the 'CTRL+b' keystroke a hotkey (the $ symbol facilitates the "P" mode of GetKeyState below).
Loop  ; Since no number is specified with it, this is an infinite loop unless "break" or "return" is encountered inside.
{
    if not GetKeyState("b", "P")  ; If this statement is true, the user has physically released the b key.
        break  ; Break out of the loop.

    ; Otherwise (since the above didn't "break"), keep sending CTRL+LeftMouseButton click.
    Send {LControl Down}
    Click  ; Click the left mouse button at the cursor's current position.
    Send {LControl Up}
}

$m::  ; Make the CTRL+SPACE keystroke a hotkey (the $ symbol facilitates the "P" mode of GetKeyState below).
Loop  ; Since no number is specified with it, this is an infinite loop unless "break" or "return" is encountered inside.
{
    if not GetKeyState("m", "P")  ; If this statement is true, the user has physically released the m key.
        break  ; Break out of the loop.

    ; Otherwise (since the above didn't "break"), keep sending CTRL+LeftMouseButton click.
    Send {LControl Down}
    Send {Space down}   ; Press the spacebar down.
    Sleep, 20
    Send {Space up}  ; Release the spacebar.
    Send {LControl Up}
}

return
 
whats the point of ctrl+space???
theres no function in the game that uses that...
and ctrl+x is really the only thing that is needed as far as macros goes...
have you been able to figure out how to have it send x?
i tried autohotkey and macromaker and quite a few others but never got it to work sending ctrl+x
would be great if you figured it out.
thanks for this! maybe it gives some people a few ideas....
 
effemb said:
whats the point of ctrl+space???
theres no function in the game that uses that...
and ctrl+x is really the only thing that is needed as far as macros goes...
have you been able to figure out how to have it send x?
i tried autohotkey and macromaker and quite a few others but never got it to work sending ctrl+x
would be great if you figured it out.
thanks for this! maybe it gives some people a few ideas....

Ctrl-Space speeds up the passing of game time.

I could never get it to work with Ctrl-X, Ctrl-H etc. either, but I'm going to try this script and report (I hadn't put in things like IfWinActive).
 
ctrl+space needs a hotkey????
thats a bit moot...because you have to hold it down for it to work, you dont press it repeatedly.
just hold ctrl, and then space, and time will pass...
maybe this guy thought you had to continually press space?
no no no no! LOL :smile:

i have actually made limited success with a ctrl+x hotkey, by using the virtual key code of X.
it does not work very well however, and sometimes just stops working entirely...
but using autohotkey, it did work sporadically, and also using autohotkey's view key press window (check View->view key presses menu or whatever its called) i did see that autohotkey is able to detect the hotkeys inside the MnB window...the problem then just lies with being able to send the keystrokes to the window.

please note that this doesnt work well...when it does work, it does so slowly...ie: i changed "m" to be the ctrl+x hotkey, and when i hold down M with a troop highlited in party menu, it will jump up a few troops ("upgrade" them)...like 3, or 4 troops will quickly be ready to upgrade, then it stops...so i release M and press it again, and maybe that time it does nothing...so i keep trying, and then maybe it hops up a few more troops, stops, then hops up a few more, stops....
its very strange.  it does in any case work in a limited sense, so im wondering how it would be possible to fix it somehow within the AH program.  theres gotta be a way!

in any case, try using the VKEY for x, heres the code i use:
$m::
Loop
{
    if not GetKeyState("m", "P")  ; If this statement is true, the user has physically released the m key.
        break  ; Break out of the loop.
    Send {LControl Down}
    Sleep, 100
    Send {vk58sc02D}
    Sleep, 100
    Send {vk58sc02D}
    Sleep, 100
    Send {LControl Up}
}

try using various values for the sleep command...in fact with 100 sleep it didnt work so well, it worked best at 40 sleep from my testing.
eventually it stops working at all, and i have to shut down mnb, load it back up, and then it might start working again.
very very strange behaviour...
 
effemb said:
whats the point of ctrl+space???
theres no function in the game that uses that...
Answer for this question is in my previous post:

JohnT said:
hotkey-3: press and hold this = produces continuous CTRL+SPACE BAR
[using this to time compress with a single key]

This function is in the game even though you cannot see it in the CONTROLS page.

effemb said:
and ctrl+x is really the only thing that is needed as far as macros goes...
I disagree, as I have posted earlier, I prefer to press and hold a single key, rather than two keys. Furthermore, I wish to use the three main keys next to each other (the three keys documented above with each function I do need and use a lot).

effemb said:
have you been able to figure out how to have it send x?
i tried autohotkey and macromaker and quite a few others but never got it to work sending ctrl+x
would be great if you figured it out.
thanks for this! maybe it gives some people a few ideas....
Yes I have been able to figure out and I have posted the script I use above, you really didn't read my post and/or try the script, did you? :smile:
 
Moridin said:
Ctrl-Space speeds up the passing of game time.

I could never get it to work with Ctrl-X, Ctrl-H etc. either, but I'm going to try this script and report (I hadn't put in things like IfWinActive).
IfWinActive does not provide an extra magic functionality to solve CTRL-LMB problem. The solution to that is Sending Control-Key-Down command first (and then releasing it).

What IfWinActive does is, makes this 'Hotkeys' work only in the target application (M&B Warband window that is). In other words if you are using any other Windows application, when you press one of the hotkeys, they will not do the scripted action. (for example pressing 'b' will only send the regular 'b' character and it will *not* send CTRL+LMB as scripted in our autohotkey script).
 
JohnT said:
effemb said:
whats the point of ctrl+space???
theres no function in the game that uses that...
Answer for this question is in my previous post:

JohnT said:
hotkey-3: press and hold this = produces continuous CTRL+SPACE BAR
[using this to time compress with a single key]

This function is in the game even though you cannot see it in the CONTROLS page.

actually thats not the answer lol :smile:
as i said...you do not have to continually press ctrl+space to pass time.  i answered that in my previous post :grin:
you just have to HOLD THEM BOTH DOWN...and time passes.
your hotkey script generates continuous repeated keypresses of ctrl and space, it does not hold them down.
edit: ok i checked autohotkey help file and realized that you cant send a DOWN keypress to space
so if you really are so lazy you want to replace 2 keys with 1 (lol ok its not a bad thing, but i just never would've bothered doing it myself), you should change the script to this:
$m::
Loop
{
    if not GetKeyState("m", "P"){  ; If this statement is true, the user has physically released the m key.
        Send {LControl Up}
        break  ; Break out of the loop.
    }

    if not GetKeyState({LControl}, "P"){
        Send {LControl Down}
        ; unfortunately you cant send a {Space Down} or otherwise should do that here and not even have this inside a loop at all
    }
    Sleep, 10
    Send {Space}
}

effemb said:
and ctrl+x is really the only thing that is needed as far as macros goes...
I disagree, as I have posted earlier, I prefer to press and hold a single key, rather than two keys. Furthermore, I wish to use the three main keys next to each other (the three keys documented above with each function I do need and use a lot).
ya i retract what i said slightly - having the click macro is useful...for bank, for sorting troops, etc...thanks for that...
but the other 2 are sortof...mmm...not really macros.  i mean space+ctrl you just hold it down to pass time.  making a macro that repeatedly presses space actually will make time pass SLOWER (and just use more of your cpu to run the macro).  but hey if having one keypress for it really is to your liking, im not knocking it at all!  good invention is all about finding easier ways to do stuff...

effemb said:
have you been able to figure out how to have it send x?
i tried autohotkey and macromaker and quite a few others but never got it to work sending ctrl+x
would be great if you figured it out.
thanks for this! maybe it gives some people a few ideas....
Yes I have been able to figure out and I have posted the script I use above, you really didn't read my post and/or try the script, did you? :smile:
[/quote]
of course i did, i tried it all, and ive been using autohotkey very intensely in the past as well as having exhausted every single function in that program in attempting to make a ctrl+x macro.
and, ironically enough, i managed to make one that works slightly.
you, on the other hand, apparently didnt even read my post because what i asked is if youve figured out a way to make a ctrl+x macro.  which you just said you did, but nowhere in this thread is there anything from you about a ctrl+x macro.  do you know what i mean when i say ctrl+x macro?  maybe we arent communicating clearly here...
thanks for the click macro in any case.  im sure itll help some people.  i personally dont click much, but it does give some ideas to possibly help solve the ctrl+x macro problem. (with banking system i set a rule in my games that i cant have over 50k in any bank, otherwise the income just gets a bit silly imo.  and when i deposit i generally do 10 or 20 at a time as i build up my bank reserves so clicking 10-20 times never made me want to build a macro for it.  but if you horde money in banks i can definitely see it saving you some finger pain! :smile: ).
 
oh ya i just thought about another thing with clicking:
when transferring troops (with mouse click), you can hold down SHIFT to transfer the entire stack of troops, and CTRL to transfer 10 at a time.
so shift+click transfers entire stack.
ctrl+click transfers 10.

just thought, that maybe youre using the click macro to transfer troops around too, but theres actually much better features already in the game engine that handle this for you.
banking, and moving the position of troops in your party though - definite win for click macro.
 
@effemb

1.
Thanks for pointing out these although I am aware of CTRL-LMBclick and SHIFT-LMBclick that is built into the game.
Those simply did not cut it for me and my current method is far more superior for my taste because pressing and holding is much less 'finger-work' than pressing-releasing buttons all the time - YMMV.



2.
Re CTRL-SPACE 'continous' keystroke
Again you are right about the inefficiency of sending keystroke several times rather than press-and-holding. Press-n-hold method, as I said above, is superior to pressing and holding. However, press-n-holding single key is also superior to press-n-holding two keys. Again, for my taste, I prefer press-n-holding single key, rather than two. Hence my script, use it if you like, ignore it if you don't. Oh BTW the performance difference is not important on a modern PC in such an application [M&B Warband-Campaign Map that is - it could matter if you're running a simulation or 3D application etc. but it is fine by me for the time being]



3.
You are right about communications problem - I simply misread CTRL-X as CTRL-LMBclick all the time [because in some contexts I simply use X for left-mouse-button click], so my fault...



4.
I don't have the need to use CTRL-X because for experience or money I simply export char, ALT+TAB to exported text file, modify it, and re-import it.

Since I do not need it, I did not try this CTRL-X hotkey before but just to help you out, tested now and as you've reported it does not work, this is very interesting, I suspect it does not work because of the way M&B Warband application draws to the graphics buffer. It does work with notepad etc.

Anyway, here is a solution: http://www.autohotkey.com/forum/topic38780.html
Disclaimer: I did not test this 'solution' but the OP claims it works, so it SHOULD work. Post if it does not and let's have another look.

 
4.
I don't have the need to use CTRL-X because for experience or money I simply export char, ALT+TAB to exported text file, modify it, and re-import it.
the most useful thing for ctrl+x is actually leveling up troops, in party screen.
there is no other way to do it.

if you want to keep your game "legit" also - editing char file and importing will imbalance it.
if you ctrl+x to get xp ingame, your char levels up normally.

this is also about making the functions available ingame.
not having to go out of the game to edit stuff.

anyway -- i actually just figured it out.  i just made a ctrl+x macro and it works perfectly.\
the link you posted to that other guy's macro attempt doesnt work.
CTRL+X MACRO IS HERE FOLKS!!!
use it in autohotkey.
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
#IfWinActive Mount&Blade

$^+s::Suspend

$m::
Loop
{
  if not GetKeyState("m", "P")
    break
  Click
  Sleep, 10
}
return

$+j::
Loop
{
  if GetKeyState("h", "P")
    break
  Send {LControl down}
  Sleep, 5
  Send {x down}
  Sleep, 5
  Send {x up}
  Sleep, 5
  Send {x down}
  Sleep, 5
  Send {x up}
  Sleep, 5
  Send {x down}
  Sleep, 5
  Send {x up}
  Sleep, 5
  Send {LControl up}
}
return

$n::
Loop
{
  if not GetKeyState("n", "P")
    break
  Send {LControl down}
  Sleep, 10
  Send {x down}
  Sleep, 10
  Send {x up}
  Sleep, 10
  Send {x down}
  Sleep, 10
  Send {x up}
  Sleep, 10
  Send {x down}
  Sleep, 10
  Send {x up}
  Sleep, 10
  Send {LControl up}
}
return

$k::
Loop
{
  if not GetKeyState("k", "P")
    break
  Send {LControl down}
  Sleep, 10
  Send {F4 up}
  Sleep, 10
  Send {F4 down}
  Sleep, 10
  Send {F4 up}
  Sleep, 10
  Send {F4 down}
  Sleep, 10
  Send {F4 up}
  Sleep, 10
  Send {F4 down}
  Sleep, 10
  Send {LControl up}
}
return

keys:
shift + control + s = suspend hotkeys (pause toggle)
[hold-down] m = ctrl + click macro
[hold-down] n = ctrl + x macro
[hold-down] k = ctrl + F4 macro
shift + j = ctrl + x macro (NOTE!!!! hit shift+j ONCE, and it will keep firing ctrl+x until you hit "h" key to stop it --- why this macro? click a stack of 200 troops, shift+j, go get a coffee while they level up!)

proof: www.youtube.com/watch?v=Oe0pngOmX0Y
 
cheater-755946.jpg

:razz:
 
effemb said:
4.
I don't have the need to use CTRL-X because for experience or money I simply export char, ALT+TAB to exported text file, modify it, and re-import it.
you do realize that we dont use ctrl+x to add exp to our characters but rather to add exp to troops, right?
well if not...ya...
the most sought after macro in MnB is ctrl+x to be able to add exp to troops in party screen.  perhaps also for some that want to manually add exp to hero, or gold, as well...because editing the file means you imbalance your hero while adding exp ingame means you actually level up.

anyway...i actually just figured it out.  i just made a macro and it works perfectly.  funny enough the guy in that thread you posted had a similar concept but i tried his macro and it doesnt work.  this one here does though.
CTRL+X MACRO IS HERE FOLKS!!!
use it in autohotkey.
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

#IfWinActive Mount&Blade ;This script works only if Mount&Blade window is active.

$m::
Loop
{
    if not GetKeyState("m", "P")
        break
    Click
    Sleep, 10
}

$n::
Loop
{
    if not GetKeyState("n", "P")
        break
Send {LControl down}
Sleep, 10
Send {x down}
Sleep, 10
Send {x up}
Sleep, 10
Send {x down}
Sleep, 10
Send {x up}
Sleep, 10
Send {x down}
Sleep, 10
Send {x up}
Sleep, 10
Send {LControl up}
}
return

No didn't realize, I didn't try Floris yet, just landed into this thread through search function looking for 'AutoHotkey' keyword.

I meant the last post using another tool together with AutoHotkey (that's why I didn't test myself, didn't want to download another software pack :grin: )

Glad you've it all sorted now.


Duh said:
Duh! I don't cheat, otherwise what's the point but I *do* re-add a few million denars when I restart a new game due to a new revision being released, causing me to lose all my equipment, companions, fiefs everything. but it is a whole different topic I'll cut it here now :wink:

Thanks again to the original poster - very useful thread, making Warband life easier...
 
JohnT said:
effemb said:
4.
I don't have the need to use CTRL-X because for experience or money I simply export char, ALT+TAB to exported text file, modify it, and re-import it.
you do realize that we dont use ctrl+x to add exp to our characters but rather to add exp to troops, right?
well if not...ya...
the most sought after macro in MnB is ctrl+x to be able to add exp to troops in party screen.  perhaps also for some that want to manually add exp to hero, or gold, as well...because editing the file means you imbalance your hero while adding exp ingame means you actually level up.

anyway...i actually just figured it out.  i just made a macro and it works perfectly.  funny enough the guy in that thread you posted had a similar concept but i tried his macro and it doesnt work.  this one here does though.
CTRL+X MACRO IS HERE FOLKS!!!
use it in autohotkey.
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

#IfWinActive Mount&Blade ;This script works only if Mount&Blade window is active.

$m::
Loop
{
    if not GetKeyState("m", "P")
        break
    Click
    Sleep, 10
}

$n::
Loop
{
    if not GetKeyState("n", "P")
        break
Send {LControl down}
Sleep, 10
Send {x down}
Sleep, 10
Send {x up}
Sleep, 10
Send {x down}
Sleep, 10
Send {x up}
Sleep, 10
Send {x down}
Sleep, 10
Send {x up}
Sleep, 10
Send {LControl up}
}
return

No didn't realize, I didn't try Floris yet, just landed into this thread through search function looking for 'AutoHotkey' keyword.
its not particular to floris...ctrl+x is the universal m&b cheat hotkey for adding gold(inventory screen), adding exp to yourself (character screen) or adding exp to troops and ranking up their tiers (party screen)...
so...ya...ctrl+x hotkey is really the one people have been looking for the most.  adding gold/exp can be done via exporting char file but only ctrl+x can be used to boost up your troops.
oh there is one other thing i quite often use ctrl+x for though - and that is leveling up enemy AI lords that imo should be higher level...thanks to an included mod that lets you "view my stats" on any AI lord you talk to, you can also level them up with ctrl+x and give them better skills/stats that way.  because some ai lords are on a template to build their character quite uselessly, not giving themselves any CHA or leadership so they have small army size and pumping all their skill points into things like looting, tracking, personality, etc....
thats a good way of actually making the AI lords which have a bad leveling template actually be a harder challenge for you.  i tend to level up enemy AI lords to at least level 40 if i find a low level 20-25 one that isnt using his skill points well.  and i give them full on leadership/cha, and then doctor skills/INT.  makes em much more formidable opponents.  even the ones that demand to run around naked :grin: (ya theres still a few naked lords running about).


I meant the last post using another tool together with AutoHotkey (that's why I didn't test myself, didn't want to download another software pack :grin: )

Glad you've it all sorted now.


Duh said:
Duh! I don't cheat, otherwise what's the point but I *do* re-add a few million denars when I restart a new game due to a new revision being released, causing me to lose all my equipment, companions, fiefs everything. but it is a whole different topic I'll cut it here now :wink:

Thanks again to the original poster - very useful thread, making Warband life easier...

@Duh :grin:
@JohnT oh cmon man, its cheating...and so what :grin:
its not like this game is really a challenge after youve conquered the map 10 times without using a single cheat.  ability to "cheat" and alter the gameworld to my liking is the only thing that keeps me playing a game after ive played it through "normally" enough times...
look at oblivion for example.  i still have it installed,since it was released, and every year or so i do a fresh install, download the 100 or so coolest mods that i like, setup an entirely new "environment" and replay it over again.  an oblivion mod is officially a cheat, it alters the game world, mechanics, adds new content, changes stuff...
but without mods i wouldnt play oblivion at all.
floris mod itself is a cheat if you want to get technical.  anything that alters the official game rules is cheating.
i always love how people go crazy about cheating acusations, when using a mod itself is cheating.
 
effemb said:
@JohnT oh cmon man, its cheating...and so what :grin:
its not like this game is really a challenge after youve conquered the map 10 times without using a single cheat.  ability to "cheat" and alter the gameworld to my liking is the only thing that keeps me playing a game after ive played it through "normally" enough times...
look at oblivion for example.  i still have it installed,since it was released, and every year or so i do a fresh install, download the 100 or so coolest mods that i like, setup an entirely new "environment" and replay it over again.  an oblivion mod is officially a cheat, it alters the game world, mechanics, adds new content, changes stuff...
but without mods i wouldnt play oblivion at all.
floris mod itself is a cheat if you want to get technical.  anything that alters the official game rules is cheating.
i always love how people go crazy about cheating acusations, when using a mod itself is cheating.
Well put. I will put the gun down now. *calms* :lol: :lol:
 
effemb said:
4.
I don't have the need to use CTRL-X because for experience or money I simply export char, ALT+TAB to exported text file, modify it, and re-import it.
the most useful thing for ctrl+x is actually leveling up troops, in party screen.
there is no other way to do it.

if you want to keep your game "legit" also - editing char file and importing will imbalance it.
if you ctrl+x to get xp ingame, your char levels up normally.

this is also about making the functions available ingame.
not having to go out of the game to edit stuff.

anyway -- i actually just figured it out.  i just made a ctrl+x macro and it works perfectly.\
the link you posted to that other guy's macro attempt doesnt work.
CTRL+X MACRO IS HERE FOLKS!!!
use it in autohotkey.
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
#IfWinActive Mount&Blade

$^+s::Suspend

$m::
Loop
{
  if not GetKeyState("m", "P")
    break
  Click
  Sleep, 10
}
return

$+j::
Loop
{
  if GetKeyState("h", "P")
    break
  Send {LControl down}
  Sleep, 5
  Send {x down}
  Sleep, 5
  Send {x up}
  Sleep, 5
  Send {x down}
  Sleep, 5
  Send {x up}
  Sleep, 5
  Send {x down}
  Sleep, 5
  Send {x up}
  Sleep, 5
  Send {LControl up}
}
return

$n::
Loop
{
  if not GetKeyState("n", "P")
    break
  Send {LControl down}
  Sleep, 10
  Send {x down}
  Sleep, 10
  Send {x up}
  Sleep, 10
  Send {x down}
  Sleep, 10
  Send {x up}
  Sleep, 10
  Send {x down}
  Sleep, 10
  Send {x up}
  Sleep, 10
  Send {LControl up}
}
return

$k::
Loop
{
  if not GetKeyState("k", "P")
    break
  Send {LControl down}
  Sleep, 10
  Send {F4 up}
  Sleep, 10
  Send {F4 down}
  Sleep, 10
  Send {F4 up}
  Sleep, 10
  Send {F4 down}
  Sleep, 10
  Send {F4 up}
  Sleep, 10
  Send {F4 down}
  Sleep, 10
  Send {LControl up}
}
return

keys:
shift + control + s = suspend hotkeys (pause toggle)
[hold-down] m = ctrl + click macro
[hold-down] n = ctrl + x macro
[hold-down] k = ctrl + F4 macro
shift + j = ctrl + x macro (NOTE!!!! hit shift+j ONCE, and it will keep firing ctrl+x until you hit "h" key to stop it --- why this macro? click a stack of 200 troops, shift+j, go get a coffee while they level up!)

proof: www.youtube.com/watch?v=Oe0pngOmX0Y

I wanted to Thank the OP for this Autohotkey script,


Im currently now playing Mount & Blade Warband: Viking Conquest,

And there are some troops that require experience from over 728 days..... i singlehandedly tried lvling 1 guy to that and it took me lik 100 x clicking Ctrl + X,

and that was just for a single guy....

So thats tool, pressing Shift J, making a coffee, and having 200 noblemen when i come back, awesome, and less RSI for me.
 
Back
Top Bottom