This is actually a snippet from a much larger project called "XeroBot" im working on. However I couldn't find a bot autojoin system on here that suited my taste's specifically, So I decided to code my own, aswell as release it here for you guys to critique/user/whatever. Everything should function correctly, had to do a LITTLE butchering to it to make it stand alone, as the full snippet use's alot of custom functions/aliase's within it. Included a simple $logo alias, as that one is easily editable. Syntax is as follows:
!Ajoin
Example: "!ajoin add #Scripting" or "!ajoin del #Scripting"
Defined Parameters:
-- Add's a channel to the autojoin list
-- Deletes a channel from the autojoin list
-- List's all channels on the auto join list
-- Add's all channels to the autojoin list that the bot is currently on
-- Removes all channels from the autojoin list (Note: The bot will not /part channels when using the clear parameter, such as it will when using the parameter)
I might refine this a bit/add more options to it at another time, for this is just a small snippet from a much larger project, but just felt like sharing it with the community.
P.S: This is my first snippet ive publicly released in over a year. Feel special :P
;########################
;##--ADV Bot CTRL V.1--##
;##---By HeatedHeart---##
;##www.XeroCreative.com##
;########################
alias Logo { return 4X14è15r0ó4B15ø14t }
;#### Channel/Query Commands
;*** Channel Commands
on 8:TEXT:!ajoin*:#:{
if ($chr(35) isin $3) {
if ($2 == add) { set %AutoJoin $addtok(%Autojoin,$3,32) | .msg $chan 14added4 $3 14to AutoJoin $logo | .join $3 | .msg $3 Channel Added To AutoJoin $logo | halt }
}
if ($2 == del) {
if ($istok(%autojoin,$3,32) == $true) { set %AutoJoin $deltok(%autojoin,$findtok(%autojoin,$3,1,32),32) | .msg $chan 14deleted4 $3 14from AutoJoin $logo | .part $3 | halt }
if ($istok(%autojoin,$3,32) == $false) { .msg $chan 4 $3 14not found on AutoJoin $logo | halt }
}
if ($2 == list) {
var %x $numtok(%autojoin,32)
var %Loop 1
while (%Loop <= %x) {
.var %z $addtok(%z,$Gettok(%autojoin,%loop,32),32)
inc %loop
}
.msg $chan 14Number of Channels on AutoJoin:4 $numtok(%autojoin,32)
if (%x == 0) { halt }
else { .msg $chan 14 $+ %z
halt
}
}
if ($2 == cadd) {
var %x $chan(0)
var %Loop 1
while (%Loop <= %x) {
set %AutoJoin $addtok(%Autojoin,$chan(%loop),32)
var %z $addtok(%z,$chan(%loop),32)
inc %loop
}
.msg $chan 14Added All Current Channels to AutoJoin:4 %z 14Total:4 $chan(0)
halt
}
if ($2 == clear) {
var %z $numtok(%autojoin,32)
unset %autojoin | set %autojoin
.msg $Chan 14Cleared AutoJoin, Number of Channels Removed: %z $logo
halt
}
else { .msg $chan 14invalid syntax, please use:4 !ajoin 14<4add14/4del14/4list14/4cadd14/4clear14> <4#channel14> }
}
;####Events
;*** On Connect
on *:Connect: {
var %x $numtok(%autojoin,32)
var %Loop 1
while (%Loop <= %x) {
.join $Gettok(%autojoin,%loop,32)
inc %loop
}
}