Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # THIS SCRIPT SHOULD BE USED WITH FREEPIE
- # http://andersmalmgren.github.io/FreePIE/
- #------------------------------------------------------------------------------
- # Key-Config:
- # Use Digital Genesis' Keyscan
- # ( ftp://ftp.digitalgenesis.com/pub/keyscan/keyscan09.zip ) to find:
- # Five adjactend keys on your keyboard of which:
- # Key 1-4 and key 2-5 and any other combo of 4 keys can be pressed simultanously,
- # plus an easy to spam strumming bar key, that can also be pressed simultanously
- # additionally to the other 4 keys.
- #
- # The keys also can't be the predefiened keys "1,2,3,4,5" or "a,s,d,f,g" or
- # "e,r,space,u,i" because the game already uses those.
- # Of course some keys like ESC are also a bad idea to use.
- #
- # On my keyboard I've found the best result with "RightShift, Slash, Period, Comma, M"
- # plus "LeftControl" as Strumbar, while holding the keyboard away from your body with
- # the cable pointing towards your head
- # (so your right thumb easily reaches LeftControl).
- # It's the default you find below.
- # If you have an expensive "N-Key Rollover" keyboard you're in luck and can use
- # whatever you want (except predefined keys)!
- #
- # If you found your keys insert them below. Use Key."XXX" and autocomplete to find the
- # correct key name FreePIE wants or look up key names under
- # https://github.com/AndersMalmgren/FreePIE/wiki/Reference under the "Key" section.
- # For example: Non-Numpad numbers are "D1 - D0". Numpad numbers are "NumberPad0 to
- # NumberPad9".
- #------------------------------------------------------------------------------------
- Key1 = "RightShift"
- Key2 = "Slash"
- Key3 = "Period"
- Key4 = "Comma"
- Key5 = "M"
- Strumbar = "LeftControl"
- Test = Key.M
- # !!!script code starts from here!!!
- #-------------------------------------------------
- # declare some cycle-persisting variables at start:
- #-------------------------------------------------
- if starting:
- BarIsPressed = 0
- ButtonIsPressed=[0,0,0,0,0]
- LastHOPOButton = 5
- # If LastHOPOButton equals 5, no button has been pressed in a HOPO-mode Session
- #-------------------------------------------------------------------------
- # check for not pressed, pressed and recently pressed stuff
- #-------------------------------------------------------------------------
- # check for not pressed buttons
- if keyboard.getKeyUp(getattr(Key, Key1)):
- ButtonIsPressed[0] = 0
- if keyboard.getKeyUp(getattr(Key, Key2)):
- ButtonIsPressed[1] = 0
- if keyboard.getKeyUp(getattr(Key, Key3)):
- ButtonIsPressed[2] = 0
- if keyboard.getKeyUp(getattr(Key, Key4)):
- ButtonIsPressed[3] = 0
- if keyboard.getKeyUp(getattr(Key, Key5)):
- ButtonIsPressed[4] = 0
- # ButtonJustDown variable
- ButtonJustDown=[0,0,0,0,0]
- # check for currently pressed and possibly just pressed buttons
- if keyboard.getKeyDown(getattr(Key, Key1)):
- if ButtonIsPressed[0] == 0:
- ButtonJustDown[0] = 1
- ButtonIsPressed[0] = 1
- if keyboard.getKeyDown(getattr(Key, Key2)):
- if ButtonIsPressed[1] == 0:
- ButtonJustDown[1] = 1
- ButtonIsPressed[1] = 1
- if keyboard.getKeyDown(getattr(Key, Key3)):
- if ButtonIsPressed[2] == 0:
- ButtonJustDown[2] = 1
- ButtonIsPressed[2] = 1
- if keyboard.getKeyDown(getattr(Key, Key4)):
- if ButtonIsPressed[3] == 0:
- ButtonJustDown[3] = 1
- ButtonIsPressed[3] = 1
- if keyboard.getKeyDown(getattr(Key, Key5)):
- if ButtonIsPressed[4] == 0:
- ButtonJustDown[4] = 1
- ButtonIsPressed[4] = 1
- # check for not pressed strum bar and reset HOPO Session if true
- if keyboard.getKeyUp(getattr(Key, Strumbar)):
- BarIsPressed = 0
- LastHOPOButton = 5
- #-------------------------------------------------------------------------------
- # HOPO-mode: If the strum bar is pressed, check if a hammered button is different to
- # the last one and, if true, do the thing
- # No repeated same button Hammer-Ons allowed in this script, because of TRVENESS
- # (unless you press 1-5 :-D)
- #-------------------------------------------------------------------------------
- elif ButtonJustDown[4] and LastHOPOButton != 4:
- keyboard.setPressed(Key.D5)
- LastHOPOButton = 4
- elif ButtonJustDown[3] and LastHOPOButton != 3:
- keyboard.setPressed(Key.D4)
- LastHOPOButton = 3
- elif ButtonJustDown[2] and LastHOPOButton != 2:
- keyboard.setPressed(Key.D3)
- LastHOPOButton = 2
- elif ButtonJustDown[1] and LastHOPOButton != 1:
- keyboard.setPressed(Key.D2)
- LastHOPOButton = 1
- elif ButtonJustDown[0] and LastHOPOButton != 0:
- keyboard.setPressed(Key.D1)
- LastHOPOButton = 0
- #-------------------------------------------
- # button handover in case of actual strumming
- #-------------------------------------------
- if BarIsPressed == 0 and keyboard.getKeyDown(getattr(Key, Strumbar)):
- BarIsPressed = 1
- if ButtonIsPressed[4]:
- keyboard.setPressed(Key.D5)
- elif ButtonIsPressed[3]:
- keyboard.setPressed(Key.D4)
- elif ButtonIsPressed[2]:
- keyboard.setPressed(Key.D3)
- elif ButtonIsPressed[1]:
- keyboard.setPressed(Key.D2)
- elif ButtonIsPressed[0]:
- keyboard.setPressed(Key.D1)
Advertisement
Add Comment
Please, Sign In to add comment