Loading

Hide away messages

  1. /**
  2. * Script Description
  3. ** Attempts to hide all away messages from channel windows.
  4. *
  5. * Configuration Settings / Commands:
  6. ** None!
  7. *
  8. * Settings File
  9. ** This script stores all settings in HideAwayScriptMessage.ini in the mIRC Directory.
  10. ** Type: //run $mIRCDir\HideAwayScriptMessage.ini to view.
  11. */
  12.  
  13. ; Handles text
  14. on ^*:TEXT:*:#:{
  15.   if ($CheckForAway($1-) != 0) {
  16.  
  17.     ; Opens the @Window
  18.     OpenWindow
  19.  
  20.     ; Add to @AwayMessages
  21.     aline -ph @AwayMessages $timestamp $($+(07,$regml(CheckAway,1),:),2) $($+(12[10,$network,12:10,$chan,12:10,$nick,$iif($regml(CheckAway,2),12]10:,12])),2) $regml(CheckAway,2)
  22.     ;.notice $nick Nobody cares about your Away message: http://sackheads.org/~bnaylor/spew/away_msgs.html
  23.     ; Halt the message from the channel
  24.     haltdef
  25.   }
  26. }
  27.  
  28.  
  29. ; Handles actions
  30. on ^*:ACTION:*:#:{
  31.   if ($CheckForAway($1-) != 0) {
  32.  
  33.     ; Opens the @Window
  34.     OpenWindow
  35.  
  36.     ; Add to @AwayMessages
  37.     aline -ph @AwayMessages $timestamp $($+(07,$regml(CheckAway,1),:),2) $($+(12[10,$network,12:10,$chan,12:10,$nick,$iif($regml(CheckAway,2),12]10:,12])),2) $regml(CheckAway,2)
  38.     ;.notice $nick Nobody cares about your Away message: http://sackheads.org/~bnaylor/spew/away_msgs.html
  39.     ; Halt the message from the channel
  40.     haltdef
  41.   }
  42. }
  43.  
  44.  
  45. ; Moved this check down to an alias so I can expand to multiple regexs for better matching later.
  46. alias -l CheckForAway {
  47.   return $regex(CheckAway,$1-,/^is?(?:\x20am)?\x20(?:now\x20)?(away|back).?(?:\x20reason:?(?:\x20was:?)?|-)?\x20(.+)$/Si)
  48. }
  49.  
  50.  
  51. ; Moved this to it's own alias so I don't have to have it written twice.
  52. alias -l OpenWindow {
  53.   if (!$window(@AwayMessages)) {
  54.     window -xhnez @AwayMessages
  55.   }
  56. }
  57.  
  58.  
  59. ; Accidently unloaded a script and it took me a good 10 minutes to figure out
  60. ; which one was unloaded, Adding this to all the scripts to prevent this problem
  61. ; happening again in the future.
  62. on *:UNLOAD:{
  63.   if (!$window(@Script_Log)) {
  64.     window -nz @Script_Log
  65.   }
  66.   aline -ph @Script_Log Unloading: $script
  67. }

Comments