From WikiChip
Editing mirc/thread

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.

Latest revision Your text
Line 97: Line 97:
  
 
Consider this:
 
Consider this:
<source lang="mIRC">on *:text:!mytrigger:#:{
+
on *:text:!mytrigger:#:{
  while (condition) {
+
  while (condition) {
    dll whilefix.dll Whilefix
+
    dll whilefix.dll Whilefix
    ;rest of your code here
+
    ;rest of your code here
  }
+
  }
}</source>
+
}
 
You are using whilefix because you are doing a loop that is processing a lot of things, or well, because the loop is long enough to freeze your mIRC.
 
You are using whilefix because you are doing a loop that is processing a lot of things, or well, because the loop is long enough to freeze your mIRC.
 
What happens here is that whilefix calls the message loop, but from a critical event: socket messages are not processed, on text won't be processed again while your loop is running.
 
What happens here is that whilefix calls the message loop, but from a critical event: socket messages are not processed, on text won't be processed again while your loop is running.
Line 109: Line 109:
  
 
If whilefix isn't much a problem given the nature of situation (you can't get critical event (or non critical event in this case) to be processed if you are in a while loop without whilefix), COM delaying scripts are more problematic:
 
If whilefix isn't much a problem given the nature of situation (you can't get critical event (or non critical event in this case) to be processed if you are in a while loop without whilefix), COM delaying scripts are more problematic:
<source lang="mIRC">on *:text:!mytrigger:#:{
+
on *:text:!mytrigger:#:{
  ;something
+
    ;something
  pause 5  
+
    pause 5  
  ;rest of your code here
+
    ;rest of your code here
}</source>
+
}  
 
If you do that, nested call to the message loop occurs and it's the same idea as above: your on text event is not processed until the pause finishes.
 
If you do that, nested call to the message loop occurs and it's the same idea as above: your on text event is not processed until the pause finishes.
  
Line 121: Line 121:
 
That being said /timer are not handy, they make you lose the 'scope':
 
That being said /timer are not handy, they make you lose the 'scope':
  
<source lang="mIRC">on *:text:!mytrigger:#:{
+
on *:text:!mytrigger:#:{
  noop
+
    noop
  pause 5
+
    pause 5
  echo -a $nick  
+
    echo -a $nick  
}</source>
+
}
 
vs
 
vs
<source lang="mIRC">on *:text:!mytrigger:#:{
+
on *:text:!mytrigger:#:{
  noop
+
    noop
  .timer 1 5 more
+
    .timer 1 5 more
}
+
}
alias more echo -a $nick</source>
+
alias more echo -a $nick
  
 
In the second example $nick simply does not have a value, mIRC left the on text event 5 seconds ago, $nick is meaningless, you have to pass $nick to the "more" alias, and timers are problematic that way, see the {{mIRC|msl_injection#The_.2Ftimer_command|injection}} page about timers.
 
In the second example $nick simply does not have a value, mIRC left the on text event 5 seconds ago, $nick is meaningless, you have to pass $nick to the "more" alias, and timers are problematic that way, see the {{mIRC|msl_injection#The_.2Ftimer_command|injection}} page about timers.

Please note that all contributions to WikiChip may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see WikiChip:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)