auto identify

By PuNkTuReD on Dec 26, 2008

auto identify dialog
can be used across multi servers

choose an event
fill in the network/nick/channel
then fill in the syntax

channel is there for identifying to chanserv like services
network and nick have to be filled in for any event

examples:

nickserv identify PASSWORD
chanserv identify #CHANNEL PASSWORD
Q@CServe.quakenet.org AUTH PuNkTuReD PASSWORD

when your dialog opens
your info will be listed like this example:

IrCQNet PuNkTuReD nickserv identify PASSWORD
IrCQNet PuNkTuReD #CHANNEL chanserv identify #CHANNEL PASSWORD
QuakeNet PuNkTuReD Q@CServe.quakenet.org AUTH PuNkTuReD PASSWORD

network nick channel syntax
or
network nick syntax

so do not include "msg" in your syntax
you can also use this for logging into vhosts/oper up etc

menu * {
  Auto Identify:dialog $iif($dialog(ai),-v,-dm) ai ai
}
dialog ai {
  title "Auto Identify"
  option dbu
  size -1 -1 200 130
  text "Syntax:", 1, 6 6 30 8
  edit "", 2, 5 20 190 10, autohs
  list 3, 5 60 190 50, hsbar, vsbar
  text "msg", 4, 5 105 190 8
  combo 5, 145 5 50 10, autohs drop sort
  button "Add Info", 6, 5 115 50 10
  edit "", 7, 5 45 50 10, autohs
  edit "", 8, 60 45 50 10, autohs
  edit "", 9, 115 45 50 10, autohs
  text "Network:", 10, 6 35 50 10
  text "Nick:", 11, 61 35 50 10
  text "Channel:", 12, 116 35 50 10
  text "Events:", 13, 120 6 20 8
  button "Del Info", 14, 60 115 50 10
}
on *:dialog:ai:*:*: {
  var %a = $dname, %b = $devent, %c = $did
  if (%b == init) { 
    loadevents
    .timer 1 1 loadconnectinfo
    .timer 1 2 loadjoininfo
    .timer 1 3 loadnickinfo
    .timer 1 4 did -z ai 3
  }
  if (%b == edit) { did -a ai 4 msg $did(ai,2) }
  if (%b == sclick) { 
    if (%c == 3) { did -ra ai 2 $did(ai,3).seltext }
    if (%c == 6) {
      if ($did(ai,5) == $null) { echo -a Please select an Event | halt }
      if ($did(ai,7) == $null) { echo -a Please input a network | halt }
      if ($did(ai,5) == On Connect) { 
        if ($did(ai,8) == $null) { echo -a Please input a Nick | halt } 
        else { write onconnect.txt $did(ai,7) $did(ai,8) $did(ai,2) }
      }
      if ($did(ai,5) == On Join) { 
        if ($did(ai,9) == $null) { echo -a Please input a Channel | halt }
        else { write onjoin.txt $did(ai,7) $did(ai,8) $did(ai,9) $did(ai,2) }
      }
      if ($did(ai,5) == On Nick) { 
        if ($did(ai,8) == $null) { echo -a Please input a Nick | halt } 
        else { write onnick.txt $did(ai,7) $did(ai,8) $did(ai,2) }
      }
      did -r ai 3
      .timer 1 1 loadconnectinfo
      .timer 1 2 loadjoininfo
      .timer 1 3 loadnickinfo
      .timer 1 4 did -z ai 3
    }
    if (%c == 14) {
      if ($did(ai,5) == $null) { echo -a Please select an Event | halt }
      if ($did(ai,3).seltext == $false) { echo -a Please select a line from the listbox to delete | halt }
      else { 
        write -ds $+ " $+ $did(ai,3).seltext $+ " $replace($did(ai,5).seltext,$chr(32),) $+ .txt 
        did -r ai 3
        .timer 1 1 loadconnectinfo
        .timer 1 2 loadjoininfo
        .timer 1 3 loadnickinfo
        .timer 1 4 did -z ai 3
      }
    }
  } 
}
on *:connect: { connectident }
on *:join:#: { 
  if ($nick == $me) { joinident }
}
on *:nick: { nickident }
alias connectident {
  var %a = 1
  var %b = $lines(onconnect.txt)
  while %a <= %b {
    if (($network == $gettok($read(onconnect.txt, %a),1,32)) && ($me == $gettok($read(onconnect.txt, %a),2,32))) { 
      msg $gettok($read(onconnect.txt, %a),3-,32) 
      inc %a
    }
    else { inc %a }
  } 
}
alias joinident {
  var %a = 1
  var %b = $lines(onjoin.txt)
  while %a <= %b {
    if (($network == $gettok($read(onjoin.txt, %a),1,32)) && ($me == $gettok($read(onjoin.txt, %a),2,32)) && ($chan == $gettok($read(onjoin.txt, %a),3,32))) { 
      msg $gettok($read(onjoin.txt, %a),4-,32)
      inc %a
    }
    else { inc %a }
  } 
}
alias nickident {
  var %a = 1
  var %b = $lines(onnick.txt)
  while %a <= %b {
    if (($network == $gettok($read(onnick.txt, %a),1,32)) && ($newnick == $gettok($read(onnick.txt, %a),2,32))) { 
      msg $gettok($read(onnick.txt, %a),3-,32) 
      inc %a
    }
    else { inc %a }
  } 
}
alias loadevents {
  did -a ai 5 On Connect
  did -a ai 5 On Join
  did -a ai 5 On Nick
}
alias loadconnectinfo {
  var %a = 1
  var %b = $lines(onconnect.txt)
  did -a ai 3 . : On Connect : .
  while %a <= %b {
    did -a ai 3 $read(onconnect.txt, %a)
    inc %a
  } 
}
alias loadjoininfo {
  var %a = 1
  var %b = $lines(onjoin.txt)
  did -a ai 3 . : On Join : .
  while %a <= %b {
    did -a ai 3 $read(onjoin.txt, %a)
    inc %a
  } 
}
alias loadnickinfo {
  var %a = 1
  var %b = $lines(onnick.txt)
  did -a ai 3 . : On Nick : .
  while %a <= %b {
    did -a ai 3 $read(onnick.txt, %a)
    inc %a
  } 
}

Comments

Sign in to comment.
Aucun50   -  Dec 26, 2008

I'll i tested was that identifier and it works great good job.

 Respond  
Cheiron   -  Dec 26, 2008

dont look too bad that. sadly i cant test due to the engine i got here aka Kickchat$cript which has its own multiserver id thing. but i have used alot of your stuff so far and not come across anything majorly wrong :)

 Respond  
PuNkTuReD   -  Dec 26, 2008

http://www.hawkee.com/profile/img/2512/
updated:
added a del info button

lol dont know why i didnt earlier

 Respond  
Cheiron   -  Dec 26, 2008

any chance of a screenshot for a look at all?

 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.