mIRC Homepage
Posted By: warrior69 Spy invited useres - 27/11/05 07:39 PM
Hi all!
I'm trying to make a code for users that join my channel with invite when they are banned.
I mean...if a user whithout access i my channel is in the ban list and someone of the @ invites him to join....i want the code to say... smthng like that:
Atention: $nick was invite by someone to join the channel.

Help me pls!
Posted By: RusselB Re: Spy invited useres - 27/11/05 10:48 PM
To my knowledge there's no way of determining if a person joined the channel from an invitation or by any one of several other methods (eg: double clicking the room name in the channel list)

Without a way of making that determination, then I don't see any way of completing your request.
Posted By: Kelder Re: Spy invited useres - 27/11/05 10:57 PM
Sometimes it's easier than you think...

Code:
on @*:JOIN:#yourchannel:{
  if ($fulladdress isban $chan) {
    msg $chan WARNING $nick is banned but invited anyways!
  }
}
Posted By: Armada Re: Spy invited useres - 29/11/05 12:36 PM
Quote:
Sometimes it's easier than you think...

Code:
on @*:JOIN:#yourchannel:{
  if ($fulladdress isban $chan) {
    msg $chan WARNING $nick is banned but invited anyways!
  }
}

That only works if the user is banned in the internal ban list
Quote:

isban if v1 is a banned address in internal ban list
Posted By: Kelder Re: Spy invited useres - 29/11/05 06:19 PM
/mode # b

So, what's the difference?

PS: irc opers can join channels even if they are banned/invite only, so this script might fail at such an occasion. Also if services like chanserv keep a banlist separate from the channel banlist, then those won't be detected, there's probably a /cs banlist command for those to parse...
Posted By: warrior69 Re: Spy invited useres - 30/11/05 08:11 PM
Ok thanks!!!It works
But...how about a timer in the code to see if e nick have access in the channel...???
Posted By: Kelder Re: Spy invited useres - 30/11/05 11:30 PM
I have no idea what you mean by access or how to check for that, if you can clarify I might be able to help...

Why would you need a timer? You can check when people join, their address won't change anymore, and if extra bans are placed, you can check when that ban is placed. However, if people join before their address is banned, they don't need to be invited.
Posted By: warrior69 Re: Spy invited useres - 01/12/05 07:25 PM
I mean if a nick has access like AOp VOp or Uop...he is able to invite himself so it's not necessary displaying that type of message.
I need the code to work for users without access in my channel...smth like that
Code:
on @*:JOIN:#yourchannel:{  if ($fulladdress isban $chan) && if($nick !isreg $chan) { 
msg $chan WARNING $nick is banned but invited anyways! 
 }
}

But this "if($nick !isreg $chan)" doesn't work when someone joins the channel...that's why im talking about a timer!I don't know how to add that timer in this code...
I hope you understand me...
Sorry 4 my english :tongue:
Posted By: Kelder Re: Spy invited useres - 02/12/05 12:46 PM
Code:
on @*:JOIN:#yourchannel:{
  if ($fulladdress isban $chan) {
    .timer 1 3 if ( $nick isreg $chan ) msg $chan WARNING $nick is banned but invited anyways! 
  }
}


This checks if the user is banned on join, and if he is, it sets a timer that waits 3 seconds and then checks if the nick is still a regular user and then sends the warning message. Note that if the server is laggy and the modechange is delayed this script can still show the warning message. If that happens often set the delay to 5 or 10 seconds...

ps: to combine multiple tests in a single if statement, you don't need an extra 'if':
if ((check1 == $1) && (check2 isin $2-)) { msg $chan stuff }
Also make sure there is a space after the word 'if' and before the (
You'll notice that I put extra spaces around the brackets for the if inside the timer statement. Those are required to let the $nick and $chan be processed immediately when the timer is set, so that everything is filled in. This is because $nick doesn't contain anything anymore 3 seconds later, $chan might contain something, but not necessarily the correct channel...
© mIRC Discussion Forums