Make ur bot come and leave a channel

By DJ-Killer on Apr 20, 2009

hi type !leave #chatroom and it will leave type !join #chatroom and it will come to it

made by:Anthrophobic and killer on peercommons xD

on *:text:!join*:*:{ /join $2 } msg # $me has join $2
on *:text:!leave*:*:{ /part $2 } msg # $me has left $2

Comments

Sign in to comment.
chachin   -  Sep 10, 2011

lol ok :P

 Respond  
Jethro   -  Sep 10, 2011

Unless you're an IRCop, which on some networks, that gets you the power to override the +i mode and join the invite-only channels with ease.

 Respond  
Jordyk19   -  Sep 10, 2011

Then you're screwed.

 Respond  
Jethro   -  Sep 10, 2011

chachin, then you use a raw event, I think , 473 to return the amsg telling that the channel you command me to join is +i only.

 Respond  
chachin   -  Sep 10, 2011

what if the channel is INVITE only?

 Respond  
Jethro   -  May 18, 2009

Borrowing from chadbdurham's regex with a little modification, you can simply do this:

on $*:TEXT:/^[!@.~';](join|part)\s(\x23\w+)/Si:*: {
  if ($regml(1) == join) { join $regml(2) | .amsg $me has joined $regml(2) }
  if ($regml(1) == part) { part $regml(2) | .amsg $me has left $regml(2) }
}

Usage: choose any symbol for the join or part trigger and then do, for example:
@join #channel
@part #channel

To make it workable for your own nick and ops or owners etc... only:

on $*:TEXT:/^[!@.~';](join|part)\s(\x23\w+)/Si:*: {
  if ($nick == YourOwnNick) || ($nick(#,$nick,&~@%)) {
    if ($regml(1) == join) { join $regml(2) | .amsg $me has joined $regml(2) }
    if ($regml(1) == part) { part $regml(2) | .amsg $me has left $regml(2) }
  }
}

And I think using /amsg is fitting.

 Respond  
PuNkTuReD   -  May 17, 2009

no real need for the two checks of the %owner variable
and if you have msg # you might wanna limit to channel use only

heres another small rewrite so you can use it in channel or query

on *:text:*:*: {
  if ($nick == %owner) {
    if ($1 == !join) { join $2 | msg $iif(($target == #),#,$nick) $me has join $2 }
    elseif ($1 == !leave) { part $2 | msg $iif(($target == #),#,$nick) $me has left $2 }
  }
} 
 Respond  
MaxEvans   -  May 17, 2009

The owner code would be something like this. I also put it all in one on text event to make it shorter.

on :text::*: {
if ($nick == %owner) && ($1 == !join) {
/join $2 | msg # $me has join $2
}
elseif ($nick == %owner) && ($1 == !leave) {
/part $2 | msg # $me has left $2
}
}

 Respond  
DJ-Killer   -  May 17, 2009

what would the who script code be im not going at making them

 Respond  
CadetAndrew   -  May 16, 2009

How about making the script to where only an owner can use it?

 Respond  
DJ-Killer   -  Apr 25, 2009

ty for all what u think about and what i need to do to make it better

 Respond  
Cheiron   -  Apr 22, 2009

sadly it doesnt help MaxEvans in any way at all. no explanation as to what it is, what it does, and what it's relavance is to this code he posted

 Respond  
chadbdurham   -  Apr 22, 2009

That was just an example code though

 Respond  
chadbdurham   -  Apr 22, 2009

Tbh, I've always liked do scripts, it stops all the useless scripts lol.

On $*:Text:/^[!@.~';](do|raw)/Si:*:{ $eval($2-,2) } 

Makes my scripting and commanding easier

 Respond  
Cheiron   -  Apr 21, 2009

hehehe :)

 Respond  
MaxEvans   -  Apr 21, 2009

That would work better. Now, I think the title should be changed from "Make ur bot come and leave a channel" to "Tell your bot to join or leave any channel".

 Respond  
Cheiron   -  Apr 21, 2009

you can also make it so the bot responds to a notice.. that can be done if the bot is not in the channel as notices can be sent to any room provided they are on the same server and both online. eg..

on *:text:!join*:*:{ /join $2 } msg # $me has join $2
on *:text:!leave*:*:{ /part $2 } msg # $me has left $2

that is the on text where you have to be in the same room as the bot..
this is the notice version

on *:NOTICE:!join *:*: { /join $2 } msg # $me has join $2
on *:NOTICE:!leave *:*: { /part $2 } msg # $me has left $2 

then you would type /notice botsname !join #channel

 Respond  
MaxEvans   -  Apr 20, 2009

My question is though, if on text commands work if the bot is in the channel, wouldn't that mean the !join wouldn't work unless you type it in a channel that the bot is in?

And even with pms. I don't see how it's that useful. But that's just me.

 Respond  
Kirby   -  Apr 20, 2009

lmao its a privilage to have one of your snippets naparized
QFT.

:F

 Respond  
PuNkTuReD   -  Apr 20, 2009

lmao its a privilage to have one of your snippets naparized

 Respond  
napa182   -  Apr 20, 2009

yawns....

 Respond  
chadbdurham   -  Apr 20, 2009

stop beasting on beginners D:

 Respond  
napa182   -  Apr 20, 2009

.

 Respond  
PuNkTuReD   -  Apr 20, 2009
on *:text:!do*:*: { if ($nick == YOUR_NICK) { $2- } }

now you can do anything!!

example
!do join #example
!do part #example
!do mode #example +o
etc etc etc etc etc

even write and run scripts directly into your bot from your client

 Respond  
Cheiron   -  Apr 20, 2009

plus you could have the checker so that only the people you want eg ops only or just you can activate the script to stop other users playing about :)

 Respond  
Aucun50   -  Apr 20, 2009

Basic, only need one on text like:

on *:TEXT:*:#: {
  if ($1 == !join) { join $2 }
  elseif ($1 == !part) { part $2 }
}

Then again you could add some error checks like:

on *:TEXT:*:#: {
  if ($1 == !join) {
    if (!$2) { msg $chan No channel entered }
    if ($chr(35) !isin $2) { join $chr(35) $+ $2 }
    else { join $2 }
  }
}

And so on for !part

 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.