Use !ajoin add for add channel to ur bot ajoin list , use !ajoin del for delete channel.
Works only if bot owner will type it.
on *:text:!ajoin*:#: {
if ($nick == <bot_owner_nick>) {
if ($2 == add) {
msg $chan 8,12I add $chan to my ajoin list !
ns ajoin add $chan
}
elseif ($2 == del) {
msg $chan 8,12I deleted $chan from my ajoin list !
ns ajoin del $chan
}
}
}
========================
or
on *:TEXT:!ajoin*:#: {
if ($nick == <bot_owner_nick>) {
if ($2 == add) {
if ($istok(%auto.channels,$3,44)) {
}
else {
set %auto.channels $addtok(%auto.channels,$3,44)
msg $chan 8,12I add $3 to my ajoin list !
join $3
}
}
elseif ($2 == del) {
if ($istok(%auto.channels,$3,44)) {
set %auto.channels $remtok(%auto.channels,$3,44)
msg $chan 8,12I deleted $3 from my ajoin list !
part $3
}
}
}
}
Maybe something like:
on *:CONNECT:{
var %ajoin = 1
while (%ajoin <= $lines(ajoin.txt)) {
join $read(ajoin.txt, %ajoin)
inc %ajoin
}
}
on $*:Text:/^!ajoin\s(.*)/Si:#:{
if ($regex($nick($chan,$nick).pnick,/(!|@|&|~)/)) {
if ($2 == add) {
if ($read(ajoin.txt, w, $3)) msg $chan $3 is already on my ajoin list.
else write ajoin.txt $3 | msg $chan $3 added to my ajoin list
}
if ($2 == del) {
if (!$read(ajoin.txt, w, $3)) msg $chan 3 is not on my ajoin list to delete.
else write -ds $+ $3 ajoin.txt | msg $chan $3 removed from my ajoin list.
}
if ($2 == count) {
msg $chan I have $lines($read(ajoin.txt, w, $3)) channel's on my ajoin list.
}
}
}
?
i'm not sure , but try this :$ improve me if I'm wrong
on *:TEXT:!ajoin*:#: {
if ($nick == <bot_owner_nick>) {
if ($2 == add) {
if ($istok(%auto.channels,$3,44)) {
}
else {
set %auto.channels $addtok(%auto.channels,$3,44)
msg $chan 8,12I add $3 to my ajoin list !
join $3
}
}
elseif ($2 == del) {
if ($istok(%auto.channels,$3,44)) {
set %auto.channels $remtok(%auto.channels,$3,44)
msg $chan 8,12I deleted $3 from my ajoin list !
part $3
}
}
}
}