Self Updating Auto-Join list

By sk68 on Aug 26, 2009

Pretty self explanatory, an auto-join list that updates itself, any channel you join will be added to your auto-join list, any chan you part will be removed, if you are banned from a chan on your auto-join list it SHOULD be removed, this may not work as different servers use different raw codes(its also possible I screwed up the raw event but blame the server first =D).

on *:JOIN:#:{ if ($nick == $me) {  if (%agetchans) && (!$istok(%ajoin. [ $+ [ $network ] ],$chan,44)) { 
      set %ajoin. [ $+ [ $network ] ] $addtok(%ajoin. [ $+ [ $network ] ],$chan,44) 
    } 
  } 
}
on *:PART:#:{ if ($nick == $me) { if (%agetchans) && ($istok(ajoin. [ $+ [ $network ] ],$chan,44)) { 
      set %ajoin. [ $+ [ $network ] ] $remtok(%ajoin. [ $+ [ $network ] ],$chan,44) 
    } 
  } 
}
raw 474:*: if ($istok(%ajoin. [ $+ [ $network ] ],$2,44)) set %ajoin. [ $+ [ $network ] ] $remtok(%ajoin. [ $+ [ $network ] ],$2,44)
on *:CONNECT: if (%ajoin. [ $+ [ $network ] ]) join %ajoin. [ $+ [ $network ] ]
menu channel { 
  Auto-Join
  .Auto Get channels
  ..$iif(%agetchans,$style(1)) On: set %agetchans 1
  ..$iif(!%agetchans,$style(1)) Off: unset %agetchans
  .Manual Control
  ..$iif(!%ajoin. [ $+ [ $network ] ],$style(2)) Clear $network channels: unset %ajoin [ $+ [ $network ] ]
  ..$iif($istok(%ajoin. [ $+ [ $network ] ],$chan,44),$style(2)) Add $chan to Auto-Join list: set %ajoin. [ $+ [ $network ] ] $addtok(%ajoin. [ $+ [ $network ] ],$chan,44)
  ..$iif(!$istok(%ajoin. [ $+ [ $network ] ],$chan,44),$style(2)) Delete $chan from Auto-Join list: set %ajoin. [ $+ [ $network ] ] $remtok(%ajoin. [ $+ [ $network ] ],$chan,44)
}
on *:LOAD:{ set %yn $?!="Add current channels to Auto-Join list?"
  if (%yn) { 
    var %server = $scon(0)
    while (%server) { scon %server
      var %chan = $chan(0)
      while (%chan) { set %ajoin. [ $+ [ $network ] ] $addtok(%ajoin [ $+ [ $network ] ],$chan(%chan),44) 
        dec %chan
      }
      dec %server
    }
    unset %yn
  }
}

Comments

Sign in to comment.
sk68   -  Aug 28, 2009

thanks ^^

 Respond  
Testor   -  Aug 27, 2009

I like it :D!

 Respond  
sk68   -  Aug 27, 2009

...oops

fixed ^^

 Respond  
Phoenix-   -  Aug 27, 2009

This is mSL, not SQL.

 Respond  
sk68   -  Aug 27, 2009

feel free to comment ;D

 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.