Auto Nicknames Identify System — File Browser

AutoNicknamesIdentifySystemv1.0 / AutoNicknamesIdentifySystemv1.0 / autoidentify.mrc

autoidentify.mrc — 3.54 KB — Download this file

dialog autoidentify {
  title "Auto Nickname Identify"
  size -1 -1 187 89
  option dbu
  list 1, 1 15 182 60, size
  button "Add", 2, 2 3 19 11
  button "Del", 3, 22 3 19 11
  button "Ok", 4, 163 76 19 11, ok
  button "Help", 5, 144 76 19 11
  check "Hide Passwords", 6, 46 4 50 10
  check "enable", 7, 2 76 50 10
}


on *:dialog:autoidentify:init:0:{
  dll $+(",$scriptdirmdx.dll,") SetMircVersion $version | dll $+(",$scriptdirmdx.dll,") MarkDialog $dname
  dll $+(",$scriptdirmdx.dll,") SetControlMDX $dname 1 ListView report grid rowselect showsel single checkboxes > [ $scriptdirviews.mdx ]
  did -i $dname 1 1 headerdims 100 90 100 130
  did -i $dname 1 1 headertext Nick $chr(9) Password $chr(9) Network $chr(9) Command
  ai.load.list
  if ($group(#autoidentify) == on) { did -c $dname 7 }
  if (%ai.hide.pass == on) { did -c $dname 6 }
}
alias -l w_ai { writeini $scriptdirNetworks/ $+ $1 $+ .ini $2 $3 $4 }
alias -l r_ai { return $readini($scriptdirNetworks/ $+ $1 $+ .ini,$2,$3) }

alias -l ai.load.list {
  did -r autoidentify 1
  var %i = 1
  while ($findfile($scriptdirNetworks,*.ini,%i)) {
    var %z = 1
    while ($ini($findfile($scriptdirNetworks,*.ini,%i),%z)) { 
      var %ifmatch = $ifmatch
      var %pass = $r_ai($remove($nopath($findfile($scriptdirNetworks,*.ini,%i)),.ini),$ifmatch,Password)
      var %command = $r_ai($remove($nopath($findfile($scriptdirNetworks,*.ini,%i)),.ini),$ifmatch,Command)     
      did -a $dname 1 0 0 0 $iif($r_ai($remove($nopath($findfile($scriptdirNetworks,*.ini,%i)),.ini),$ifmatch,status) == on,2,1) %ifmatch $chr(9) $iif(%ai.hide.pass == on,$replace(%pass,%pass,$str(*,$len(%pass))),%pass) $chr(9) $remove($nopath($findfile($scriptdirNetworks,*.ini,%i)),.ini) $chr(9) %command

      inc %z
    }
    inc %i
  }
}
on *:dialog:autoidentify:sclick:*:{
  if ($did == 2) {
    var %nick $$?="nickname"
    var %pass $?="password "
    var %net $$?="network name (e.g DalNet)"
    var %com $$?="command for identify"
    writeini $scriptdirNetworks/ $+ %net $+ .ini %nick password %pass
    writeini $scriptdirNetworks/ $+ %net $+ .ini %nick command %com
    writeini $scriptdirNetworks/ $+ %net $+ .ini %nick status on
    did -a $dname 1 0 0 0 2 %nick $chr(9) %pass $chr(9) %net $chr(9) %com
  }
  if ($did == 3 && $did(1).sel != $null) {
    tokenize 32 $did(1).seltext
    remini $scriptdirNetworks\ $+ $16 $+ .ini $6
    did -d $dname 1 $did(1).sel
  }
  if ($did == 4) { ai.update.list }
  if ($did == 5) { run $scriptdirAI-Readme.txt }
  if ($did == 6) { set %ai.hide.pass $iif($did(6).state == 1,on,off) | ai.load.list }
  if ($did == 7) { $iif($did(7).state == 1,.enable,.disable) #autoidentify }
}
alias -l ai.update.list {
  var %i = 2
  while ($did(autoidentify,1,%i)) {
    if ($gettok($did(autoidentify,1,%i),5,32) == 2) { 
      $w_ai( $+ $gettok($did(autoidentify,1,%i),16,32) $+ , $+ $gettok($did(autoidentify,1,%i),6,32) $+ ,Status,on)
    }
    else { $w_ai( $+ $gettok($did(autoidentify,1,%i),16,32) $+ , $+ $gettok($did(autoidentify,1,%i),6,32) $+ ,Status,off) }
    inc %i
  }
}
#autoidentify on
on *:notice:*identify*:?:{ 
  if ($nick == Nickserv && $r_ai($network,$me,status) == on) {
    $r_ai($network,$me,command) $r_ai($network,$me,password)
  }
}
#autoidentify end
menu channel,menubar,status {
  auto identify:/ai
}
on *:unload: unset %ai.hide.pass
on *:load: mkdir $+(",$scriptdir,Networks,") | echo -s Loaded Successfuly Auto Nickname Identify By Youthanasia
alias ai { $iif($dialog(autoidentify.title) == $null,dialog -m autoidentify autoidentify) }