dialog autojoin {
title "Auto Join by Raider - (/autojoin)"
size -1 -1 130 190
option dbu
box "Auto join list", 1, 5 5 120 180
list 2, 60 15 60 165, sort size hsbar vsbar
button "Add", 3, 20 30 37 12
edit "#", 4, 8 15 50 10
button "Delete", 5, 20 50 37 12
}
alias autojoin { dialog -m autojoin autojoin }
on *:dialog:autojoin:sclick:3:{
if ( $did($dname,4) != $null ) { write autojoin.astf $did($dname,4) | inc %ajc 1 | did -a autojoin 2 $did($dname,4) | did -r autojoin 4 }
else { echo -a 14[414] Error: Not enough parameters | splay %error }
}
on *:dialog:autojoin:init:*:{
var %num 1
while ( %num <= %ajc ) {
did -a autojoin 2 $read(autojoin.astf, %num )
inc %num
}
}
on *:dialog:autojoin:sclick:5:{
if ( $did($dname,2).sel == 0 ) {
echo -a 14[414] Error: You must select a channel from the list
}
else {
did -d autojoin 2 $did(autojoin,2).sel
write -dl $+ $did($dname,2).sel autojoin.astf
dec %ajc 1
}
}
on *:Connect:{
if ( $read(autojoin.astf,1) != $null ) {
if ( $server == hub.krstarica.com ) {
echo -a 14[414] Info - Becouse of the rutine check on the server its nessesery to identify type /ns identify [password] then /aj.
}
else { aj }
}
else { echo -a 14[414] Remind: This Client supports auto join.there are no channels currently on the list to add type /addaj #channel or via dialog /autojoin
}
}
alias aj {
var %num1 1
while ( %num1 <= %ajc ) {
join $read(autojoin.astf, %num1 )
inc %num1
}
}
alias addaj {
write autojoin.astf $1
inc %ajc 1
}