|
Joined: Mar 2009
Posts: 28
Ameglian cow
|
OP
Ameglian cow
Joined: Mar 2009
Posts: 28 |
Hi, I'm looking for a script that if someone says !join #channel it will automatically join that channel.
EXAMPLE _______________________________________________________ User: !join #mychannel Bot: I have joined #mychannel. _______________________________________________________
Thanks.
|
|
|
|
Joined: Jul 2006
Posts: 4,193
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,193 |
on *:text:!join &:#:join #$2 | msg $chan I have joined #$2 User can even omit the # character in front of the channel name
Last edited by Wims; 25/06/09 02:39 PM.
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Jun 2007
Posts: 933
Hoopy frood
|
Hoopy frood
Joined: Jun 2007
Posts: 933 |
Probably a slight improvement (because there are always trolls out there): on *:TEXT:!join &:#:{ join # $+ $gettok($$2,1,44) | msg $chan I have joined #$2 }
|
|
|
|
Joined: Jul 2006
Posts: 4,193
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,193 |
You seem to miss the point of #$2, depend on what the OP want but you're probably not improving anything with this $gettok
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Jun 2007
Posts: 933
Hoopy frood
|
Hoopy frood
Joined: Jun 2007
Posts: 933 |
You seem to miss the point of #$2, depend on what the OP want but you're probably not improving anything with this $gettok !join #help,0
|
|
|
|
Joined: Dec 2008
Posts: 1,515
Hoopy frood
|
Hoopy frood
Joined: Dec 2008
Posts: 1,515 |
Try using this :
ON *:TEXT:!join*:#mychan: {
if ($nick isop $chan) {
if (!$2) { msg $chan Error: Wrong syntax, Try again using a channel name! (e.g: !join #channel) | halt }
if ($left($2,1) !== $chr(35)) { msg $chan Error: Wrong syntax, Try again using the $+ $chr(35) $+ character! (e.g: !join #channel) | halt }
if ($me ison $2) { msg $chan Error: I am already into the $+ $2 $+ channel! | halt }
join $2 | .ignore -u4 $nick
.timer 1 1 msg $chan Successfully joined into the $+ $2 $+ channel!
}
else { msg $chan Error: You must be an channel operator $+ $nick $+ to use the !join command! }
}
NOTE: The !join command can use it only an channel operator!
|
|
|
|
Joined: Jul 2006
Posts: 4,193
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,193 |
I could answer "!join 0,#help", but I think this have to be checked by the OP and it completely make #$2 useless since #chan,channel wont work for exemple
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Jun 2007
Posts: 933
Hoopy frood
|
Hoopy frood
Joined: Jun 2007
Posts: 933 |
Maybe you're missing the point?
Using #$2 in your script: !join test becomes /join #test !join #test becomes /join #test !join #test,0 becomes /join #test,0
Of course the last example will result in the bot parting all channels.
|
|
|
|
Joined: Dec 2002
Posts: 2,033
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,033 |
on *:TEXT:!join &:#: {
var %chan = $gettok($2,1,44)
if ($eval($+(%,joinchan.,%chan,.,#),2)) return
set -eu10 $+(%,joinchan.,%chan,.,#) $true
join %chan
}
on ME:*:JOIN:#: {
var %chans = $right($var($+(%,joinchan.,#,.*),1),-1)
if (%chans) {
msg $gettok(%chans,3,46) I have joined $gettok(%chans,2,46)
unset $+(%,$eval($+(%,chans),2))
}
}
Last edited by RoCk; 25/06/09 03:25 PM.
|
|
|
|
Joined: Dec 2008
Posts: 1,515
Hoopy frood
|
Hoopy frood
Joined: Dec 2008
Posts: 1,515 |
on *:TEXT:!join &:#: {
var %chan = $gettok($2,1,44)
if ($eval($+(%,joinchan.,%chan,.,#),2)) return
set -eu10 $+(%,joinchan.,%chan,.,#) $true
join %chan
}
on ME:*:JOIN:#: {
var %chans = $right($var($+(%,joinchan.,#,.*),1),-1)
if (%chans) {
msg $gettok(%chans,3,46) I have joined $gettok(%chans,2,46)
unset $+(%,$eval($+(%,chans),2))
}
}
I test this but nothing happen's!
Last edited by westor; 25/06/09 03:30 PM.
|
|
|
|
Joined: Dec 2002
Posts: 2,033
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,033 |
|
|
|
|
Joined: Jul 2006
Posts: 4,193
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,193 |
I did not write the script thinking it will be used for joining more than one channel
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
|