Auto Ghost

By sk68 on Jul 02, 2010

Allows you to protect nicks you have registered by being used by others, using NickServ's GHOST command. They don't even have to be in any channels with you!

Some Known Issues
Only allows 1 password per network
Doesn't support being connected to the same network multiple times
Very limited control

#autoghost off
on *:connect:{ if (%protectnicks. [ $+ [ $network ] ]) {
    .timeraghost [ $+ [ $network ] ] 0 5 .ison $v1
  }
}

raw 303:*:{ haltdef
  if ($remove($2-,:)) { 
    var %n $numtok($2-,32)
    while (%n > 0) { 
      if ($gettok($remove($2-,:),%n,32) != $me && %nspass. [ $+ [ $network ] ]) { .msg nickserv ghost $gettok($remove($2-,:),%n,32) %nspass. [ $+ [ $network ] ] }
      dec %n
    }
  }
}
#autoghost end
on *:LOAD:{ dialog -m aghostoptions aghostoptions }
menu * {
  Auto Ghost
  .$iif($group(#autoghost) == on,$style(2)) On:aghost on
  .$iif($group(#autoghost) == off,$style(2)) Off:aghost off
  .Options:dialog $iif($dialog(aghostoptions),-v,-m) aghostoptions aghostoptions
}

alias -l aghost { if ($1 == on) { 
    .enable #autoghost
    var %n $scon(0)
    while (%n) { scon %n 
      .timeraghost [ $+ [ $network ] ] 0 5 .ison %protectnicks. [ $+ [ $network ] ]
      dec %n
    }
    echo $color(info) -at *** Auto Ghosting enabled
    echo $color(info) -at *** Anyone using your protected nicks WILL be ghosted
  }
  elseif ($1 == off) {
    .timeraghost* off
    .disable #autoghost
    echo $color(info) -at *** Auto Ghosting disabled
  }
}

dialog -l aghostoptions {
  title "Auto Ghost Options"
  size -1 -1 87 149
  option dbu
  combo 1, 14 59 60 50, size drop
  text "Network", 2, 6 48 20 8
  text "Password", 3, 6 101 25 8
  edit "", 4, 13 113 61 10, pass autohs
  text "Protected Nicks", 5, 6 74 37 8
  edit "", 6, 14 87 60 10, autohs
  radio "On", 7, 14 10 50 10
  radio "Off", 8, 14 21 50 10, group
  button "Save", 9, 5 136 37 12, ok
  button "Close", 10, 44 136 37 12, cancel
}
on *:DIALOG:aghostoptions:INIT:0:{ 
  var %n $scon(0)
  while (%n) {
    did -a $dname 1 $scon(%n).network
    dec %n
  }
  did -c $dname $iif($group(#autoghost) == on,7,8)
}

on *:DIALOG:aghostoptions:SCLICK:1:{ 
  did -r $dname 6
  did -a $dname 6 %protectnicks. [ $+ [ $did(1) ] ]
} 

on *:DIALOG:aghostoptions:SCLICK:9:{ haltdef
  if ($did(1)) set %protectnicks. [ $+ [ $did(1) ] ] $did(6)
  if ($did(4)) set %nspass. [ $+ [ $did(1) ] ] $did(4)
  if ($did(7).state && $group(#autoghost) == off) { aghost on }
  elseif ($did(8).state && $group(#autoghost) == on) { aghost off }
  dialog -x $dname
}

Comments

Sign in to comment.
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.