AutoHotkey Community

It is currently May 27th, 2012, 8:36 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 70 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject:
PostPosted: April 19th, 2006, 5:40 pm 
Offline

Joined: January 18th, 2006, 12:37 am
Posts: 290
Toxicity) wrote:
i dled Warkeys , and the script seems to work fine.
Does it add autocast script?
if i bind "a" for lightning shield , and i keep pushing "a" , it will continuly make shields where i want??


I'm not sure what you mean exactly, but I did not include anything for auto-casting. If you remap lightning shield to "a" it will work as you have described.

_________________
My AutoHotkey Program for Warcraft III:
Warkeys
http://warkeys.sourceforge.net/

Remap your hotkeys
Healthbars always on
Remap inventory


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 19th, 2006, 8:11 pm 
i also dont understand what i say , but i know what i want it to mean (<= correct ??) .
The auto casting is for exemple not to have to do "a - left clic- a -left clic" but doing "a (keep pushing a) - left - left" and it does same thing , but u dont have to push 10x a to make a sheep army with ure sorcs :)
So , what to add to do this?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 19th, 2006, 8:29 pm 
I just thought about something really clever :
im undead player , i did my own customkeys , sothat my V key is not used ;
i always use dk / lich (war3 roc) , and what i would like to do is :
if i push V , i want the script to do the following thing :
-select hero (F1)
-push A (coil)=> azer qsdf wxcv keyboard (yes im french , what a shame)
-then coil my lich , but i dont exactly know how to do with keys

Can u try to do this for me ? please =(


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 19th, 2006, 8:40 pm 
Quote:
jtbalogh said : º Holding QWERTY to repeat spells, attacks, etc.

And the code is....?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 19th, 2006, 10:14 pm 
Offline

Joined: January 18th, 2006, 12:37 am
Posts: 290
Toxicity wrote:
i also dont understand what i say , but i know what i want it to mean (<= correct ??) .
The auto casting is for exemple not to have to do "a - left clic- a -left clic" but doing "a (keep pushing a) - left - left" and it does same thing , but u dont have to push 10x a to make a sheep army with ure sorcs :)
So , what to add to do this?


Here's an example of how it SHOULD work, but when I tested it it didn't work.
Code:
; NOTE: this code DOES NOT WORK properly
; clear the variable
cAutocast :=

; set up the characters
*~a::cAutocast = a
*~q::cAutocast = q
*~f::cAutocast = f

; have the left mouse button also send the spell
*LButton::Send, {Blind}{LButton}%cAutocast%

; use shift to clear the variable
*~Shift::cAutocast :=


ToXi wrote:
I just thought about something really clever :
im undead player , i did my own customkeys , sothat my V key is not used ;
i always use dk / lich (war3 roc) , and what i would like to do is :
if i push V , i want the script to do the following thing :
-select hero (F1)
-push A (coil)=> azer qsdf wxcv keyboard (yes im french , what a shame)
-then coil my lich , but i dont exactly know how to do with keys

Can u try to do this for me ? please =(


This can be done, but it's not something I'm familair with. You can PM dosboot to ask him. All the script needs to do is this:

Code:
v::
SendPlay, {F1}a
; somehow move to the lich's picture in the upper left (I think we need to know your Warcraft III screen resolution)
SendPlay, {LButton}
Return


GuEsT13 wrote:
Quote:
jtbalogh said : º Holding QWERTY to repeat spells, attacks, etc.

And the code is....?


You can do something like this, but it will mess up training units too if the hotkeys are the same. This basically acts like a turbo key.
Code:
q::SendPlay, q
w::SendPlay, w
; etc.

_________________
My AutoHotkey Program for Warcraft III:
Warkeys
http://warkeys.sourceforge.net/

Remap your hotkeys
Healthbars always on
Remap inventory


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 20th, 2006, 3:43 am 
Offline

Joined: February 12th, 2006, 11:55 pm
Posts: 16
Well it is very easy to coil your lich if you don't want to be too smart about it (i.e. just tell AHK to move the mouse to the 2nd hero portrait location without checking if a hero is there or if that hero is the lich). For a simple script like this you don't really need these smart features, but someday you may have a really cool script concept and may want (or need) to use pixel colors.

This code will select your first hero and attempt to cast whatever is bound to 'a' on your second hero. It is smart only in the sense that it will abort the casting if it doesn't find a second hero (advanced tooltips must be turned on for the script to work at all). If you don't want to have the "hero check" feature (or don't want to turn advanced tooltips on) delete the PixelGetColor and If(...) statements. You can also delete the ColorEqual() function in this case.

Code:
ColorEqual(x,y,t)
{
x += 0
y += 0

x1 := Floor(x/65536)
y1 := Floor(y/65536)
x2 := Floor((x-x1*65536)/256)
y2 := Floor((y-y1*65536)/256)
x3 := (x-x1*65536-x2*256)
y3 := (y-y1*65536-y2*256)

z1 := x1-y1
z1 := x2-y2
z1 := x3-y3

if (Abs(z1) <= t) and (Abs(z2) <= t) and (Abs(z2) <= t)
return 1
else
return 0
}


v::
SendPlay, {F1}
MouseGetPos, X1, Y1
MouseMove, 32, 127, 0 ; move to 2nd hero icon at the upper left
PixelGetColor, color, 745, 540 ; look for the tooltip on the bottom right
if(ColorEqual(color,0x238AAC,3) == 1)
         Send, a{LButton}
Sleep, 10
MouseMove, %X1%, %Y1%, 0
return


Notes:
-I see AHK has its own ColorEqual() function which does the exact same thing as this one, I just haven't had time to play around with it yet.
-The 'next level' of automation as it were - automatically finding your Lich among all 3 hero portraits - is quite involved. The way I would do this is by using something like pixel matrix search (it has its own thread if you are really interested) to distinguish the 3 portraits.

Whenever you want to work with pixel positions or pixel colors the code may have to be changed from user to user. Screen resolution will affect pixel positions while video cards and color settings may affect pixel colors (*may* affect, the only thing I know for sure about pixel colors is that the in-game gamma setting doesn't affect PixelGetColor).

If you have to, you can find the right numbers using AHK itself. Use the following script as a tool for finding pixel coordinates and colors. Press u to retrieve the data from the pixel your mouse is currently over and press shift u to read the data.

Code:
u::
MouseGetPos, X1, Y1
PixelGetColor, color1
return

+u::
MsgBox Mouse X,Y was: %X1%, %Y1% Color was: %color1%
return


Getting *tooltip* colors and positions is a little trickier since they only appear when your mouse is in a certain location (in this case, over a hero portrait). Taking screenshots of the game helps here. Like I said before, for a simple script like this though you might just not bother with pixel colors at all.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 23rd, 2006, 8:27 am 
Code:
LAlt & a::Numpad7
LAlt & z::Numpad8
LAlt & q::Numpad4
LAlt & s::Numpad5
LAlt & w::Numpad1
LAlt & x::Numpad2

it doesnt work...i think there is a big mistake , its the first thing i write alone...im a newbie :)
help please


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 23rd, 2006, 6:40 pm 
Offline

Joined: January 18th, 2006, 12:37 am
Posts: 290
When using the & key like that you can't map the keys directly. You have to use SendPlay. Don't forget the {} too!
Code:
Lalt & a::SendPlay, {Numpad7}
Lalt & z::SendPlay, {Numpad8}
Lalt & q::SendPlay, {Numpad4}
Lalt & s::SendPlay, {Numpad5}
Lalt & w::SendPlay, {Numpad1}
Lalt & x::SendPlay, {Numpad2}


If you want to use the shift key to queue commands, you can do this instead:
Code:
!a::SendPlay, {Numpad7}
!z::SendPlay, {Numpad8}
!q::SendPlay, {Numpad4}
!s::SendPlay, {Numpad5}
!w::SendPlay, {Numpad1}
!x::SendPlay, {Numpad2}

+!a::SendPlay, +{Numpad7}
+!z::SendPlay, +{Numpad8}
+!q::SendPlay, +{Numpad4}
+!s::SendPlay, +{Numpad5}
+!w::SendPlay, +{Numpad1}
+!x::SendPlay, +{Numpad2}


In the next couple of days, I will be adding this to Warkeys so you can include modifiers like alt and control (and even other keys like space) to the inventory keys.

_________________
My AutoHotkey Program for Warcraft III:
Warkeys
http://warkeys.sourceforge.net/

Remap your hotkeys
Healthbars always on
Remap inventory


Report this post
Top
 Profile  
Reply with quote  
PostPosted: October 15th, 2006, 1:29 pm 
In the french version of war3, you have to push "^" instead of "[" if you want to see the ennemies' healthbars.
But if i use the script and just replace "[" by "^", nothing will happen since the support of "^" doesn t seem to be included in the program.
Does anyone have a solution ?


Report this post
Top
  
Reply with quote  
PostPosted: October 15th, 2006, 9:24 pm 
Offline

Joined: January 18th, 2006, 12:37 am
Posts: 290
Baka-kun wrote:
In the french version of war3, you have to push "^" instead of "[" if you want to see the ennemies' healthbars.
But if i use the script and just replace "[" by "^", nothing will happen since the support of "^" doesn t seem to be included in the program.
Does anyone have a solution ?


There are a few reasons why it wouldn't work.

The "^" key isn't on your keyboard or you have to press shift and/or alt etc. to use this key. AutoHotkey has a problem when the keys are not on the keyboard. You can use a program called w3hph which is included here: http://files.filefront.com/War_3_Tools_2006zip/;4863711;;/fileinfo.html

There might be an error in the script. If you are using AutoWarkey, click on run the script then right click on the orc face in the system tray (or the "H" with green background) and choose "edit this script". Then change the lines with:
Code:
bHealthBarOn := not bHealthBarOn
if (bHealthBarOn == true)
  SendPlay, {[ Down}{] Down}
else
  SendPlay, {[ Up}{] Up}
return

to what it needs to be for the french version. If you can get this to work, please tell us what keys you used so we can add the French keys to AutoWarkey.

If you need any more help or or willing to test out a few things, please send me a PM so we can talk about through a chat program like AIM. (I could send you some test scripts so we can get the healthbars to work for you.)

_________________
My AutoHotkey Program for Warcraft III:
Warkeys
http://warkeys.sourceforge.net/

Remap your hotkeys
Healthbars always on
Remap inventory


Report this post
Top
 Profile  
Reply with quote  
 Post subject: problem solved
PostPosted: October 16th, 2006, 4:15 pm 
No PM needed ^^
I found a very simple solution.
The french version of war3 had a problem : you have to keep the "^" button down in order to see the ennemies' healthbars.
The problem is that just changing "[" to "^" did not work ("^" was understood as a Alt).
Stupid solution : instead of using "^" healthbars display if you keep "Shift ^" down, which is "¨" on a french keyboard.
So the following code seems to work really fine :
Code:
;; this timer checks to see if warcraft is active and turns on the health bars
settimer, timer_Warcraft, 1000 ;check every 1 second
timer_Warcraft:
{
  ifWinActive, Warcraft III
  {
    if (HealthBarOn == False)
    {
      Send, {¨ Down}
      Send, {] Down}
      HealthBarOn := True
    }
  }

  else ifWinNotActive, Warcraft III
  {
    ;; turn off stuff
    if (HealthBarOn == True)
    {
      Send, {¨ Up}
      Send, {] Up}
      HealthBarOn := False
    }

    ;; same for scrollLock
    if (FollowOn == True)
    {
      Send, {LButton Up}
      FollowOn := False
    }
  }
}

OnExit, ExitSub
return

*Capslock::
if (HealthBarOn == False)
{
  Send, {¨ Down}
  Send, {] Down}
  HealthBarOn := True
}
else
{
  Send, {¨ Up}
  Send, {] Up}
  HealthBarOn := False
}
return

Here is the code i am using.
As i suck at programming, i post it all (or nearly).


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 16th, 2006, 5:07 pm 
Offline

Joined: January 18th, 2006, 12:37 am
Posts: 290
Does that show both your unit's health bars and enemies health? It seems odd that it's only one bracket and not the other.

_________________
My AutoHotkey Program for Warcraft III:
Warkeys
http://warkeys.sourceforge.net/

Remap your hotkeys
Healthbars always on
Remap inventory


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 16th, 2006, 10:03 pm 
upgraded to 1.20e and now my warkeys do not work.the health bars just dun appear any idea why ?


Report this post
Top
  
Reply with quote  
 Post subject: Healthbars
PostPosted: October 16th, 2006, 11:39 pm 
greatbattles wrote:
upgraded to 1.20e and now my warkeys do not work.the health bars just dun appear any idea why ?


If you have the "Esc resets healthbars" option checked, you can try pressing Esc in the game. If that doesn't work, post a reply with some more info and we'll go from there. (Also, make sure that you clicked on "Save and Run script"!)


Report this post
Top
  
Reply with quote  
PostPosted: October 17th, 2006, 7:56 pm 
Quote:
Does that show both your unit's health bars and enemies health? It seems odd that it's only one bracket and not the other.

Yes it does.
In the french version of warcraft, you have to keep "^" down if you want to see the opponents' healthbars (whereas in the english one, the key is "[").
For the allies' healthbars, the key is the same than in the english version ,i.e. ""]".
The problem was that writing
Code:
Send, {^ Down}

didn t work because "^" stands for "alt".
My solution :idea: (which seems to work pretty well) is : pressing "¨" instead of "^" (on a french keyboard the "¨" button can only be accessed through Shift+"^").
So you have :
Code:
Send, {¨ Down}

wherever the "[" appeared in the script for the english version. 8) :wink:


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 70 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: AndyJenk, Aravind, Bing [Bot], hyper_, xXDarknessXx and 11 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