mIRC Home    About    Download    Register    News    Help

Print Thread
Need help with script #264778 11/01/19 03:19 PM
Joined: Jan 2019
Posts: 3
Z
zixyx Offline OP
Self-satisified door
OP Offline
Self-satisified door
Z
Joined: Jan 2019
Posts: 3
Hello, I have a script (not my) for automatic connection to server channels from text file... but they all of them are opening on maximized windows and I want to have them opening in minimized mode, The same options is in >tools>add favorites and there is option minimize on join but this option is only for specific channels, I searched in settings if there is some way to open channels only in minimized mode but couldn't find nothing frown

Last edited by zixyx; 11/01/19 03:20 PM.
Re: Need help with script [Re: zixyx] #264781 11/01/19 07:08 PM
Joined: Jan 2004
Posts: 1,205
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,205
If your script uses the /join command or the /server command's -j switch, /join offers the -n switch and /server's -j can be replaced with -jn.

type: /help /join
or
/help /server

Re: Need help with script [Re: zixyx] #264782 11/01/19 07:15 PM
Joined: Jul 2014
Posts: 126
Tiago Offline
Vogon poet
Offline
Vogon poet
Joined: Jul 2014
Posts: 126
Originally Posted By: zixyx
Hello, I have a script (not my) for automatic connection to server channels from text file... but they all of them are opening on maximized windows and I want to have them opening in minimized mode, The same options is in >tools>add favorites and there is option minimize on join but this option is only for specific channels, I searched in settings if there is some way to open channels only in minimized mode but couldn't find nothing frown

Code:
/join [-inxmd] <#channel>

This is a standard IRC command for joining a channel.
Quote:
The -i switch makes you join the channel to which you were last invited.

The -n and -x switches set the minimize/maximize state for new channel windows.

The -m and -d switches set the mdi/desktop state for new channel windows.

I hope I have been able to help wink


TECO
irc.PTirc.org (IRCop)
Re: Need help with script [Re: Tiago] #264783 11/01/19 08:23 PM
Joined: Jan 2019
Posts: 3
Z
zixyx Offline OP
Self-satisified door
OP Offline
Self-satisified door
Z
Joined: Jan 2019
Posts: 3
The script doesnt have /join command, it starts with
ON *:CONNECT: {
IF ($server == serveraddress)
VAR %x = 1
WHILE ($read(autojoin.txt, t,%x) != $null) {
VAR %chan $chr(35) $+ $read(autojoin.txt, t, %x)
.TIMER -m 1 $calc(%x * 333) JOIN %chan
INC %x
}

Re: Need help with script [Re: zixyx] #264784 11/01/19 09:23 PM
Joined: Jan 2004
Posts: 1,205
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,205
of course it has it. Your script is doing it 3 times per second. You can insert the -n between JOIN %chan

If your network has multiple servers, you might want to change ($server == serveraddress) and replace it with ($network == networkstring)

Re: Need help with script [Re: maroon] #264785 11/01/19 11:05 PM
Joined: Jan 2019
Posts: 3
Z
zixyx Offline OP
Self-satisified door
OP Offline
Self-satisified door
Z
Joined: Jan 2019
Posts: 3
Thanks, it works smile

I think it is only one server, "serveraddress"-> is address for irc server...

Re: Need help with script [Re: zixyx] #264867 19/01/19 02:54 PM
Joined: Jul 2006
Posts: 3,576
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,576
Hello, your script contains an exploit, you can be exploited, do not run this script, you need to use the 'n' switch on $read(), and you need to use $unsafe() on %chan, you can read more about injection here https://en.wikichip.org/wiki/mirc/msl_injection

Also your script has missing { } on the if, here is a fixed version:

Code:
on *:connect:{
  if ($server == serveraddress) {
    var %x 1
    while ($read(autojoin.txt, nt ,%x) != $null) {
      var %chan $chr(35) $+ $v1
      .timerautojoin -m 1 $calc(%x * 333) JOIN $unsafe(%chan)
      inc %x
    }
  }
}


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net