Undernet X login

By _dead on Jan 30, 2007

type /login

dialog login {
  title "Undernet X Login" 
  size -1 -1  293 11 
  option dbu 
  edit "", 3, 32 0 50 10, autohs center 
  edit "", 5, 116 0 100 10, pass autohs limit 40 center 
  text "Username:", 6, 3 1 27 8, center 
  text "Password:", 7, 86 1 28 8, center 
  button "Login", 8, 217 1 37 9, ok
  check "", 1, 256 2 8 8
  text "Auto Login", 2, 265 2 26 8
}
on *:dialog:login:sclick:*:{
  if ($did == 8) { .msg x@channels.undernet.org login $did(3) $did(5) | .mode $me +ix | .msg x info = $+ $me }
  if ($did == 1) { if (%autologin == on) { set %autologin off | .did -u login 1 | halt } | if (%autologin == off) { set %autologin on | .did -c login 1 | halt } }
}
on *:dialog:login:init:0: {
  if (%autologin == on) { .did -c login 1 } 
  if (%username) && (%pass) { .did -a login 3 %username | .did -a login 5 %pass }
}
on *:dialog:login:close:0: {
  if ($did(3)) && ($did(5)) {
    set %username $did(3)
    set %pass $did(5)
  }
}
on *:connect: {
  if (%autologin == on) %% (%username) && (%pass) { .msg x@chanels.undernet.org login %username %pass | .mode $me +ix }
}
alias login if (!$dialog(login)) { dialog -m login login }

Comments

Sign in to comment.
DarthReven   -  Jan 30, 2007

Ok a few things here, thought the code works we don\'t have conditions if a user had more then one nick for them to auto login and halt\'s aren\'t REALLY needed in dialogs persay. Also rather then using 2 if statements just add an else and you won\'t have to put any conditions because \"if (%autologin == on)\" returns $false it will go directly to else

 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.