My first dialog! :)
This snippet only works for the network Quakenet, and you must have a Q account (auth with Q).
Blitzjager taught me how to make dialogs yesterday, and helped construct this dialog (kudos to him).
Anyways, here it is:
on *:load:{ set %auth $?:"Please type in your Q auth." | set %authpass $?*:"Please type in your Q password." | noop $input(Done. Use /qauth to change settings if needed.,uwo,Notice) }
on *:connect: { if ($network == Quakenet) { .msg Q@CServe.quakenet.org AUTH %auth %authpass | mode $me +x } }
alias -l authchans { set %authchans $addtok(%authchan,$1,44) }
alias QAuth { dialog $iif($dialog(QAuth),-v,-m) QAuth QAuth }
menu * {
QAuth: QAuth
}
dialog QAuth {
title "QAuth"
size -1 -1 100 105
option dbu
text "Auth Name", 100, 36 2 26 10, nowrap
text "Auth Pass", 99, 36 22 26 10, nowrap
edit "", 1, 25 10 50 10, center autohs
edit "", 2, 25 30 50 10, center pass autohs
button "Okay!", 3, 0 93 50 10, ok
button "Cancel!", 4, 50 93 50 10, cancel
text "Channels", 98, 36 42 26 10, nowrap
button "Add", 5, 6 53 25 10
button "Remove", 6, 6 63 25 10
list 7, 35 50 55 35, sort vsbar
button "ClearAll", 8, 50 81 25 10
button "AuthNow", 9, 25 81 25 10
}
on *:dialog:QAuth:*:*: {
if ($devent == init) && ($did == 0) { did -a $dname 1 %auth | did -a $dname 2 %authpass | didtok $dname 7 44 %authchans }
if ($devent == sclick) {
if ($did == 3) { set %auth $did(1) | set %authpass $did(2) }
if ($did == 4) {
if ($did(1) != %auth || $did(2) != %authpass) {
var %authmod $?!="Do you want to save your changes?"
if (%authmod == $true) { set %auth $did(1) | set %authpass $did(2) }
}
dialog -x $dname $dname
}
if ($did == 5) { set %authchans $addtok(%authchans,$?="What channel would you like to add?",44) | did -r $dname 7 | didtok $dname 7 44 %authchans }
if ($did == 6) { set %authchans $remtok(%authchans,$did(7).seltext,1,44) | did -r $dname 7 | didtok $dname 7 44 %authchans }
if ($did == 8) { var %authmod $?!="Are you sure you want to clear everything?" | $iif(%authmod == $true,unset %auth %authpass %authchans) | dialog -x $dname $dname }
if ($did == 9) {
if ($address($me,4) == *!*@*.users.quakenet.org) { join %authchans }
if (!$server) { noop $input(You are not connected to Quakenet!,uwo,Error!) }
else { set %auth $did(1) | set %authpass $did(2) | .msg Q@CServe.quakenet.org AUTH %auth %authpass | mode $me +x }
}
}
}
raw 396:*:{ echo -a Mode +x set ( $+ $2 $+ ) | join %authchans }
big_boya said
how you work it? :P
When you load the script, it asks you for your Quakenet AuthName and Password; fill those in.
Type in 'QAuth' or right click a menu and hit 'QAuth' to open the dialog.
There, you can add or delete auto-join channels when you connect to Quakenet and mode +x.
Hit the button 'AuthNow!' to authenticate with Q and join the auto-join channels (if you already haven't joined so).