simple bnc add/remove user manager... nothing special :)
on *:load: {
echo -a $chr(91) $+ 12 $chr(248) $+ $chr(93) addon loaded
echo -a $chr(91) $+ 12 $chr(248) $+ $chr(93) enjoy ;)
}
alias bncmd {
set %blah are you using sbnc?
if ($dialog(bncmd)) { dialog -x bnc_ }
else {
set %bnc.type $iif($input(%blah,y,psybnc checker) == $true,1,0)
dialog -m bnc.mngr bnc.mngr
}
}
dialog bnc.mngr {
title "BNC Manager - by zexx0r"
size -1 -1 160 120
option dbu
box "", 1, 5 10 71 29
text "User", 2, 28 15 25 8, center
text "Ident", 3, 28 41 25 8, center
edit "", 4, 18 50 50 10
edit "", 5, 18 24 50 10
box "", 6, 5 37 71 28
text "Passwd", 7, 27 68 25 8, center
edit "", 8, 18 77 50 10
box "", 9, 5 63 71 28
combo 13, 94 18 49 70, size
box "List of users", 14, 90 10 57 81
button "Add User", 10, 8 98 46 13, default
button "Remove User", 11, 59 98 46 13, default
button "Close dialog", 12, 109 98 46 13, default
}
on *:dialog:bnc.mngr:*:*: {
if ( $devent == sclick ) {
if ( %bnc.type == 1 ) {
if ( $did == 10 ) {
did -a bnc_ 13 $did(5).text
set %bnc $didtok(bnc_,13,32)
msg -SBNC adduser $did(5).text $did(8).text
}
if ( $did == 11 ) {
msg -SBNC deluser $did(5).text
did -d bnc_ 13 $did(13).sel
}
if ( $did == 12 ) { dialog -x bnc_ }
}
else {
if ( $did == 10 ) {
did -a bnc_ 13 $did(5).text
set %bnc $didtok(bnc_,13,32)
adduser $did(4).text $+ : $+ $did(5).text
password $did(5).text $+ : $+ $did(8).text
}
if ( $did == 11 ) {
deluser $did(5).text
did -d bnc_ 13 $did(13).sel
}
if ( $did == 12 ) { dialog -x bnc_ }
}
}
}
on *:unload: {
echo -a $chr(91) $+ 12 $chr(248) $+ $chr(93) addon unloaded
echo -a $chr(91) $+ 12 $chr(248) $+ $chr(93) thanks for using ;)
}
I just realized you've already been taught about $iif's. Sorry.
Hey zexxor.
$iif's are basically the identifier for the "if-then-else" parts of a script.
How $iif works: $iif(question,action if statement is true,action if statement is false)
So let's say you have a variable called %test, which has a value of 1. (%test 1 in your variables tab)
$iif(%test = 1,msg $active true,msg $active false)
Because %test = 1, it messages the active channel 'true'.
If you have similar actions in both the true and false portions of the $iif, you can put it in front of the $iif.
So the above one can be re-written as:
msg $active $iif(%test = 1,true,false)
Basically, $iif can just substitute parts whether or not the question is true or false.
Also, you can perform no action if the statement is false so therefore you can put nothing into the third parameter of the $iif, but you MUST have a second parameter always. :)