mIRC Home    About    Download    Register    News    Help

Print Thread
#271655 12/05/23 03:35 PM
Joined: May 2023
Posts: 2
V
Bowl of petunias
OP Offline
Bowl of petunias
V
Joined: May 2023
Posts: 2
Hello,

I am unfortunately a beginner at scripting and actually, I just need this one script, but I can't get it together myself.

I want to connect to a single server up to 15 times in mIRC. I want to join the same channel with each of these instances. Each with a different nickname. Once three instances have connected, I want the script to wait 61 seconds each and then login the next 3 instances. Etc.
The IRC server is my own private and so I allow myself as admin to do that :P

Is there already something comparable that I could use? I doubt I could write it on my own.

Thank you in advance for your kind help!

VeleanyMain #271662 14/05/23 03:23 PM
Joined: Feb 2015
Posts: 138
kap Offline
Vogon poet
Offline
Vogon poet
Joined: Feb 2015
Posts: 138
The following script sets up a timer to fire five (%rep) times in total and every time it fires, it connects three (%step) times to the specified server (%server) and joins the specified channel (%join):
Code
alias t1 {
  var %rep 5
  var %interval 61
  if ($timer(post271665)) .timerpost271665 off
  else {
    .timerpost271665 -io %rep %interval conn_ect | .timerpost271665 -e
  }
}

alias conn_ect {
  var %server testnet.ergo.chat
  var %port +6697
  var %join #test271665
  var %step 3
  while (%step > 0) {
    var %nick $+(test,$base($rand(0,9999),10,10,4)), %altnick $+(%nick,_)
    server -m %server %port -i %nick %altnick -j %join
    dec %step
  }
}

Start this script:
Code
/t1

Note: You'll want to change %server, %port and %join to suit your needs.


GNU Terry Pratchett - Looking for a mIRC help channel -> Check #mircscripting @ irc.swiftirc.net
kap #271666 16/05/23 12:24 PM
Joined: May 2023
Posts: 2
V
Bowl of petunias
OP Offline
Bowl of petunias
V
Joined: May 2023
Posts: 2
Hi,

first of all: Many, many thanks! This worked great with a few adjustments. However, I would like to specify specific nicks before. So a list of nicknames that the script should then process one after the other. Would you have a solution for this as well?

VeleanyMain #271668 17/05/23 11:59 AM
Joined: Feb 2015
Posts: 138
kap Offline
Vogon poet
Offline
Vogon poet
Joined: Feb 2015
Posts: 138
Something like this would work:

Code
alias t1 {
  var %rep 5
  var %interval 61
  if ($timer(post271666)) .timerpost271666 off | if ($hget(conn_ect)) hfree $v1
  else {
    ; add your nicks to the variable %nicklist, space delimited
    ; --------------------------------------------------------- 
    var %nicklist specnick1 specnick2 specnick3 specnick4 specnick5
    ; ---------------------------------------------------------
    ; add nicklist to hashtable/item so we can work with it later
    hadd -m conn_ect nicklist %nicklist
    ; setup the timer and fire/execute it immediately
    .timerpost271666 -io %rep %interval conn_ect | .timerpost271666 -e
  }
}
alias conn_ect {
  var %server testnet.ergo.chat
  var %port +6697
  var %join #test271666
  var %step 3
  while (%step > 0) {
    if (($hget(conn_ect)) && ($hget(conn_ect,nicklist))) {
      ; chop up nicklist, delimit on space - $chr(32)
      tokenize 32 $hget(conn_ect,nicklist)
      ; grab the first nick off the list
      var %nick $1
      ; save the remaining nicks in the hashtable/item
      hadd -m conn_ect nicklist $2-
    }
    ; if nicklist empty, fallback on creating a random nick
    else var %nick $+(test,$base($rand(0,9999),10,10,4))
    ; an altnick might be handy to have, base it off %nick
    var %altnick $+(%nick,_)
    ; connect to the server with the specified settings
    server -m %server %port -i %nick %altnick -j %join
    ; dec the while loop
    dec %step
  }
}


GNU Terry Pratchett - Looking for a mIRC help channel -> Check #mircscripting @ irc.swiftirc.net
VeleanyMain #271670 17/05/23 01:16 PM
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Hi,

First of all, it would help to see what the adjustments are, because that would guide what kind of solution I would come up with. For example, looking at the posted script, it always uses /server -m, so it would created 15 connections in status windows #2 through #16. If that's what you're doing, then status window #1 is never used, and server -m is performed 15 times where $scon(0) tells how many connections are already open. If that's the case, you can have a variable containing 15 nicks, then instead of the %nick being created randomly, it would be created something like:

var %nick $gettok(%list_of_nicks,$scon(0),32)

If it's sufficient to change to the specific nick AFTER connecting to the server using a random nick, you can use either $scon(-1) in the newest beta, or use the 'con' alias in this thread:

https://forums.mirc.com/ubbthreads.php/topics/271303/con-or-scon-1

Either $con or $scon(-1) would return a number telling you that it's connecting in the 3rd, 6th, etc connection window. You could then do something like:

ON *:CONNECT:{
if ($network == NetworkString) nick $gettok(%list_of_nicks,$con,32)
}


Link Copied to Clipboard