Not sure how hard this would be to implement but an awsome addition to the scripting language would be /when for example.
on *:connect:when ($me ison #test) msg chanop op #test $me
or a better way would be to use it as an event hander
when:$me ison #test:msg chanop op #test $me
Imagine the possibilities.
what about a simple "on join" with the "me" prefix and an if $network == network ...
you mean a 'when' statement that triggers something internally that will react when a specified event occurs? isn't that what mirc's existing events already do?
i really think this falls under the category of abstract ideas that add pretty much nothing useful to mirc's functionality
jizzy's example is perfectly replaceable by mIRC's ON JOIN event, but his suggestion looks to me more like the temporary events in jIRCii (
http://jirc.hick.org):
alias j
{
if ($1 eq "#floods")
{
call("/msg JakieChan dude, what is the key to #floods?");
wait privmsg
{
call("/join #floods $1");
}
}
else
{
call("/join $1-");
}
}
Edit: providing some info on the code above (from http://jirc.hick.org/jirc/tutorial.prl?scriptjirc):In the above example the alias j is declared. The alias checks to see if I'm trying to join the channel #floods. If I am it messages a friend of mine asking for the key. When he responds (presumably with the key), jIRCii joins the channel.
Event specific variables from when the temp listeners was declared are not carried over to temporary events. They have there own set of variables just like any other event. Nothing inside of the { } curly braces is evaluated until the event occurs. As such watch out for using variables outside of a wait command and then expecting it to be available or be the same thing inside of it.The "wait" command is something that I'd like to see in mIRC. To do something like the above, mIRC currently needs the use of 2 or more events and temporary variables to control them.
Yes ok bad example, say for example I want to trigger something when mIRC is minimized:
when:$appstate == minimized:do this
This would save setting a timer to check this every 200ms or whatever.
So its watch point events your meaning, i dont see a problem with that if its implementable.
Didn't see the point when you first posted with an example in part of the event declaration, didn't make sense and wasn't something that couldn't already be done.
However after you gave a better example i like the idea, if would prove very useful for mirc to trigger any appropriate 'when' declarations at the point that the var/identifier/etc is changed, and as you said would make some things that usually require timers much easier.
a timer that calls an alias every xx minutes/etc then performs some tasks or messages could be made much simpler with something like when:$sometimedateidentifier // %varwithdelay:commands
of corse thats a simple use, but this type of thing would also avoid the need to start/stop/restart such timers.
a command (like /timers) to list these type of binds would be useful also
I thought you were talking about something more IRC-related (just like the 'wait' suggestion in my reply), but now that you've come with a better example, I'm all for it.
awesome request definatly supporting this.