Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Warcraft3 WASD scroll control


  • Please log in to reply
9 replies to this topic
leobasil
  • Members
  • 2 posts
  • Last active: Apr 27 2008 09:57 AM
  • Joined: 10 May 2007
I was pretty annoyed by the fact that in Warcraft 3 one can only scroll using the cursor keys, since I prefere the WASD controls. Simple keymapping didn't work, since when playing in battlenet, I somethimes need the wasd keys for chatting.


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Warcraft3 WASD Scroller
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

SetTitleMatchMode 2
#IfWinActive, Warcraft


;;;;; W - Up ;;;;;;

w::
If (GetKeyState("ScrollLock", "T")) {
  SetKeyDelay -1
  Send {Up DownTemp}
}
else Send w
return

w up::
  SetKeyDelay -1
  Send {Up Up}
return


;;;;; A - Left ;;;;;;

a::
If (GetKeyState("ScrollLock", "T")) {
  SetKeyDelay -1
  Send {Left DownTemp}
}
else Send a
return

a up::
  SetKeyDelay -1
  Send {Left Up}
return

;;;;; S - Down ;;;;;;

s::
If (GetKeyState("ScrollLock", "T")) {
  SetKeyDelay -1
  Send {Down DownTemp}
}
else Send s
return

s up::
  SetKeyDelay -1
  Send {Down Up}
return

;;;;; D - Right ;;;;;;

d::
If (GetKeyState("ScrollLock", "T")) {
  SetKeyDelay -1
  Send {Right DownTemp}
}
else Send d
return

d up::
  SetKeyDelay -1
  Send {Right Up}
return

EDIT: You can turn WASD controlls on/off using the scrollLock key

BLooM2
  • Members
  • 23 posts
  • Last active: Aug 18 2009 10:53 PM
  • Joined: 05 May 2008
I have the same confusion. thanks !
is there someway to automatic judge the chatting

Elesar
  • Members
  • 696 posts
  • Last active: May 08 2015 09:51 PM
  • Joined: 28 Jun 2007
I don't believe that there is a way to detect being in a lobby of any sort at the time.

Here is my version of basically the same script that I made a couple weeks ago.

#SingleInstance Force
#NoEnv
SendMode Play
#IfWinActive Warcraft III

;<=====  HotKey Toggle  =====>
+Enter::
Suspend, Permit
Suspend
If (A_IsSuspended == 1)               ; Disable hotkeys, play sound notification.
  {
    SoundPlay,*64
  }
Else                                  ; Enable hotkeys, play sound notification.
  {
    SoundPlay,*48
  }
Return

;<=====  Directional Remap  =====>
W::
  Send {Up Down}
  Loop
    { 
      Sleep, 10
      GetKeyState, WState, W, P
      If WState = U
        {
          Send {Up Up} 
          Break
        }
     }  
  Return

A::
  Send {Left Down}
  Loop
    { 
      Sleep, 10
      GetKeyState, AState, A, P
      If AState = U
        {
          Send {Left Up}
          Break
        }
    }
  Return

S::
  Send {Down Down}
  Loop
    { 
      Sleep, 10
      GetKeyState, SState, S, P
      If SState = U
        {
          Send {Down Up}
          Break
        }
    }
  Return

D::
  Send {Right Down}
  Loop
    { 
      Sleep, 10
      GetKeyState, DState, D, P
      If DState = U
        {
          Send {Right Up}
          Break
        }
    }
  Return

;<=====  Health Monitor  =====>
`::                            ; Force the game to always show health bars.
  If (HealthBarOn == False)
    {
      Send, {[ Down}
      Send, {] Down}
      HealthBarOn := True
    }
  Else
    {
      Send, {[ Up}
      Send, {] Up}
      HealthBarOn := False
    }
  Return

;<=====  ScreenCap  =====>
P::
  If (A_PriorHotKey = "P" AND A_TimeSincePriorHotkey < 200)
    {
      Send {PrintScreen}
      Sleep, 250
      IfWinNotExist, untitled - Paint
        Run, mspaint.exe
      WinActivate, untitled - Paint
      WinWaitActive, untitled - Paint
      Send {Ctrl Down}v{Ctrl Up}
    }
  Else
    Send p
  Return

This has wasd camera movement, double tap the ` key to always display health bars, double tap p to printscreen and paste into paint (Needed because my computer just takes black screens with the War3 engine).

The directional remap works with going diagonal, but if you press, say up then left, if you release up, you will continue at the diagonal until you release left.

Also, hotkeys are only active inside warcraft III, and Shift+Enter will toggle hotkeys with a sound notification of being on or off.

EDIT: Spelling....

BLooM2
  • Members
  • 23 posts
  • Last active: Aug 18 2009 10:53 PM
  • Joined: 05 May 2008
have a look! it`s my War3Assistant
- automaticly show health
- items hotkey defined by user
- real time statistic APM
- RButton Up eliminate the selected element from current team
- let the selected element run away to enacted point
Posted Image
i`m pleasure if you can understood ;)

buttman
  • Guests
  • Last active:
  • Joined: --
You guys rock thnx so much

MaraRules
  • Guests
  • Last active:
  • Joined: --
Thanks.. very usefull, i find warkeys easier to use and warkeys has something calle Autokeys, then is easier to just copy and paste those scritps.

Destruction
  • Members
  • 1 posts
  • Last active: Dec 06 2009 11:36 PM
  • Joined: 01 Dec 2009
When I talk I use two languages - Russian and English.

I refined the script a bit to use two languages. This is my version:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Get Layout
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

GetLayout( PIDTarget ){
    HWND := DllCall("GetDesktopWindow")
    HWND := DllCall("GetWindow", UINT, HWND, UINT, 5)
    while( HWND > 0 ){
        HWND := DllCall("GetWindow", UINT, HWND, UINT, 2)
        Thread := DllCall("GetWindowThreadProcessId", UINT, HWND, "UINT*", PIDWND)
        if( PIDWND = PIDTarget ){
            break
        }
    }
    return DllCall("GetKeyboardLayout", UINT, Thread)
}


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Warcraft3 WASD Scroller
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

SetTitleMatchMode 2
#IfWinActive, Warcraft

;;;;; W - Up ;;;;;;

w::
If (GetKeyState("ScrollLock", "T")) {
  SetKeyDelay -1
  Send {Up DownTemp}
}
else{
  WinGet, PIDWarcraft, PID, Warcraft
  Layout := GetLayout( PIDWarcraft )
  If( Layout = 68748313 ){
    send ц
  }
  else if( Layout = 67699721 ){
    send w
  }
}
return

w up::
  SetKeyDelay -1
  Send {Up Up}
return


;;;;; A - Left ;;;;;;

a::
If (GetKeyState("ScrollLock", "T")) {
  SetKeyDelay -1
  Send {Left DownTemp}
}
else{
  WinGet, PIDWarcraft, PID, Warcraft
  Layout := GetLayout( PIDWarcraft )
  If( Layout = 68748313 ){
    send ф
  }
  else if( Layout = 67699721 ){
    send a
  }
}
return

a up::
  SetKeyDelay -1
  Send {Left Up}
return

;;;;; S - Down ;;;;;;

s::
If (GetKeyState("ScrollLock", "T")) {
  SetKeyDelay -1
  Send {Down DownTemp}
}
else{
  WinGet, PIDWarcraft, PID, Warcraft
  Layout := GetLayout( PIDWarcraft )
  If( Layout = 68748313 ){
    send ы
  }
  else if( Layout = 67699721 ){
    send s
  }
}
return

s up::
  SetKeyDelay -1
  Send {Down Up}
return

;;;;; D - Right ;;;;;;

d::
If (GetKeyState("ScrollLock", "T")) {
  SetKeyDelay -1
  Send {Right DownTemp}
}
else{
  WinGet, PIDWarcraft, PID, Warcraft
  Layout := GetLayout( PIDWarcraft )
  If( Layout = 68748313 ){
    send в
  }
  else if( Layout = 67699721 ){
    send d
  }
}
return

d up::
  SetKeyDelay -1
  Send {Right Up}
return

PS: I am familiar with bad autohotkey, perhaps there is a way easier?

Sorry for clumsy english.

dber
  • Members
  • 2 posts
  • Last active: Dec 31 2010 01:32 AM
  • Joined: 31 Dec 2010

I was pretty annoyed by the fact that in Warcraft 3 one can only scroll using the cursor keys, since I prefere the WASD controls. Simple keymapping didn't work, since when playing in battlenet, I somethimes need the wasd keys for chatting.


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Warcraft3 WASD Scroller
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

SetTitleMatchMode 2
#IfWinActive, Warcraft


;;;;; W - Up ;;;;;;

w::
If (GetKeyState("ScrollLock", "T")) {
  SetKeyDelay -1
  Send {Up DownTemp}
}
else Send w
return

w up::
  SetKeyDelay -1
  Send {Up Up}
return


;;;;; A - Left ;;;;;;

a::
If (GetKeyState("ScrollLock", "T")) {
  SetKeyDelay -1
  Send {Left DownTemp}
}
else Send a
return

a up::
  SetKeyDelay -1
  Send {Left Up}
return

;;;;; S - Down ;;;;;;

s::
If (GetKeyState("ScrollLock", "T")) {
  SetKeyDelay -1
  Send {Down DownTemp}
}
else Send s
return

s up::
  SetKeyDelay -1
  Send {Down Up}
return

;;;;; D - Right ;;;;;;

d::
If (GetKeyState("ScrollLock", "T")) {
  SetKeyDelay -1
  Send {Right DownTemp}
}
else Send d
return

d up::
  SetKeyDelay -1
  Send {Right Up}
return

EDIT: You can turn WASD controlls on/off using the scrollLock key



Sry, Im noobie. How and where do I have to copy it to make warcraft 3 work with W,A,S,D ?
Thanks

MasterFocus
  • Moderators
  • 4323 posts
  • Last active: Jan 28 2016 01:38 AM
  • Joined: 08 Apr 2009

How and where do I have to copy it

<!-- m -->http://www.autohotke...cs/Tutorial.htm<!-- m -->

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Antonio França -- git.io -- github.com -- ahk4.net -- sites.google.com -- ahkscript.org

Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.


eaglecanara
  • New members
  • 1 posts
  • Last active: Sep 27 2015 08:22 AM
  • Joined: 27 Sep 2015

hey dude i have a simple question

i want to move the camera using wasd and not mouse

pls tell me what i need to do