Auto-Ghoster

By Firstmate on Dec 07, 2008

This script can auto-ghost people who either join or change nicks to one that you own.
Syntax: /ghost <add/del> [pass]

If you're adding, you need the pass. If you're deleting one, you just need the nick.

Took me a long time to figure out how to use the $findtok, $gettok, and $remtok together, so please comment!

on !*:JOIN:#: {
  if ($istok(%Nicks,$nick,32)) {
    msg nickserv ghost $nick $gettok(%pass,$findtok(%Nicks,$nick,32),32)
  }
}
on !*:NICK: {
  if ($istok(%nicks,$newnick,32)) {
    msg nickserv ghost $newnick $gettok(%pass,$findtok(%Nicks,$newnick,32),32)
  }
}
alias ghost {
  if ($1 == add) {
    if (!$2 || !$3) { echo -a Please supply a nick and pass }
    elseif ($istok(%nicks,$2,32)) { echo -a Nick already in list }
    else { set %nicks $addtok($2,%nicks,32) | set %pass %pass $3 }
  }
  if ($1 == del) {
    if (!$2) { echo -a Please supply a nick }
    elseif (!$istok(%nicks,$2,32)) { echo -a Nick Not Found }
    else { set %pass $remtok(%pass,$gettok(%pass,$findtok(%Nicks,$2,32),32),1,32) | set %nicks $remtok(%nicks,$2,32) }
  }
  if ($1 == view) { 
    var %i = 1, %x = $numtok(%nicks,32), %p
    while (%i <= %x) {
      %p = %p (Nick: $gettok(%nicks,%1,32) Pass: $gettok(%pass,%1,32) $+ )
      inc %i
    }
    echo -a %p
  }
}

Comments

Sign in to comment.
Firstmate   -  Dec 08, 2008

Oh, I never knew that, thank you.

Updated b/c of MD's comment.

Anyone else? Hows the code?

 Respond  
guest598594   -  Dec 08, 2008

Rather than doing if ($address(nick,2) != $address($me,2)), you could just use ! in the event:

on !*:join:#:{ }
on !*:nick:#:{ }

(Makes it so it only triggers if the nick doing the event wasn't yourself)

 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.