Paste in Remote
;==============================
;======= Auto Joiner ========
;==============================
;======= by Cyber Lord =======
;===============================
;======= All Rights Reserved ======
;===============================
;==========|| 2008 ||===========
;===============================
; Once loaded, type /ajoin to display the dialog
alias ajoin { dialog -m ajoin ajoin }
dialog ajoin {
size -1 -1 150 105
title "Auto Joiner - Cyber Lord"
option dbu
list 1, 5 5 70 100, sort
button "Add", 2, 80 5 30 10
button "Remove", 3, 115 5 30 10
text "Channel", 6, 80 23 65 10
edit "", 4, 80 30 65 10
text "Set Key", 7, 80 43 65 10
edit "", 5, 80 50 65 10
button "Done", 10, 88 70 50 10, OK
}
on *:DIALOG:ajoin:init:0: {
var %chan = 1, %key = 1
while (%chan <= $numtok(%auto.join,44)) { did -a ajoin 1 $gettok(%auto.join,%chan,44) | inc %chan }
while (%key <= $numtok(%auto.key,44)) { did -a ajoin 1 $gettok(%auto.key,%key,44) | inc %key }
}
on *:DIALOG:ajoin:sclick:2: { newchan }
on *:DIALOG:ajoin:sclick:3: {
if ($did(1).sel == $null) return | var %line = $did(1).sel, %text = $did(1,%line) | did -d ajoin 1 $did(1).sel
if ($numtok(%text,32) == 2) %auto.key = $remtok(%auto.key,%text,1,44) | else %auto.join = $remtok(%auto.join,%text,1,44)
}
on *:DIALOG:ajoin:sclick:10: { if (($dialog(ajoin).focus == 4) || ($dialog(ajoin).focus == 5)) { newchan | halt } }
alias newchan {
var %chan = $did(ajoin,4), %key | if (%chan == $null) return | if ($left(%chan,1) != $chr(35)) %chan = $chr(35) $+ %chan | if ($did(ajoin,5)) %key = %chan $did(ajoin,5)
if (%key) %auto.key = $addtok(%auto.key,%key,44) | else %auto.join = $addtok(%auto.join,%chan,44)
did -a ajoin 1 $iif(%key,%key,%chan) | did -r ajoin 4,5 | did -f ajoin 4
}
on *:CONNECT: { .raw JOIN %auto.join | var %temp = 1 | while (%temp <= $numtok(%auto.key,44)) { .raw JOIN $gettok(%auto.key,%temp,44) | inc %temp } }
Menu * {
Auto Join
.Set:/ajoin
}