Skip to content

Instantly share code, notes, and snippets.

@Perlence
Created April 26, 2014 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Perlence/11331291 to your computer and use it in GitHub Desktop.
Save Perlence/11331291 to your computer and use it in GitHub Desktop.
Mouse bindings and helpers for Dark Souls II
"""
Mouse bindings and helpers for Dark Souls II
============================================
Features
--------
- Attack with left and right mouse buttons with no delay.
- Execute combos in one key press.
- Close dialogs with Escape.
- Close pop-up dialogs, e.g. item pickup info, with Use key.
Installation
------------
- Download and install `FreePIE`_.
- Download and open this script in FreePIE.
- Configure following Settings section according to your keyboard bindings.
- Run script (``F5``).
- Launch Dark Souls II, go to Key Settings and unbind all mouse bindings that
involve left and right mouse buttons.
- Enjoy.
.. _FreePIE: http://andersmalmgren.github.io/FreePIE/
"""
import time
# Settings
forward = Key.E
normalAttack = Key.D1
strongAttack = Key.D2
breakGuard = Key.D3
jumpingAttack = Key.D4
shield = Key.Z
parry = Key.LeftControl
use = Key.R
ok = Key.Return
back = Key.Backspace
# Mouse bindings
keyboard.setKey(normalAttack, mouse.leftButton)
keyboard.setKey(strongAttack, mouse.rightButton)
keyboard.setKey(parry, mouse.getButton(3))
keyboard.setKey(shield, mouse.getButton(4))
# Menu helpers
keyboard.setKey(ok, keyboard.getKeyDown(use))
keyboard.setKey(back, keyboard.getKeyDown(Key.Escape))
# Combos
def combo(key, attackType):
if keyboard.getKeyDown(key):
keyboard.setKeyDown(forward)
keyboard.setKeyDown(attackType)
time.sleep(0.030)
keyboard.setKeyUp(forward)
keyboard.setKeyUp(attackType)
combo(breakGuard, normalAttack)
combo(jumpingAttack, strongAttack)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment