mIRC Home    About    Download    Register    News    Help

Print Thread
Dialog ID's and $(...) #235734 08/01/12 02:48 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline OP
Hoopy frood
OP Offline
Hoopy frood
H
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:

Code:
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. }
}

Re: Dialog ID's and $(...) [Re: hixxy] #235737 08/01/12 05:56 PM
Joined: Jan 2004
Posts: 1,319
L
Loki12583 Online
Hoopy frood
Online
Hoopy frood
L
Joined: Jan 2004
Posts: 1,319
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?

Re: Dialog ID's and $(...) [Re: Loki12583] #235739 08/01/12 06:56 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline OP
Hoopy frood
OP Offline
Hoopy frood
H
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.

Re: Dialog ID's and $(...) [Re: hixxy] #235741 08/01/12 08:30 PM
Joined: Jan 2004
Posts: 1,319
L
Loki12583 Online
Hoopy frood
Online
Hoopy frood
L
Joined: Jan 2004
Posts: 1,319
Oh wow I had no idea.

Re: Dialog ID's and $(...) [Re: hixxy] #235743 08/01/12 11:16 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
So would you also expect $() to work in the dname part? or event?

Code:
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"
Re: Dialog ID's and $(...) [Re: argv0] #235756 09/01/12 09:06 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline OP
Hoopy frood
OP Offline
Hoopy frood
H
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.

Re: Dialog ID's and $(...) [Re: hixxy] #235761 10/01/12 09:27 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Originally Posted By: hixxy
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"
Re: Dialog ID's and $(...) [Re: argv0] #235765 10/01/12 06:58 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline OP
Hoopy frood
OP Offline
Hoopy frood
H
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.

Re: Dialog ID's and $(...) [Re: argv0] #235766 10/01/12 07:09 PM
Joined: Jul 2006
Posts: 3,764
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,764
I agree, if anything, it should be extended to any event's parameter


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Dialog ID's and $(...) [Re: Wims] #235827 15/01/12 02:38 PM
Joined: Apr 2003
Posts: 342
M
MeStinkBAD Offline
Fjord artisan
Offline
Fjord artisan
M
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!
Re: Dialog ID's and $(...) [Re: MeStinkBAD] #235831 15/01/12 07:19 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline OP
Hoopy frood
OP Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
What?

Re: Dialog ID's and $(...) [Re: MeStinkBAD] #235832 15/01/12 08:39 PM
Joined: Jan 2004
Posts: 1,319
L
Loki12583 Online
Hoopy frood
Online
Hoopy frood
L
Joined: Jan 2004
Posts: 1,319
Originally Posted By: MeStinkBAD
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.
Re: Dialog ID's and $(...) [Re: MeStinkBAD] #235834 15/01/12 10:58 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
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"