This snippet is requested quite a bit. Use !join #channel to make the bot join your channel. !part #channel to make it part your channel. if the user leaves the control channel the bot leaves their channel. Op
s in the control chan can make it part joined channes and can ban it from joining channels. !banchan #channel !unban #channel Hope this helps people. Also, other than ops... only the person that made the bot join their channel can make it part their channel. Paste this in a .mrc file and load it. Or else you'll have to do /jc.start (no need to edit anything but the messages)
on *:start: {
jc.start
}
alias jc.start {
if ( %control.chan == $null ) {
set %control.chan $$?="Enter Your bot's Control Channel:"
}
join %control.chan
}
on *:text:*:%control.chan: {
if ( $1 == !join ) {
if ( $2 == $null ) {
.msg $chan $nick You must specify a Channel for me to join.
}
elseif ( $2 ischan ) {
.msg $chan $nick Sorry, I'm already on that Channel.
}
elseif ( $($+(%,banned.,$2),2) != $null ) {
.msg $chan $nick Sorry, I'm prevented from joining that Channel.
}
elseif ( $left($2,1) == $chr(35) ) || ( $left($2,1) == $chr(38) ) {
set $+(%,join.,$2) $nick
.join $2
}
}
if ( $1 == !part ) {
if ( $2 ischan ) && ( $nick == $($+(%,join.,$2),2) ) || ( $nick isop $chan ) {
.part $2 Part Requested by $nick
unset $+(%,join.,$2)
}
elseif ( $2 !ischan ) {
.msg $chan $nick I'm not Currently on that Channel.
}
elseif ( $nick != $($+(%,join.,$2),2) ) {
.msg $chan $nick Sorry. Only the nick that requested that I joined $2 can request that I part it. Requested by $($+(%,join.,$2),2)
}
elseif ( $2 == $null ) {
.msg $chan $nick Please Specify a Channel.
}
}
if ( $1 == !banchan ) {
if ( $nick isop $chan ) {
if ( $2 == $null ) {
.msg $chan $nick You must specify a Channel to ban.
}
elseif ( $($+(%,banned.,$2),2) == $null ) && ( $left($2,1) == $chr(35) ) || ( $left($2,1) == $chr(38) ) {
set $+(%,banned.,$2) banned
if ( $2 ischan ) {
.part $2 This channel has been banned from me joining.
}
}
elseif ( $($+(%,banned.,$2),2) != $null ) {
.msg $chan $nick $2 is already a banned channel.
}
}
}
if ( $1 == !unbanchan ) {
if ( $nick isop $chan ) {
if ( $2 == $null ) {
.msg $chan $nick You must specify a Channel to ban.
}
elseif ( $($+(%,banned.,$2),2) != $null ) {
.unset $+(%,banned.,$2)
.msg $chan $nick $2 has been Unabanned
}
elseif ( $($+(%,banned.,$2),2) == $null ) {
.msg $chan $nick $2 is not banned.
}
}
}
}
on *:part:%control.chan: {
var %x 1
while ( %x <= $var(%join.*,0) ) {
if ( $nick == $($var(%join.*,%x),2) ) {
.part $deltok($var(%join.*,%x),1,46) $($var(%join.*,%x),2) Parted my control Channel. You must be in it to keep this bot in your channel.
$($var(%join.*,%x))
}
inc %x
}
}
on *:QUIT: {
var %x 1
while ( %x <= $var(%join.*,0) ) {
if ( $nick == $($var(%join.*,%x),2) ) {
.part $deltok($var(%join.*,%x),1,46) $($var(%join.*,%x)) Quit my control Channel. You must be in it to keep this bot in your channel.
unset $($var(%join.*,%x))
}
inc %x
}
}
Hi, I have problems with the servers, the problem is the redirect ... It would need a command like this: !Go + nick + server ..... To redirect it to each channel
alias getConnection {
; Parameter $1 is the full IP address of a server Ex: 199.9.249.8
; Returns the server connection id that server IP is located.
var %numConnections = $scon(0)
var %serverIncrement = 1
; Which connection is the server located?
while (%serverIncrement <= %numConnections) {
if ($scon(%serverIncrement).$serverip == $1) {
return $scon( [ $+ [ %serverIncrement ] ] )
}
else {
inc %serverIncrement
}
}
}
raw REDIRECT:*:{
scid $getConnection($2) join -n $1
}
Images to better understand:
1_ http://i1135.photobucket.com/albums/m633/nexusfn/AYUDA1-1.jpg?t=1286595306
2_ http://i1135.photobucket.com/albums/m633/nexusfn/AYUDA2-1.jpg?t=1286595315
3_ http://i1135.photobucket.com/albums/m633/nexusfn/AYUDA3-1.jpg?t=1286595313