Difference between revisions of "User:Aaxelb"

From NetHackWiki
Jump to navigation Jump to search
m (Improved pacifist screen bindings)
m (Improved pacifist screen bindings)
Line 1: Line 1:
 
==Improved pacifist screen bindings==
 
==Improved pacifist screen bindings==
My first few pacifist attempts ended in bump-kills within the first three dungeon levels (though once my pet got killed by a newt on dlvl 1...), so I tried out [[User:Tjr|Tjr]]'s [[Talk:Pacifist#No_more_bump-kills:_Remapping_the_vi_movement_commands_with_screen|keybindings]], and took the time to improve them a bit, mostly because I couldn't log in without escaping the l in my username, and sometimes got annoyed when opening doors, applying a stethoscope, etc.
+
My first few pacifist attempts ended in bump-kills within the first three dungeon levels (though once my pet got killed by a newt on dlvl 1...), so I tried out [[User:Tjr|Tjr]]'s [[Talk:Pacifist#No_more_bump-kills:_Remapping_the_vi_movement_commands_with_screen|key bindings]], and took the time to improve them a bit, mostly because I couldn't log in without escaping the l in my username, and sometimes got annoyed when opening doors, applying a stethoscope, etc.
  
 
Basically, this setup lets you toggle "pacifist mode" while playing. There are three rc files:
 
Basically, this setup lets you toggle "pacifist mode" while playing. There are three rc files:
  
 
The file ~/.screenrc-pacifist reads:
 
The file ~/.screenrc-pacifist reads:
  # Hit ^o followed by o to enable pacifist keybindings
+
  # Hit ^o followed by o to enable pacifist key bindings
 
  bindkey ^o command -c pacifist-toggle
 
  bindkey ^o command -c pacifist-toggle
 
  bind -c pacifist-toggle o source ~/.screenrc-pacifist-on
 
  bind -c pacifist-toggle o source ~/.screenrc-pacifist-on
  
 
~/.screenrc-pacifist-on reads (I left out some of Tjr's bindings because I like using Ctrl-movement):
 
~/.screenrc-pacifist-on reads (I left out some of Tjr's bindings because I like using Ctrl-movement):
  # Activate pacifist keybindings
+
  # Activate pacifist key bindings
 
  # defuse movement keys so they won't attack.
 
  # defuse movement keys so they won't attack.
 
  # Unfortunately, deactivates autopickup.
 
  # Unfortunately, deactivates autopickup.
Line 23: Line 23:
 
  # make control-t the unbound-prefix
 
  # make control-t the unbound-prefix
 
  bindkey "\024" mapdefault
 
  bindkey "\024" mapdefault
  # Set ^o o to turn pacifist keybindings off
+
  # Set ^o o to turn pacifist key bindings off
 
  bind -c pacifist-toggle o source ~/.screenrc-pacifist-off
 
  bind -c pacifist-toggle o source ~/.screenrc-pacifist-off
 
  wall "Pacifist mode activated!"
 
  wall "Pacifist mode activated!"
  
 
And ~/.screenrc-pacifist-off reads:
 
And ~/.screenrc-pacifist-off reads:
  # Remove pacifist keybindings
+
  # Remove pacifist key bindings
 
  bindkey 'h'
 
  bindkey 'h'
 
  bindkey 'y'
 
  bindkey 'y'

Revision as of 13:57, 20 October 2011

Improved pacifist screen bindings

My first few pacifist attempts ended in bump-kills within the first three dungeon levels (though once my pet got killed by a newt on dlvl 1...), so I tried out Tjr's key bindings, and took the time to improve them a bit, mostly because I couldn't log in without escaping the l in my username, and sometimes got annoyed when opening doors, applying a stethoscope, etc.

Basically, this setup lets you toggle "pacifist mode" while playing. There are three rc files:

The file ~/.screenrc-pacifist reads:

# Hit ^o followed by o to enable pacifist key bindings
bindkey ^o command -c pacifist-toggle
bind -c pacifist-toggle o source ~/.screenrc-pacifist-on

~/.screenrc-pacifist-on reads (I left out some of Tjr's bindings because I like using Ctrl-movement):

# Activate pacifist key bindings
# defuse movement keys so they won't attack.
# Unfortunately, deactivates autopickup.
bindkey 'h' stuff 'mh'
bindkey 'y' stuff 'my'
bindkey 'k' stuff 'mk'
bindkey 'u' stuff 'mu'
bindkey 'l' stuff 'ml'
bindkey 'n' stuff 'mn'
bindkey 'j' stuff 'mj'
bindkey 'b' stuff 'mb'
# make control-t the unbound-prefix
bindkey "\024" mapdefault
# Set ^o o to turn pacifist key bindings off
bind -c pacifist-toggle o source ~/.screenrc-pacifist-off
wall "Pacifist mode activated!"

And ~/.screenrc-pacifist-off reads:

# Remove pacifist key bindings
bindkey 'h'
bindkey 'y'
bindkey 'k'
bindkey 'u'
bindkey 'l'
bindkey 'n'
bindkey 'j'
bindkey 'b'
bindkey "\024"
# Set ^o o to turn pacifist bindings on
bind -c pacifist-toggle o source ~/.screenrc-pacifist-on
wall "Pacifist mode deactivated!"

And now, start nethack with:

 screen -c ~/.screenrc-pacifist telnet nethack.alt.org

You can log in as normal, then when you hit ^o o, each movement key X will be replaced with mX. If you want to turn it off, hit ^o o again.