mIRC Home    About    Download    Register    News    Help

Print Thread
#271591 25/04/23 12:04 PM
Joined: Nov 2021
Posts: 117
Simo Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Nov 2021
Posts: 117
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
  }
}


Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
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?

Joined: Jan 2012
Posts: 323
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 323
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]


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Joined: Nov 2021
Posts: 117
Simo Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Nov 2021
Posts: 117
excellent that seems to work very well thanks Epic

Joined: Nov 2021
Posts: 117
Simo Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Nov 2021
Posts: 117
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 ?

Last edited by Simo; 25/04/23 04:49 PM.
Joined: Jan 2012
Posts: 323
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 323
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


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Joined: Nov 2021
Posts: 117
Simo Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Nov 2021
Posts: 117
yes if the host is already set we dont need to set it again

Joined: Jan 2012
Posts: 323
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 323
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 } }


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Joined: Nov 2021
Posts: 117
Simo Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Nov 2021
Posts: 117
ive tried it and it still seems to set invites while they are already set

Joined: Jan 2012
Posts: 323
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 323
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?


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Joined: Nov 2021
Posts: 117
Simo Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Nov 2021
Posts: 117
ive tested it again and it seems fine now thanks again Epic much apreciated

Last edited by Simo; 26/04/23 10:00 AM.
Joined: Jan 2012
Posts: 323
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 323
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


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Joined: Nov 2021
Posts: 117
Simo Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Nov 2021
Posts: 117
thats actually how i added the hosts in the text file in a proper syntax: nick!ident@host

thanks Epic much apreciated


Link Copied to Clipboard