Ignore AMSG

By GuybrushThreepwood on Aug 09, 2010

Just a small piece of code to stop those annoying amsgs from highlighting every channel on your list. It will display in one channel, and then tell you which channels the comment amsg'd in a second later.

on ^*:text:*:#:{
  if ( % [ $+ [ $nick ] ] ) {
    set %tempchan $gettok( % [ $+ [ $nick ] ], 1, 32)
    set %temptext $deltok( % [ $+ [ $nick ] ], 1, 32)
    if ($1- == %temptext) {
      % [ $+ [ $nick $+ comb ] ] = % [ $+ [ $nick $+ comb ] ] #
      haltdef
    }
  }
  else {
    % [ $+ [ $nick ] ] = # $1-
    % [ $+ [ $nick $+ comb ] ] = 
    .timer 1 1 unamsg $nick
  }

}

Alias Unamsg {
  if ( % [ $+ [ $$1 $+ comb ] ] != $null ) echo $gettok( % [ $+ [ $$1 ] ], 1, 32) $$1 $+ 's amsg also posted in: % [ $+ [ $$1 $+ comb ] ]
  unset % [ $+ [ $$1 ] ]
  unset % [ $+ [ $$1 $+ comb ] ]
}

Comments

Sign in to comment.
Gummo   -  Aug 09, 2010

The global variables are stored in the RAM but are constantly written to the disk also, whereas hash tables are only in the RAM until you want to manually save/load data from/to them.

 Respond  
GuybrushThreepwood   -  Aug 09, 2010

You're saying I shoud use hash tables in the same way I'm using variables now?

 Respond  
gooshie   -  Aug 09, 2010

Global/set variables being set and unset for every channel message is a bad idea. Too many disk writes, really bad news on an SSD. This would be better done using hash.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.