Previously Known As Reporter

By Jethro on Oct 29, 2011

This script will record the previous nicknames a user has used when he or she makes a nickname change.

The self-trigger is:

/previous NickHere

The on text trigger is:

!previous NickHere

Please note that the script will not respond if a nickname hasn't changed his or her nickname.

raw 315:*: halt
on *:join:#: who #
on *:quit: psave $address($nick,2)
on *:part:#: psave $address($nick,2)
alias -l psave hadd -m pnick $1 $ial($1).mark
on *:exit: if ($hget(pnick)) hsave pnick pnick
alias previous { 
  if ($ial($1).mark) $iif($isid,return,echo -aegt) $1 was previously known as: $&
    $replace($ial($1).mark,$chr(32),$+($chr(44),$chr(32))) | halt
}
on *:text:$($iif(!previous* iswm $strip($1),$1)):*:{
  .msg $iif(#,#,$nick) $iif(!$strip($2),$nick $+ $chr(44) Syntax: $&
    !previous <nick>,$previous($strip($2)))
}
on *:nick: .ialmark $newnick $addtok($ial($newnick).mark,$nick,32)
on *:start:{
  if (!$hget(pnick)) && ($file(pnick).shortfn) hmake pnick 100 | hload pnick pnick
}
raw 352:*:{
  if ($hfind(pnick,$+(*!*@,$4),1,n)) .ialmark $ial($v1).nick $hget(pnick,$v1) | halt
}

Comments

Sign in to comment.
WorldDMT   -  Nov 05, 2011

ah ok
i didnt read all posts

 Respond  
extremity   -  Nov 03, 2011

It used to be WorldDMT.. read above

:P I was actually using on me:*:join:#:{ but changed it to the regular join event, because the $ial().mark becomes empty when a user hops. Perhaps I have thought wrong in the process of making the script.

 Respond  
Frenetic   -  Nov 03, 2011

Nice snippet :)
And worldGMT, perhaps.

 Respond  
WorldDMT   -  Nov 03, 2011

hey

i think on :join:#: who # should be on me::join:#: who #

 Respond  
Jethro   -  Nov 03, 2011

Thank you, FordLawnmower. I'll incorporate your example into the snippet when I get around to it, along with the credit due to you.

 Respond  
FordLawnmower   -  Nov 03, 2011

Doesn't the use of "ialmark" here conflict with your realname script ?
I use ialmark a lot in my personal scripts and I've found it much easier to manage storing items in their own field using a delimiter. ie. realname=fred | access=friend | nicknames=fred joe ted bill | etc.
Here is a basic alias that checks for an item= and edits or creates it using =value. This uses ascii 01 as a delimiter, but this is just an example.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Usage /ialmark_ nickname item value(s) go here.
;Or $ialmark_(nickname, item) <--Will return the value of item if it exists.
alias ialmark_ {
  var %item $2
  if ($isid) {
    if ($regex($ial($1).mark,/ $+ %item $+ =([^\x01]*)/i)) return $regml(1)
  }
  else {
    var %value $3-
    if (!$regex($ial($1).mark,/ $+ %item $+ =[^\x01]*/i)) {
      .ialmark $1 $addtok($ial($1).mark,$+(%item,=,%value),1)
    }
    else {
      .ialmark $1 $regsubex($ial($1).mark,/( $+ %item $+ =[^\x01]*)/i,$+(%item,=,%value))
    }
  }
}

I find it much easier to manage this way. I'm sure there are many other ways to manage ialmark so it can be used by multiple scripts.

 Respond  
Jethro   -  Nov 02, 2011

If I'm going to add a basic flood protection as I always do, it'll shut Dean's pie hole.

 Respond  
Jethro   -  Nov 02, 2011

I'm gonna update the script later. What you have mentioned has already been said by wims, and I don't really need your harsh tone to bark at me.

 Respond  
Jethro   -  Nov 02, 2011

I was mystified myself when I debugged my code without halt and received this error in the status:> * /msg: insufficient parametersWIth halt, the error disappears.

 Respond  
Wims   -  Nov 02, 2011

"Without the halt command, it will generate an error if someone checks a fictional nickname. The halt actually helps it."
I don't see how, there's an if statement, if a non existing nick is given, the if shouldn't be true :/

 Respond  
Jethro   -  Nov 02, 2011

-you don't need to halt in the previous alias, why are you halting there?Without the halt command, it will generate an error if someone checks a fictional nickname. The halt actually helps it.> -on :join:#: who # < if a netsplit occurs, everyone using your code will be disconnected if used on some big channels, you should /who when $nick == $me only, and otherwise store the information:P I was actually using on me::join:#:{ but changed it to the regular join event, because the $ial().mark becomes empty when a user hops. Perhaps I have thought wrong in the process of making the script.

Thanks for your suggestion. I'll surely take it under consideration and make the snippet better later.

 Respond  
Wims   -  Nov 02, 2011

Some way to improve this:
-you should use $wildsite inside events instead of $address($nick,2)
-you shouldn't halt the raws everytime, i don't want your script to disable any message.
-$hfind is slow, here $hfind(pnick,$+(!@,$4),1,n) is simply $hget(pnick,$+(!@,$4)) but i would remove that condition and add to the table every information from the /who, because actually it's not really storing every possible information (you are not using on text either to store information about the nick talking), i think you should
-the on start event has a problem, it /hload everytime, whatever if the table exists and whatever if the file exists
-you don't need to halt in the previous alias, why are you halting there?
-on *:join:#: who # < if a netsplit occurs, everyone using your code will be disconnected if used on some big channels, you should /who when $nick == $me only, and otherwise store the information

 Respond  
xdesoto   -  Nov 02, 2011

loLLL

 Respond  
Jethro   -  Nov 02, 2011

I updated the script and eliminated the error Dean has reported. But unfortunately I felt disrespected by his comment so I had to delete his post.

 Respond  
Jethro   -  Nov 02, 2011

Thank you, xdesoto.

 Respond  
xdesoto   -  Nov 02, 2011

Nice Jethro.

 Respond  
IllogicTC   -  Oct 31, 2011

Could be useful for me, there's a server I frequent where people do a lot of /nicking x.x

 Respond  
Jethro   -  Oct 29, 2011

extremity, you can modify the snippet to hsave the data right after hadd. That way, you know it's saved every time a data is added to the hash table.

Thanks for the rating and likes.

 Respond  
extremity   -  Oct 29, 2011

oh and nice snippet for a nicklogger..

 Respond  
extremity   -  Oct 29, 2011

only downside with hash saving on exit or part is if your computer or mirc crashes.. you lose all your data..

it is more resource hogging, but i save important hashes on a timer or on every update..

 Respond  
MashhitDK   -  Oct 29, 2011

Nicely nicely... I like \o/

 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.