mIRC Homepage
Posted By: Simo Add invite list with delay - 25/04/23 12:04 PM
greetings folks,

anyway we can have this small alias add invite list in the form of :

+IIIIII *!*@*some.host *!*@*some.host *!*@*some.host *!*@*some.host *!*@*some.host *!*@*some.host
+IIIIII *!*@*some.host *!*@*some.host *!*@*some.host *!*@*some.host *!*@*some.host *!*@*some.host
+IIIIII *!*@*some.host *!*@*some.host *!*@*some.host *!*@*some.host *!*@*some.host *!*@*some.host
+IIIIII *!*@*some.host *!*@*some.host *!*@*some.host *!*@*some.host *!*@*some.host *!*@*some.host

with a delay of lets say 10 seconds to prevent disconnection

i have an invite list with all the invited hosts stacked on top of eachother in a text file if thats the best way to do this

this is what i have so far :

Code

invitelist {
  var %a = 1, %b = $lines(invite-list-Gforce.txt)
  while (%a <= %b) {
    mode $1 +I  $gettok($read(invite-list-Gforce.txt, %a),1-,32) 
    inc %a
  }
}

Posted By: maroon Re: Add invite list with delay - 25/04/23 12:46 PM
is this at a network where you can't stack several modes together? like mode #channel +ooo nick1 nick2 nick3?

As far as exceeding the stackable limit, there should be plenty of scripts that use a @queue window which interacts with a timer to 'do whatever' at spaced apart intervals.

Also, you can enable 'own commands' in flood controls which should limit how fast it spams the server with these?
Posted By: Epic Re: Add invite list with delay - 25/04/23 03:08 PM
If I understand your request correctly, you can try using this script:
Code
alias invitelist {
  if (!$1) { echo Correct command:12 /invitelist #channel | halt }
  var %file invite-list-Gforce.txt, %lines $lines(%file)
  var %i 1, %n 1, %limit 5, %sec 0, %delay 10
  while (%i <= %lines) {
    %str = %str $+(*!*@,$read(%file,nt,%i))
    if (%n == %limit) || (%i == %lines) { 
      $+(.timer,INVITE,%i,$r(a,z)) 1 %sec mode $1 $+(+,$str(I,%limit)) %str
      unset %n %str | inc %sec %delay
    }
    inc %i | inc %n
  }
  unset %n %str %sec
}

Note:

  • The correct command to input is: /invitelist #channel
  • The host list file must contain one host per line.
  • The limit of the number of hosts for setting the mode is configured through a variable: %limit 5
  • The initial time in seconds for the first start of the timer is configured through a variable: %sec 0
  • The delay time in seconds for the timer is configured through a variable: %delay 10



Screenshot of the script in action:

    [Linked Image from i.ibb.co]
Posted By: Simo Re: Add invite list with delay - 25/04/23 04:07 PM
excellent that seems to work very well thanks Epic
Posted By: Simo Re: Add invite list with delay - 25/04/23 04:48 PM
anyway we can add another check to check if each invite host is already set and if so to remove from the list and go to the next one ?
Posted By: Epic Re: Add invite list with delay - 25/04/23 05:17 PM
Originally Posted by Simo
anyway we can add another check to check if each invite host is already set and if so to remove from the list and go to the next one ?
Do you mean to each host taken from the file should be checked with a list of invited channel hosts and so that these hosts are not reused when setting the channel mode?
But at the same time you don't want these hosts to be removed from the list of invited hosts on the channel? That is, not to do "/mode #channel -I *!*@11.22.33.44" ?

Am I understanding your request correctly? Please specify your question
Posted By: Simo Re: Add invite list with delay - 25/04/23 05:40 PM
yes if the host is already set we dont need to set it again
Posted By: Epic Re: Add invite list with delay - 25/04/23 08:30 PM
Ok, ready, done. Try to use this script:
Code
alias invitelist {
  if (!$1) { echo Correct command:12 /invitelist #channel | halt }
  var %file invite-list-Gforce.txt, %lines $lines(%file)
  var %i 1, %n 0, %limit 5, %sec 0, %delay 10
  while (%i <= %lines) {
    var %str $read(%file,nt,%i)
    if (!$ifind($1,%str)) { %masks = %masks $+(*!*@,%str) | inc %n }
    if (%n == %limit) || (%i == %lines && %masks) { 
      $+(.timer,INVITE,%i,$r(a,z)) 1 %sec mode $1 $+(+,$str(I,%limit)) %masks
      unset %n %masks | inc %sec %delay
    }
    inc %i
  }
  unset %n %sec %masks
}
alias -l ifind { var %q 1 | while (%q <= $iil($1,0)) { if ($2 == $gettok($iil($1,%q),2,64)) return 1 | inc %q } }
Posted By: Simo Re: Add invite list with delay - 26/04/23 08:31 AM
ive tried it and it still seems to set invites while they are already set
Posted By: Epic Re: Add invite list with delay - 26/04/23 08:45 AM
Originally Posted by Simo
ive tried it and it still seems to set invites while they are already set
Strangely, this was not the case during testing, and all the set host masks on the channel for the invitation are not re-set.

Can show what your list of hosts looks like in a file, or provide an example, screenshots, so that I can identify the error and make the necessary changes to the script code?
Posted By: Simo Re: Add invite list with delay - 26/04/23 09:56 AM
ive tested it again and it seems fine now thanks again Epic much apreciated
Posted By: Epic Re: Add invite list with delay - 26/04/23 11:05 AM
If, instead of pure hosts, you prefer to keep entries in the file as custom users address masks (with wildcards), you can try using this modified script code:
Code
menu channel {
  -
  Invite List: invitelist $active
  -
}
alias invitelist {
  if (!$1) { echo Correct command:12 /invitelist #channel | halt }
  var %file invite-list-Gforce.txt, %lines $lines(%file)
  var %i 1, %n 0, %limit 5, %sec 0, %delay 10
  while (%i <= %lines) {
    var %str $read(%file,nt,%i)
    if (!$ifind($1,%str)) { %masks = %masks %str | inc %n }
    if (%n == %limit) || (%i == %lines && %masks) { 
      $+(.timer,INVITE,%i,$r(a,z)) 1 %sec mode $1 $+(+,$str(I,%limit)) %masks
      unset %n %masks | inc %sec %delay
    }
    inc %i
  }
  unset %n %sec %masks
}
alias -l ifind { var %q 1 | while (%q <= $iil($1,0)) { if ($2 iswm $iil($1,%q)) return 1 | inc %q } }

Tested on mIRC v7.72. I also added an item to the channel's context menu to quickly launch the alias.

Format of masks with user addresses in the file "invite-list-Gforce.txt" was as follows:
Quote
test*!test*@*
*!*@OY4EJ.*.8I10H.NEDSL
*!*@*.4CH99.TCXSZ.*
Room*!*@*
nicks*!*@*.EP8VQ.*
*!*@*.WO78K.O42X6.6S8A5
*!*users*@*
*!*@FZKZC.RHICY.LLGDD.*
*!*@P4PO6.KW849.*
User*!*@CD7FV.*.IMPA7.*
*!test*@*.JMEW9.B850G
Posted By: Simo Re: Add invite list with delay - 26/04/23 12:11 PM
thats actually how i added the hosts in the text file in a proper syntax: nick!ident@host

thanks Epic much apreciated
© mIRC Discussion Forums