mIRC Home    About    Download    Register    News    Help

Print Thread
#218085 01/02/10 06:16 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
In reference to a request on another help forum, I came up with two possible codes for what they wanted.
However, neither code works and it appears the reason they aren't working is that the $iil isn't being filled when the invite is issued.
Here are the two codes that I wrote, and maybe someone can show and explain how they can be made to work.
Code:
on @*:join:#:{
  if $iil($chan,$nick) {
    .mode $chan +v $nick
  }
} 


Code:
on @*:join:#:{
  var %a = $iil($chan,0)
  while %a {
    if $nick isin $iil($chan,%a) {
      .mode $chan +v $nick
      %a = 0
    }
    dec %a
  }
} 


or maybe someone has an alternative suggestion.

The original request was for a script to voice bots/clients that are invited to the channel, but just the one's that are invited.

RusselB #218091 01/02/10 11:27 AM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
The $iil is not filled on invite, it's a set of masks for this chan and managed with chanmode I (to override chanmode i for all matching users - it works analogue to the banlist and mode b). This implies you also have to make sure your iil is up to date (like a "/mode # +b"-request to fill one's $ibl).
Something like:
Code:
on @*:join:#:{
  if ($chan($chan).iil == $true) {
    var %a = 1
    while ($iil($chan,%a)) {
      if ($v1 iswm $fulladdress) {
        .mode $chan +v $nick
        break
      }
      else { inc %a }
    }
  }
  ; else issue a /mode $chan +I
  ; and maybe haltdef the raw-replies; and maybe add a flood protection in case you're on many channels...
  ; - alike to the infamous mass-who scripts to have a up-to-date $ial
}

If you want to voice *all* invited users (maybe the userlevel required to issue invites had been limited in chanserv to prevent abuse), you have to capture and store the invites itself (you should get a notice about the invite - e.g. a small hash table containing $cid, $chan and $nick of invited users), then use this dataset to check all the joining users.

Last edited by Horstl; 01/02/10 11:36 AM.

Link Copied to Clipboard