!ajoin add/del for bot

Published  Jul 11, 2011
Updated  Jul 12, 2011

Description

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
       }
     }
   }
 }

Comments

Sign in to comment.
Stewie1k94   -  Feb 21, 2012

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.
    }
  }
}

?

 Respond  
Kentaro Kurosaki   -  Feb 21, 2012

Another fyi not all networks have /ns ajoin ;p

 Respond  
GeekShedboy123   -  Jul 23, 2011

ahh. thanks :)

 Respond  
TochA1551   -  Jul 23, 2011
if ($nick == GeekShedboy123) { 

for example

 Respond  
GeekShedboy123   -  Jul 23, 2011

Do u put my nick where Bot_owner_nick is? if so how should it look.

 Respond  
Lenooox   -  Jul 12, 2011

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
      }
    }
  }
}
 Respond  
Lenooox   -  Jul 12, 2011

hmm , you can add only one channel to ajoin list?

 Respond  
GeekShedboy123   -  Jul 12, 2011

hmm.. wont work for me...

 Respond  
PyThOn   -  Jul 11, 2011

Good intention TochA1551. :)

 Respond  
napa182   -  Jul 11, 2011

um TochA1551 these lil snippets of code are not really a script so maybe you should edit them as a snippet.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.