War3 (DotA) Target Self?

This is a discussion on War3 (DotA) Target Self? within the Warcraft 3 forum board part of the Hot Games category; Originally Posted by Wolfszorn @ dotacrazy : The Script doesnt work for me, my mouse icon disappears but nothing happens. ...

Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 29
  1. #11
    Wynthar's Avatar
    Wynthar is offline Advanced Hacker
    Array
    Join Date
    Feb 2009
    Location
    So Cal, USA
    Posts
    267
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    10
    Reputation
    243
    Quote Originally Posted by Wolfszorn View Post
    @dotacrazy: The Script doesnt work for me, my mouse icon disappears but nothing happens.

    No heal and no using of tp =/
    What resolution are you using?

    Options -> Video -> Resolution

    If you are using something different from 1600x1200 then let me know and I'll see if I can figure out something to accommodate for resolution types.

    Quote Originally Posted by Woulny View Post
    warkeys > autohotkey
    WarKeys = Easier than Autohotkeys
    Autohotkeys = More flexbility than WarKeys

    Quote Originally Posted by Warkeys
    A special thanks to Chris Mallett, who created AutoHotkey, the scripting language that Warkeys is written in.
    That's right out of the help file for Warkeys

    One other note though, when installing Warkeys, you get AutoWarkey, which if you go to the "UserCode" tab that is essentially a place to write Autohotkey scripts.



    However, one of the things that you get with Autohotkeys but not with Warkeys is an extensive help file.

    Preference is yours.
    Last edited by MaRcDk; 03-27-2009 at 09:41 PM.

  2. #12
    Wolfszorn's Avatar
    Wolfszorn is offline Advanced Hacker
    Array
    Join Date
    Sep 2007
    Posts
    318
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    12
    Reputation
    212
    Quote Originally Posted by dotacrazy View Post
    What resolution are you using?

    Options -> Video -> Resolution

    If you are using something different from 1600x1200 then let me know and I'll see if I can figure out something to accommodate for resolution types.
    I'm playing in window mode, dont know what resolution it is..

  3. #13
    Wynthar's Avatar
    Wynthar is offline Advanced Hacker
    Array
    Join Date
    Feb 2009
    Location
    So Cal, USA
    Posts
    267
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    10
    Reputation
    243
    Quote Originally Posted by dotacrazy
    Wow. Window'd mode. That's tricky. Reason for it being tricky is that you could have the window anywhere on the screen. If you were playing full screen then it's easy to know where on the screen things will be so we can "Click" on the minimap at the exact location you wish to teleport.

    I suppose if you crave the one click tp to fountain feature what we could do is set up a hotkey such as F7 so every time you load warcraft, and get in a game, you move your cursor to the fountain area on the minimap. Press F7, that will save the cursor location. Then, F12 would simply press 1 (for the TP scroll) and then click at that location you saved using F7.

    Whatcha think?
    Okay. I did some testing so I'm editing my post. (Old post is in quotes.)

    I have found out that no matter where the window is on the screen, auto hotkey is smart enough to click in the same relative location of the program. However, I did test out my script, and using the same resolution setting for the game, the locations are different for full screen versus window mode.

    When you are in a game, go to Menu (F10) -> Options -> Video and read me what your Resolution: setting says.

    If it is 1600x1200 then just a quick test found these coords to work for TP home.

    (X: 31, Y: 824)

    Code:
    *F12::
      Send {Numpad1}
      SetMouseDelay, 1, Play   ; Tiny mouse-delay for compatibility
      MouseGetPos, xpos, ypos
      Send {Click 31, 824, L}
      MouseMove, %xpos%, %ypos%
      SetMouseDelay, -1, Play
      return
    If the resolution is different let me know and I'll test some more.
    Last edited by Wynthar; 03-27-2009 at 08:01 PM. Reason: Did some testing

  4. #14
    Wolfszorn's Avatar
    Wolfszorn is offline Advanced Hacker
    Array
    Join Date
    Sep 2007
    Posts
    318
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    12
    Reputation
    212
    Its 1600x1200, i will try it.

    //Edit: doesnt work, same problem. =(
    Last edited by Wolfszorn; 03-28-2009 at 01:49 AM.

  5. #15
    Wynthar's Avatar
    Wynthar is offline Advanced Hacker
    Array
    Join Date
    Feb 2009
    Location
    So Cal, USA
    Posts
    267
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    10
    Reputation
    243
    Quote Originally Posted by Wolfszorn View Post
    Its 1600x1200, i will try it.

    //Edit: doesnt work, same problem. =(
    Try this
    Code:
    *F5::
      MouseGetPos, xpos, ypos
      MsgBox, X: %xpos% Y: %ypos%
      return
    Then, open Warcraft, and (you do NOT have to be in a game) simply go to the bottom left corner of the screen, at approx where you think the minimap will be, and once you have moved your cursor there. (Make sure the warcraft program is currently the active program) press F5. It should then pop up a msg box with an X: and Y: coordinates. Try that and post what the coordinates are.

    Here is an image of where I'm thinking you should try clicking, and the msg box that should pop up.



    -Spike

  6. #16
    Wolfszorn's Avatar
    Wolfszorn is offline Advanced Hacker
    Array
    Join Date
    Sep 2007
    Posts
    318
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    12
    Reputation
    212
    The coordinates are = X: 62 Y: 779

    //Edit: ok tp works perfect, i change the coordinates, but what is about the spell using. Omni doesnt heal himself if i press f11.

    I think i have to change something about the globals, but how to?
    Last edited by Wolfszorn; 03-28-2009 at 02:48 AM.

  7. #17
    Wynthar's Avatar
    Wynthar is offline Advanced Hacker
    Array
    Join Date
    Feb 2009
    Location
    So Cal, USA
    Posts
    267
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    10
    Reputation
    243
    Ah. Ok. Here's how to fix it. (I'll fix it too.)

    Just as we updated the coordinates for the fountain, we have to update the coordinates for the hero portrait, as well as for the Purification spell. So, using the code I gave earlier for F5 to find positions. Let's load warcraft 3, load Dota, start a single player game. Pick Omni, and then move the cursor to the hero portrait. Press F5. Note the coordinates. Move cursor to Purification. Press F5. Note the coordinates. Then make the necessary changes in the F11 script.

    1) Hero Portrait: X: 438 Y: 754
    2) Purification: X: 1139 Y: 808

    (Your numbers may vary slightly depending on where your cursor is inside the boxes.)

    Now. Go back to the F11 code for Omni's self heal.

    Old Code
    Code:
    *F11:: ;;For Omni -- Heal Self
      SetMouseDelay, 1, Play   ; Tiny mouse-delay for compatibility
      ClickReturn(x1, y3)
      ClickReturn(selfx, selfy) ;Click Self Portrait
      SetMouseDelay, -1, Play
      return
    And, let's change the ClickReturn variables to the hardcoded numbers.
    First we want to click the heal icon, then we want to click the portrait. So, here is the new code.

    New Code
    Code:
    *F11:: ;;For Omni -- Heal Self
      SetMouseDelay, 1, Play   ; Tiny mouse-delay for compatibility
      ClickReturn(1139, 808) ; Click Purification: X: 1139 Y: 808
      ClickReturn(438, 754) ;Click Hero Portrait: X: 438 Y: 754
      SetMouseDelay, -1, Play
      return
    Just for a quick reference, here is the code posted earlier...
    To find a coordinate use this code. Press F5 when the cursor is where you want it to click.
    Code:
    *F5::
      MouseGetPos, xpos, ypos
      MsgBox, X: %xpos% Y: %ypos%
      return

    Tested it in single player window'd mode with 1600x1200 resolution and it works great.
    Hope that works for you.
    Let me know if you have any more questions or problems.

    Hope this also helps you get an idea for how to use Autohotkeys a bit so if you come up with your own ideas perhaps you could write it yourself? For example, maybe you're a dazzle fan. (I'm not) and you want a hotkey to cast the shallow grave on yourself? =)

    Regards,
    -Spike

  8. #18
    Wolfszorn's Avatar
    Wolfszorn is offline Advanced Hacker
    Array
    Join Date
    Sep 2007
    Posts
    318
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    12
    Reputation
    212
    Ok i understand it, one question.

    Is it possible to code this, independing for the resolution?

  9. #19
    Wynthar's Avatar
    Wynthar is offline Advanced Hacker
    Array
    Join Date
    Feb 2009
    Location
    So Cal, USA
    Posts
    267
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    10
    Reputation
    243
    So, I had to think about this for a minute.

    Actually, it took quite a bit longer than I thought it would to answer.

    (ACTUALLY, I rewrote this post 3 times because I kept figureing out new things)

    Looking at the "Grid Setup" that I got from Valarauka.
    The "globals" section that you mentioned.

    Eventually, I realized that he is using the right idea to figure out
    what the resolution is, but it fails when you use window'd mode. So,
    Here is a fix/patch to solve the window'd problem.

    We need to use:

    WinGetPos,,, winWidth, winHeight, A

    So... throw it into the GridSetup function, replace A_ScreenWidth with winWidth
    and A_ScreenHeight with winHeight...

    And now we're back to a workable script in all screen sizes! Woot.

    I suppose this should have been the answer about 10 posts ago. LoL. But, I got
    thrown off by the window'd mode.

    So, to repost the code, here you go. This should work in all resolutions, including when in window'd mode!! Sweet.
    Fixed Code (AGAIN)
    Code:
    ; Got a lot of ideas and code from
    ; a script by Valarauka
    #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
    #InstallKeybdHook        ; Force install of keyboard hook
    Suspend On     ;Start in suspended mode
    
    
    #IfWinActive, Warcraft III
    #UseHook On  ; Force hotkeys to use keyboard hook
    
    *F5::       ;toggle hotkeys and do initial setup
    ;*~Enter::   ;Enter will also enable/disable script so you can chat easily
      Suspend
      GridSetup()
      if (A_IsSuspended)
        SoundPlay *64
      else
        SoundPlay *48
      return
    
    *F12:: ;; TP home
      SendPlay {Numpad1}
      SetMouseDelay, 1, Play   ; Tiny mouse-delay for compatibility
      ClickReturn(sentinelx, sentinely)   ;Click sentinel fountain on minimap
      SetMouseDelay, -1, Play
      return
    
    *F11:: ;;For Omni -- Heal Self
      SetMouseDelay, 1, Play   ; Tiny mouse-delay for compatibility
      ClickReturn(x1, y3)
      ClickReturn(selfx, selfy) ;Click Self Portrait
      SetMouseDelay, -1, Play
      return
    
    
    ClickReturn(x, y)   ;click then return mouse to original position
    {
      MouseGetPos, xpos, ypos
      if (GetKeyState("Alt"))    ;Modifier button for right-click - can be changed to "Ctrl" etc. 
        SendPlay {Click %x%, %y%, R}
      else
        SendPlay {Click %x%, %y%, L}
      MouseMove, %xpos%, %ypos%
    }
    
    GridSetup()   ;set up the screen coords for clicking
    {
      global
      WinGetPos,,, winWidth, winHeight, A
      
      x1:=(510*winWidth)//640
      x2:=(544*winWidth)//640
      x3:=(578*winWidth)//640
      x4:=(612*winWidth)//640
    
      y1:=(390*winHeight)//480
      y2:=(424*winHeight)//480
      y3:=(458*winHeight)//480
    
      sentinelx:=(13*winWidth)//640   ;Sentinel fountain
      sentinely:=(467*winHeight)//480
    
      scourgex:=(110*winWidth)//640   ;Scourge fountain
      scourgey:=(374*winHeight)//480
    
      selfx:=(200*winWidth)//640
      selfy:=(420*winHeight)//480
    }
    Yay, tested in window'd mode and regular full screen mode, and it seems to be working for me.
    -Spike

  10. #20
    Wolfszorn's Avatar
    Wolfszorn is offline Advanced Hacker
    Array
    Join Date
    Sep 2007
    Posts
    318
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    12
    Reputation
    212
    Yes it works, thanks alot !!

    But i have to left-click a bit before he does something.

    Mean, the mouse move to the points, but it doesnt click automaticly. Is it normal?
    Last edited by Wolfszorn; 03-28-2009 at 04:13 PM.

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Memoirs of World of Warcraft
    By Hallowsend in forum WoW forum
    Replies: 21
    Last Post: 08-28-2013, 10:34 AM
  2. The Ultimate WoW PVP Guide of Knowledge
    By Havok in forum WoW Guides
    Replies: 8
    Last Post: 12-06-2008, 02:19 AM
  3. All About War3 Ladder [For Begginners]
    By xHack in forum Warcraft 3 Strategies and replays
    Replies: 2
    Last Post: 10-07-2008, 05:08 PM
  4. The Ultimate PvP Guide Of Knowledge
    By Toxik in forum WoW Guides
    Replies: 0
    Last Post: 10-02-2008, 12:13 AM
  5. Lich King Alpha Testing
    By Bossform in forum WoW forum
    Replies: 10
    Last Post: 05-24-2008, 03:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •