mIRC Homepage
Posted By: OmegaDeus using commands in scripts - 28/01/09 08:20 PM
I used to do some scripting in mIRC a while back, quit for a long while, and have recently started to script in mIRC again. I am looking at other people's scripts to get ideas on how to do things, and have always wondered one thing. I have seen a lot of scripts, and some do command while others do .command. I have never asked before and never thought to ask, but what is the difference? Examples below:

Code:
somealias {
  var %somevar sometext

  echo %somevar
}


Code:
somealias {
  .var %somevar sometext

  .echo %somevar
}
Posted By: Wims Re: using commands in scripts - 28/01/09 08:29 PM
Originally Posted By: /help $
If you want to force a command to perform quietly ie. without printing out any information, then you can prefix it with a "." full stop. For example:

/ignore somenick

Would print out information telling you that you are now ignoring "somenick". If you don't want this information to be displayed, then you can use:

/.ignore somenick


Posted By: OmegaDeus Re: using commands in scripts - 28/01/09 08:44 PM
Thanks.
Posted By: westor Re: using commands in scripts - 29/01/09 04:47 AM
if hearted that the fullstop . in any alias or remote it decreases the PING , is that true of false? i tested and i saw that when i used any commands starting with the fullstop eg: .var or .while , the script remote runs faster.
Posted By: Horstl Re: using commands in scripts - 29/01/09 05:14 AM
As long as the commands don't produce echo outputs itself (which can be silenced - thats what the prefix is meant for), it's the same performance.
If you have doubts - run your own test, like:
Code:
alias nonsilenced {
  var %n = 1, %start = $ticks
  while (%n <= 50000) {
    var %a = $ticks
    noop
    inc %n
  }
  echo -a nonsilenced $calc($ticks - %start) ticks
}

alias silenced {
  var %n = 1, %start = $ticks
  .while (%n <= 50000) {
    .var %a = $ticks
    .noop
    .inc %n
  }
  echo -a silenced $calc($ticks - %start) ticks
}

My results (running each alias 3times):
nonsilenced 1687 ticks
nonsilenced 1703 ticks
nonsilenced 1703 ticks
silenced 1703 ticks
silenced 1703 ticks
silenced 1688 ticks
smile
Posted By: westor Re: using commands in scripts - 29/01/09 05:26 AM
i tryied too your aliases and look the resaults:
nonsilenced 5078 ticks
silenced 5015 ticks
nonsilenced 5016 ticks
silenced 4969 ticks


a difference between the fullstop and not is true.
Posted By: Horstl Re: using commands in scripts - 29/01/09 05:33 AM
Run each test several times and take the average. Results of single runs may vary due to e.g. slightly different system load.
Also note that you have 50.000 iterations; 1 tick is 1 millisecond...
© mIRC Discussion Forums