mIRC Home    About    Download    Register    News    Help

Print Thread
#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.

Joshy #213351 25/06/09 02:39 PM
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
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.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #213357 25/06/09 02:54 PM
Joined: Jun 2007
Posts: 933
5
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 }

5618 #213359 25/06/09 03:02 PM
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
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


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #213360 25/06/09 03:03 PM
Joined: Jun 2007
Posts: 933
5
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

Wims #213361 25/06/09 03:04 PM
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
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!


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
5618 #213362 25/06/09 03:12 PM
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
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
Wims #213364 25/06/09 03:18 PM
Joined: Jun 2007
Posts: 933
5
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.

5618 #213365 25/06/09 03:22 PM
Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

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.
RoCk #213366 25/06/09 03:29 PM
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
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.

Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
westor #213368 25/06/09 03:33 PM
Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

It works perfectly here.

5618 #213369 25/06/09 03:40 PM
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
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

Link Copied to Clipboard