mIRC Home    About    Download    Register    News    Help

Print Thread
#258598 01/08/16 11:51 PM
Joined: Dec 2010
Posts: 11
Z
Ztjuh Offline OP
Pikka bird
OP Offline
Pikka bird
Z
Joined: Dec 2010
Posts: 11
I don't want to auto-join some channels on invite, so i wrote the code below but it ain't halting, it's joining the channel, is this a bug, or is it impossible what I want?

Code:
/ajinvite on

on *:INVITE:#:{
  if ($chan == #thisisatest) halt
}


Windows 10
mIRC 7.45

Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
You need to use the ^ event prefix to indicate to mIRC the event must be triggered before mIRC's own behavior is applied for that event, without it, the event is triggered after mIRC already sent /join, basically.

Code:
on ^*:invite:#:{


Edit: even with that prefix, it does not prevent the joining of the channel if you have mIRC set to autojoin channel when invited, maybe that would be a bug.

Last edited by Wims; 02/08/16 01:07 AM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2015
Posts: 148
Vogon poet
Offline
Vogon poet
Joined: Dec 2015
Posts: 148
I'd say it's a bug, but you can easily fix it by reversing your code. Turn /ajinvite off and use invite event to decide which channels you want to join automatically.

Code:
on *:invite:#: {
  if ($istok(#MyChannel #YourChannel #TheirChannel #SomeChannel,#,32)) join -n #
}



EDIT:
Just because I forgot to mention, it's possible to do it the other way around too. Instead of listing the channels you want to join automatically, you can list the channels you don't want to join automatically. All you need to do is to add "!" in front of the $istok:
Code:
on *:invite:#: {
  if (!$istok(#MyChannel #YourChannel #TheirChannel #SomeChannel,#,32)) join -n #
}


Last edited by Dazuz; 02/08/16 07:42 AM.
Joined: Dec 2010
Posts: 11
Z
Ztjuh Offline OP
Pikka bird
OP Offline
Pikka bird
Z
Joined: Dec 2010
Posts: 11
Doesn't work for me, I updated to 7.46 today, same results.

Joined: Dec 2015
Posts: 148
Vogon poet
Offline
Vogon poet
Joined: Dec 2015
Posts: 148
You must turn mIRC's own autojoin setting off (/ajinvite off) and let the script take over.

Joined: Dec 2010
Posts: 11
Z
Ztjuh Offline OP
Pikka bird
OP Offline
Pikka bird
Z
Joined: Dec 2010
Posts: 11
Thanks you very much!


Link Copied to Clipboard