Auto Identifiers

By xdesoto on Dec 15, 2011

Simple auto Identifier
just type /dialog -m Auto-Identifier Auto-Identifier
Or make yourself an alias.

dialog Auto-Identifier {
  title "Auto Identifier"
  size -1 -1 124 107
  option dbu
  edit "", 1, 6 8 50 10, autohs
  edit "", 2, 68 8 50 10, password autohs
  edit "", 3, 6 22 50 10, autohs
  edit "", 4, 68 22 50 10, password autohs
  edit "", 5, 6 36 50 10, autohs
  edit "", 6, 68 36 50 10, password autohs
  edit "", 7, 6 50 50 10, autohs
  edit "", 8, 68 50 50 10, password autohs
  edit "", 9, 6 64 50 10, autohs
  edit "", 10, 68 64 50 10, password autohs
  button "OK", 11, 23 92 37 12, ok
  button "Cancel", 12, 64 92 37 12, cancel
  box "Nicks", 13, 2 0 58 79
  box "Password", 14, 64 0 58 79
  check "Enable Auto-Identifier", 15, 30 80 64 10
}
on *:dialog:Auto-Identifier:sclick:11: {
  if ($did(1).edited == $true) hadd -m Settings Nick1 $did(1)
  if ($did(2).edited == $true)  hadd -m Settings Password1 $did(2)
  if ($did(3).edited == $true) hadd -m Settings Nick2 $did(3)
  if ($did(4).edited == $true)  hadd -m Settings Password2 $did(4)
  if ($did(5).edited == $true)  hadd -m Settings Nick3 $did(5)
  if ($did(6).edited == $true) hadd -m Settings Password3 $did(6)
  if ($did(7).edited == $true) hadd -m Settings Nick4 $did(7)
  if ($did(8).edited == $true) hadd -m Settings Password4 $did(8)
  if ($did(9).edited == $true) hadd -m Settings Nick5 $did(9)
  if ($did(10).edited == $true) hadd -m Settings Password5 $did(10)
  if ($did(15).state == 0) {
    hdel Settings nick1
    hdel Settings nick2
    hdel Settings nick3
    hdel Settings nick4
    hdel Settings nick5
    hdel Settings password1
    hdel Settings password2
    hdel Settings password3
    hdel Settings password4
    hdel Settings password5
  }
}
on *:dialog:Auto-Identifier:sclick:15: {
  if ($did(15).state == 0) {
    hadd -m Settings Auto-Identify no
    did -mr $dname 1,2,3,4,5,6,7,8,9,10
  }
  if ($did(15).state == 1) {
    hadd -m Settings Auto-Identify yes
    did -n $dname 1,2,3,4,5,6,7,8,9,10
    hsave -o Settings $c.dir(System,remotes,hashtable.txt)
  }
}
on *:dialog:Auto-Identifier:init:0: { 
  if ($hget(Settings,Auto-Identify) == yes) {
    did -c $dname 15
    did -a $dname 1 $hget(Settings,Nick1)
    did -a $dname 2 $hget(Settings,Password1)
    did -a $dname 3 $hget(Settings,Nick2)
    did -a $dname 4 $hget(Settings,Password2)
    did -a $dname 5 $hget(Settings,Nick3)
    did -a $dname 6 $hget(Settings,Password3)
    did -a $dname 7 $hget(Settings,Nick4)
    did -a $dname 8 $hget(Settings,Password4)
    did -a $dname 9 $hget(Settings,Nick5)
    did -a $dname 10 $hget(Settings,Password5)
  }
  if ($hget(Settings,Auto-Identify) == no) || ($hget(Settings,Auto-Identify) == $null) {
    did -m $dname 1,2,3,4,5,6,7,8,9,10
  }
}

Comments

Sign in to comment.
pball   -  Dec 16, 2011

One question, where the part that auto identifies you?

 Respond  
[85]   -  Dec 16, 2011

xdesoto good job...

 Respond  
Jethro   -  Dec 16, 2011

I'm sure you can shorten these parts quite a bit:

on *:dialog:Auto-Identifier:sclick:11:{
  var %i = 1
  while (%i <= 10) {
    if ($did( $+ %i $+ ).edited) {
      hadd -m settings $replace($replace(%i,1,nick1,2,password1,$&
        3,nick2,4,password2,5,nick3,6,password3,7,nick4,8,$&
        password4,9,nick5),nick10,password5) $did( $+ %i $+ )
      inc %i
    }
  }
  if ($did(15).state == 0) {
    hdel -w settings nick*
    hdel -w settings password*
  }
}
on *:dialog:Auto-Identifier:init:0:{
  did -c $dname
  var %i = 1
  while (%i <= 10) {
    did -a $dname %i $hget(settings,$replace($replace(%i,1,$&
      nick1,2,password1,3,nick2,4,password2,5,nick3,6,password3,7,$&
      nick4,8,password4,9,nick5),nick10,password5))
    inc %i
  }
  if ($hget(Settings,Auto-Identify)) {
    did -m $dname 1,2,3,4,5,6,7,8,9,10
  }
}
 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.