mIRC Homepage

Need help with script

Posted By: zixyx

Need help with script - 11/01/19 03:19 PM

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
Posted By: maroon

Re: Need help with script - 11/01/19 07:08 PM

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
Posted By: Tiago

Re: Need help with script - 11/01/19 07:15 PM

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
Posted By: zixyx

Re: Need help with script - 11/01/19 08:23 PM

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
}
Posted By: maroon

Re: Need help with script - 11/01/19 09:23 PM

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)
Posted By: zixyx

Re: Need help with script - 11/01/19 11:05 PM

Thanks, it works smile

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

Re: Need help with script - 19/01/19 02:54 PM

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
    }
  }
}
© 2019 mIRC Discussion Forums