|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
OP
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
It would be great if mIRC supported $(...) in the dialog ID section of dialog events. To illustrate what I mean: alias -l id_ok { return 1 }
dialog test {
title ""
size -1 -1 300 300
option dbu
button "ok", $id_ok, 125 125 50 50, ok
}
on *:dialog:test:sclick:$($id_ok):{ ; this doesn't work, would be great if it did. }
on *:dialog:test:sclick:*:{
if ($did == $id_ok) { ; this does work. }
}
|
|
|
|
Joined: Jan 2004
Posts: 1,361
Hoopy frood
|
Hoopy frood
Joined: Jan 2004
Posts: 1,361 |
Wow I just asked about this Friday on Freenode. I decided to include the magic number in the event and just comment above it with the id alias so I could find it easily when needing to be changed. Maybe having a wildcard event and calling aliases would be better. Are $dname, $devent, and $did the only identifiers I would need to pass?
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
OP
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
I'm not at mirc to test right now but I don't think you'd even need to pass anything, aliases usually inherit the identifiers from the calling event, which is why you can use $nick etc in an alias called from on JOIN. I can't see a reason for the same not to be true for dialogs.
|
|
|
|
Joined: Jan 2004
Posts: 1,361
Hoopy frood
|
Hoopy frood
Joined: Jan 2004
Posts: 1,361 |
|
|
|
|
Joined: Oct 2003
Posts: 3,918
Hoopy frood
|
Hoopy frood
Joined: Oct 2003
Posts: 3,918 |
So would you also expect $() to work in the dname part? or event? alias -l dname return test
alias -l event return sclick
on *:dialog:$($dname):sclick:1:?
on *:dialog:test:$($event):1:?
- argv[0] on EFnet #mIRC - "Life is a pointer to an integer without a cast"
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
OP
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
Event, no, dialog name, sure why not?
The reason I say no to event is because it makes no sense. When writing a script you would clearly be intending to capture a particular event and the event names are static.
Dialog name would make sense though.
|
|
|
|
Joined: Oct 2003
Posts: 3,918
Hoopy frood
|
Hoopy frood
Joined: Oct 2003
Posts: 3,918 |
When writing a script you would clearly be intending to capture a particular event and the event names are static. Not necessarily... this only matters when two events require different processing, but this is not always the case. For example, sclick and dclick refer to basically the same event but with a slightly different interaction. A scripter might want to simplify an option for users to specify whether their events occur on dclick or sclick and therefore would be stored in some $config.clicktype identifier (which reads from an ini file, perhaps). You could check $devent, but this is just the same exact argument for $did or $dname. I brought up those two examples because this seems arbitrary to me. Traditionally mIRC has been fairly consistent about only allowing $() in matchtext event parameters. How will users know that did and dname accept $() but event does not? Should mIRC document every place where $() is accepted? If so, why not just accept $() everywhere and be done with it?
- argv[0] on EFnet #mIRC - "Life is a pointer to an integer without a cast"
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
OP
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
I'd be fine with $() being accepted everywhere...can't see any reason not, it's just beyond the scope of my suggestion.
|
|
|
|
Joined: Jul 2006
Posts: 4,222
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,222 |
I agree, if anything, it should be extended to any event's parameter
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Apr 2003
Posts: 342
Fjord artisan
|
Fjord artisan
Joined: Apr 2003
Posts: 342 |
You people realize that you could do
on *:dialog:$($dialog($dname,$did)):$($dialog($dname,$did)):$($dialog($dname,$did)):
Last edited by MeStinkBAD; 15/01/12 02:54 PM.
Beware of MeStinkBAD! He knows more than he actually does!
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
OP
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
|
|
|
|
Joined: Jan 2004
Posts: 1,361
Hoopy frood
|
Hoopy frood
Joined: Jan 2004
Posts: 1,361 |
You people realize that you could do
on *:dialog:$($dialog($dname,$did)):$($dialog($dname,$did)):$($dialog($dname,$did)):
1. $() does nothing in the event header 2. Assuming you meant $did($dname,$did) and are talking about if the suggestion is implemented - not only would it be meaningless - but so what?
Last edited by Loki12583; 15/01/12 08:46 PM.
|
|
|
|
Joined: Oct 2003
Posts: 3,918
Hoopy frood
|
Hoopy frood
Joined: Oct 2003
Posts: 3,918 |
You can't do this in the current version of mIRC-- this is the point of the feature suggestion.
As a sidenote, your specific example wouldn't even work if $() was supported.
- argv[0] on EFnet #mIRC - "Life is a pointer to an integer without a cast"
|
|
|
|
|