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 

Warcraft 3 Frozen Throne

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





PostPosted: Thu Jan 10, 2008 4:23 pm    Post subject: Warcraft 3 Frozen Throne Reply with quote

Hello!

Ive just started using ahk and ive made a script:

#IfWinActive, ahk_class Warcraft III
!f::send f
!Tab::Send {Tab}
XButton1::Send {Numpad8}
LWin::Send {] Down}{[ Down}
^LWin::Send {] Up}{[ Up}

Can someone help me adding some extra to my scripts!

I would like a shortcut for sending units back to mainhall/base. What to type?

I would also like a shortcut for group adding..

Best regards
Nisbrix
Back to top
POINTS



Joined: 18 Jan 2006
Posts: 284

PostPosted: Thu Jan 10, 2008 6:11 pm    Post subject: Re: Warcraft 3 Frozen Throne Reply with quote

Nisbrix wrote:
I would like a shortcut for sending units back to mainhall/base. What to type?


You need to have 2 hotkeys setup. One to record the position of your main hall using MouseGetPos. (You will have to point to your hall on the minimap and then press this hotkey.) Then you have to run a second hotkey to send them to the position that you recorded. You should use MouseGetPos to record your current position and then use MouseClick (with Right click) to click the mini-map and then use MouseMove to return to your original position.

Nisbrix wrote:
I would also like a shortcut for group adding..


Adding to a group is normally shift and the group that you want to add to. The hotkey would be similar to your other hotkeys:

Code:
a::Send, +3 ; adds a unit to group 3

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

Remap your hotkeys
Healthbars always on
Remap inventory
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Thu Jan 10, 2008 6:24 pm    Post subject: Reply with quote

Thank you for the fast reply POINTS! I appreciate that.

Can you explain how to make these two hotkey setups?
Back to top
Nisbrix
Guest





PostPosted: Thu Jan 10, 2008 6:24 pm    Post subject: Reply with quote

Anonymous wrote:
Thank you for the fast reply POINTS! I appreciate that.

Can you explain how to make these two hotkey setups?
Back to top
POINTS



Joined: 18 Jan 2006
Posts: 284

PostPosted: Fri Jan 11, 2008 4:39 pm    Post subject: Autocast Reply with quote

I use this function to toggle autocast. Your code will be similar to this.

This function takes an number 1 to 12, and clicks the right mouse button on one of the grid.

The code will save the current mouse position, clicks on the appropriate grid position (based on the screen size), and returns to the starting position.

Code:
; AutoCast Function
AutoCast(iSpellQWERHotkey)
{
  MouseGetPos, iMousePosX, IMousePosY
  if (iSpellQWERHotkey == 1)
  {
    iMouseGotoX := A_ScreenWidth*4//5
    iMouseGotoY := A_ScreenHeight*4//5
  }
  else if (iSpellQWERHotkey == 2)
  {
    iMouseGotoX := A_ScreenWidth*4//5
    iMouseGotoY := A_ScreenHeight*22//25
  }
  else if (iSpellQWERHotkey == 3)
  {
    iMouseGotoX := A_ScreenWidth*4//5
    iMouseGotoY := A_ScreenHeight*19//20
  }
  else if (iSpellQWERHotkey == 4)
  {
    iMouseGotoX := A_ScreenWidth*17//20
    iMouseGotoY := A_ScreenHeight*4//5
  }
  else if (iSpellQWERHotkey == 5)
  {
    iMouseGotoX := A_ScreenWidth*17//20
    iMouseGotoY := A_ScreenHeight*22//25
  }
  else if (iSpellQWERHotkey == 6)
  {
    iMouseGotoX := A_ScreenWidth*17//20
    iMouseGotoY := A_ScreenHeight*19//20
  }
  else if (iSpellQWERHotkey == 7)
  {
    iMouseGotoX := A_ScreenWidth*9//10
    iMouseGotoY := A_ScreenHeight*4//5
  }
  else if (iSpellQWERHotkey == 8)
  {
    iMouseGotoX := A_ScreenWidth*9//10
    iMouseGotoY := A_ScreenHeight*22//25
  }
  else if (iSpellQWERHotkey == 9)
  {
    iMouseGotoX := A_ScreenWidth*9//10
    iMouseGotoY := A_ScreenHeight*19//20
  }
  else if (iSpellQWERHotkey == 10)
  {
    iMouseGotoX := A_ScreenWidth*19//20
    iMouseGotoY := A_ScreenHeight*4//5
  }
  else if (iSpellQWERHotkey == 11)
  {
    iMouseGotoX := A_ScreenWidth*19//20
    iMouseGotoY := A_ScreenHeight*22//25
  }
  else if (iSpellQWERHotkey == 12)
  {
    iMouseGotoX := A_ScreenWidth*19//20
    iMouseGotoY := A_ScreenHeight*19//20
  }
  Click, Right, %iMouseGotoX%, %iMouseGotoY%
  MouseMove, %iMousePosX%, %iMousePosY%
}


If you still need more help, I can try to look at it this weekend. (It's something I'm interested in developing too.)
_________________
My AutoHotkey Program for Warcraft III:
Warkeys
http://warkeys.sourceforge.net/

Remap your hotkeys
Healthbars always on
Remap inventory
Back to top
View user's profile Send private message Visit poster's website
Nisbrix
Guest





PostPosted: Sat Jan 12, 2008 6:08 pm    Post subject: Reply with quote

Wauw! What a post, really incredible.

The code looks very advanced, but i am a little confused. When i load the script and start playing warcraft 3 i cannot make it work. I try to put the available numbers on my units and right click on the ground/main hall ect. But it does not seem like it is recorded?

Thanks for everything so far!
Back to top
POINTS



Joined: 18 Jan 2006
Posts: 284

PostPosted: Sun Jan 13, 2008 1:19 am    Post subject: Go home Reply with quote

The code above was for toggling autocasting. I tested this code and it works for sending your units home. Hover over hall on the minimap and press a to set it up. Then press s with your unit selected and he will go home.

Code:
a::MouseGetPos, iHallPosX, iHallPosY

s::
MouseGetPos, iMousePosX, iMousePosY
Click, Right, %iHallPosX%, %iHallPosY%
MouseMove, %iMousePosX%, %iMousePosY%
return

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

Remap your hotkeys
Healthbars always on
Remap inventory
Back to top
View user's profile Send private message Visit poster's website
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