mIRC Home    About    Download    Register    News    Help

Print Thread
Help? #213349 25/06/09 01:49 PM
Joined: Mar 2009
Posts: 28
J
Joshy Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
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.

Re: Help? [Re: Joshy] #213351 25/06/09 02:39 PM
Joined: Jul 2006
Posts: 3,723
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,723
Code:
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.

Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Help? [Re: Wims] #213357 25/06/09 02:54 PM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Probably a slight improvement (because there are always trolls out there):
Code:
on *:TEXT:!join &:#:{ join # $+ $gettok($$2,1,44) | msg $chan I have joined #$2 }

Re: Help? [Re: 5618] #213359 25/06/09 03:02 PM
Joined: Jul 2006
Posts: 3,723
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,723
You seem to miss the point of #$2, depend on what the OP want but you're probably not improving anything with this $gettok smirk


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Help? [Re: Wims] #213360 25/06/09 03:03 PM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Originally Posted By: Wims
You seem to miss the point of #$2, depend on what the OP want but you're probably not improving anything with this $gettok smirk

!join #help,0

Re: Help? [Re: Wims] #213361 25/06/09 03:04 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
Try using this :

Code:
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!

Re: Help? [Re: 5618] #213362 25/06/09 03:12 PM
Joined: Jul 2006
Posts: 3,723
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,723
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


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Help? [Re: Wims] #213364 25/06/09 03:18 PM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
Offline
Hoopy frood
5
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.

Re: Help? [Re: 5618] #213365 25/06/09 03:22 PM
Joined: Dec 2002
Posts: 2,021
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,021

Code:

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.
Re: Help? [Re: RoCk] #213366 25/06/09 03:29 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
Code:

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.
Re: Help? [Re: westor] #213368 25/06/09 03:33 PM
Joined: Dec 2002
Posts: 2,021
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,021

It works perfectly here.

Re: Help? [Re: 5618] #213369 25/06/09 03:40 PM
Joined: Jul 2006
Posts: 3,723
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,723
I did not write the script thinking it will be used for joining more than one channel


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net