[Action-RPG Key Script] Attack with your mouse!

[Action-RPG Key Script] Attack with your mouse!

in Community Creations

Posted by: Folji.3460

Folji.3460

Hi! I’m Folji, member in good standing with the College of Synergetics. I want to share something I quickly and simply wrote for the game back during the early head start of the game, but haven’t posted anywhere because it took me this long to get a response about whether I was allowed to do this or not.

I like my MMORPGs more like action games than regular RPGs; I love the control scheme in TERA and DC Universe Online, in Champions Online and Dungeons & Dragons Online I’ve played with FPS controls, even in World of Warcraft I had an addon that rewrote the control scheme to work the same way. I was hoping Guild Wars 2 would offer something like this from the get go, but since it didn’t I decided to just write it.

There’s a lot of gamepad remaps floating around, but I’ve yet to see anything that remaps like this for a mouse and keyboard, so here’s what I’ve got. In case you hadn’t figured it yet, the script in this thread will let you freely control the camera with your mouse while using your mouse buttons to attack. Cool, huh?

To get the obvious question out of the way, is this allowed?
ANet has been understandably vague on a clear yes or no, who wouldn’t be, but there’s still enough to figure out what can be done and what can’t be.


The use of automation (botting), or modifying games files through third party applications is in direct violation of our User Agreement (https://www.guildwars2.com/en/legal/guild-wars-2-user-agreement/) and Rules of Conduct (https://www.guildwars2.com/en/legal/guild-wars-2-rules-of-conduct/). So although we cannot always guarantee this script will be allowed in game, please note that as long as you’re not botting, exploiting or modifying the game files in anyway, you would not be in violation.


If it’s just translating a key-click to a mouse-click, that’s fine. If it’s looping or automating gameplay, that’s not fine.

~ MO
http://www.reddit.com/r/Guildwars2/comments/z5pq4/guild_wars_2_status_friday_august_31/c61oion?context=3

So basically, translating a key into another key and ensuring actions require hardware input? Good enough! This script doesn’t automate anything, doesn’t interface with the game in any way and in general does absolutely nothing unless you tell it to. All it does is that it intercepts what comes from the mouse and rewrites it before sending it on to the system, which then sends it on to the game. Since we’re in the clear on this, let’s get right to it.

1: Download AutoHotkey
Yep, it’s an AutoHotkey script. Surprise, eh? Just go to their page and download the latest version.
http://www.autohotkey.com/

2: Create a new AutoHotkey script
With AutoHotkey installed, right-click the desktop and create a new AutoHotkey script. Just name it anything; I named mine GW2 Mouse. Just keep it right there on the desktop.
http://i47.tinypic.com/2uzplko.png

3: Edit script
Right-click your new .ahk file and choose to “edit script”. Then, remove everything in there and paste this in:


#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir% 

#IfWinActive, Guild Wars 2 
{

MouseMode = 0
Hotkey, *LButton, Off
Hotkey, *LButton Up, Off
Hotkey, *RButton, Off
Hotkey, *Rbutton Up, Off

VNudge = 100
KeyOne = 1
KeyTwo = 4

XButton2::
	if (MouseMode = 0) {
		MouseMode = 1
		WinGetPos, , , Width, Height, Guild Wars 2
		Width /= 2
		Height /= 2
		Height -= %VNudge%
		MouseMove, %Width%, %Height%
		send {RButton Down}
		Hotkey, *LButton, On
		Hotkey, *LButton Up, On
		Hotkey, *RButton, On
		Hotkey, *Rbutton Up, On

	} else {
		MouseMode = 0
		send {Rbutton Up}
		Hotkey, *LButton, Off
		Hotkey, *LButton Up, Off
		Hotkey, *RButton, Off
		Hotkey, *Rbutton Up, Off

	}
return

*LButton::Send {%KeyOne% Down}
*LButton Up::Send {%KeyOne% Up}
*RButton::Send {%KeyTwo% Down}
*RButton Up::Send {%KeyTwo% Up}

}

It’s not complicated at all. Even if you don’t know the scripting language you can probably figure out in two seconds how everything works and what parts do what. Nothing more there than what needs to be there.

I’m hitting a character limit, so let’s continue on in the next post

(edited by Moderator)

[Action-RPG Key Script] Attack with your mouse!

in Community Creations

Posted by: Folji.3460

Folji.3460

4: Configure!
You could just skip this part if you think the default configuration will work for you, but read on ahead if you want to figure out how to customize this deal for yourself.

4.1: Keystroke
Firstly, notice the line XButton2::. That’s Mouse Button 5, usually the foremost of the two side-buttons on your mouse if you’ve got them. I’m using that key because it’s easy to toggle on and off with on the fly, but you can rebind it to any key you want. Just try to avoid any key you’d use in any other context while playing the game, even typing; the script doesn’t know what you’re doing in the game so it can’t know if you really wanted to activate the script or if you were just writing a message.

For more information on how , refer to:
http://www.autohotkey.com/docs/KeyList.htm
http://www.autohotkey.com/docs/Hotkeys.htm

4.2: Screen size
The script centers the mouse on the middle of the screen, then nudges it 100 pixels up. This is just to make it as convenient as possible to cast AoE abilities while the camera is locked, as the circle draws where the cursor is currently located. Centering the cursor and then moving it 100 pixels up puts it right above the character’s head on larger displays, but if you want it further up or further down just edit the VNudge variable. Higher numbers puts it further up, lower number brings it closer to the center.

4.3: Abilities
By default, the script binds mouse button 1 to action button 1 and mouse button 2 to action button 4. The primary attack for the right and left hand weapon, basically, but you can change them to whichever abilities you want with the KeyOne and KeyTwo variables (left and right button respectively).

5: Save and run
Once you’ve got everything how you want it, just save the script, keep it somewhere easily accessible and run it whenever you’re playing Guild Wars 2. It should only function when you’re actually playing, but no point in keeping it running when you’re not. When you’re in the game now, pressing your fifth mouse key locks the camera to your mouse and makes your mouse keys trigger weapon abilities.

I’m Folji, and I make stuff. Now let’s kill with style!

[Action-RPG Key Script] Attack with your mouse!

in Community Creations

Posted by: ixbassamxi.3106

ixbassamxi.3106

That’s a truly amazing find for a person like me, but when playing with ranged characters, wouldn’t it better if there was a way to make a reticle appear?

[Action-RPG Key Script] Attack with your mouse!

in Community Creations

Posted by: Agemnon.4608

Agemnon.4608

“the script in this thread will let you freely control the camera with your mouse "

Already happens sometimes with my Naga if it’s on wireless and I can’t control my character and have to switch to wired to get control back. Clicking a few times takes care of that problem though.

Mice are for moving and skills (Naga only) whereas keyboard for communication, picking up loot, switching attunements, attacking and utility, (and not with the crap hard to reach F buttons), and strafing (Razer Naga only, otherwise mouse 4)

[Action-RPG Key Script] Attack with your mouse!

in Community Creations

Posted by: Agemnon.4608

Agemnon.4608

“DC Universe Online”

Funny, because I uninstalled it the day I downloaded it because of the crappy controls (action buttons to mouse 1 and 2. WTH how am I supposed to move properly?!). I played SWTOR for months just to put things into perspective.

[Action-RPG Key Script] Attack with your mouse!

in Community Creations

Posted by: Folji.3460

Folji.3460

That’s a truly amazing find for a person like me, but when playing with ranged characters, wouldn’t it better if there was a way to make a reticle appear?

That would be cool! But probably a bit tricky. I’ve seen a couple of libraries for AutoHotkey with functions for drawing graphical elements on the screen, but I don’t know how to work with any of them. Never tried. I just play with the frame of mind I’m gonna be targeting whatever’s closest to the center of my screen.

[Action-RPG Key Script] Attack with your mouse!

in Community Creations

Posted by: Folji.3460

Folji.3460

For great justice! Two weeks later, how are people finding this little script? I know I’m still having a blast playing the game like this, but I really want to hear other people’s stories.

[Action-RPG Key Script] Attack with your mouse!

in Community Creations

Posted by: Okamie.9270

Okamie.9270

good work dear fellow, good work.