mIRC Home    About    Download    Register    News    Help

Print Thread
#238420 25/07/12 09:21 PM
Joined: Mar 2004
Posts: 526
HorseC Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Mar 2004
Posts: 526
the current format for $tip includes 'iconfn'

$tip(name,title,text,delay,iconfn,iconpos,alias,wid)

is there any way that it could also accept the data as used
in $input... ie:

iqwh - show the info, question, warning, and halt icons respectively.

while the icons displayed in $input are of a different size
than would be needed for $tips, having the basic icons
available via a letter (and not having to have seperate
.ico files, as i now have) for tips would be a nice
addition.





Last edited by HorseC; 25/07/12 09:23 PM.

Help others! It makes the world a better place, Makes you feel good, and makes you Healthy!
Joined: Jul 2006
Posts: 4,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
I like the idea, but since each letter of "iqwh" is a valid filename, you would need a special way to tell the difference, maybe using the iconpos value.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Mar 2004
Posts: 526
HorseC Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Mar 2004
Posts: 526
Originally Posted By: Wims
I like the idea, but since each letter of "iqwh" is a valid filename, you would need a special way to tell the difference, maybe using the iconpos value.


Great point wims, and thanks.


Help others! It makes the world a better place, Makes you feel good, and makes you Healthy!
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
It would be pretty unintuitive to use iconpos since you would still be required to specify iconfn when passing in these switches.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Jul 2006
Posts: 4,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
It was just an example, you could pass $null for iconfn and use the letter in iconpos


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Originally Posted By: Wims
you could pass $null for iconfn and use the letter in iconpos


This is exactly what would be unintuitive.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Jul 2006
Posts: 4,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
It doesn't seem that unintuitive to me, it's related to the icon after all and we can already pass $null there.
The syntax doesn't really matter anyway.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
This isn't a matter of syntax, it's a matter of semantics. The syntax isn't in question, the semantics of forcing the user to pass an empty value to get to the next useful parameter is the issue. "we can already pass $null there" is easy for someone who knows the API to say. Please tell me how you would explain this to someone who has never used $tip before, and potentially doesn't know what $null is. I can't think of any way this can be documented without seeming insanely confusing to a user who doesn't know the language extremely well.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
True, but in many cases, we're already passing $null in $tip, so it's not really any different. That said, I think custom icons are better than default ones anyhow.


Invision Support
#Invision on irc.irchighway.net
Joined: Jul 2006
Posts: 4,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
Quote:
the semantics of forcing the user to pass an empty value to get to the next useful parameter is the issue. "we can already pass $null there" is easy for someone who knows the API to say. Please tell me how you would explain this to someone who has never used $tip before, and potentially doesn't know what $null is
Keep in mind it's not just because you dislike very much the semantic in place that it will prevent its usage.
I undertand your concern and I agree this is far from being the best choice but the semantic is already there everywhere in mIRC (passing $null isn't just something you do in $tip), imo it's a good enough reason to keep going with it, no matter how bad you think it is.
Your example was an extreme, you don't start using the scripting language with $tip but I wouldn't help someone with $tip knowing he doesn't know what $null is, pretty simple.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Originally Posted By: Wims
passing $null isn't just something you do in $tip


But it is. There are actually very few places in the language where $null is ever used as a parameter unless you're doing something very weird. It's mostly used in if conditions, but not command arguments. This is why it's so confusing and unintuitive.

Originally Posted By: Wims
Your example was an extreme, you don't start using the scripting language with $tip but I wouldn't help someone with $tip knowing he doesn't know what $null is, pretty simple.


Please don't assume to know how scripters start out. People start scripting for whatever their needs may be. Scripting something that pops up custom information triggered by an event is a perfectly valid "first script" project. Note that I did not say "never programmed before"; there are plenty of people who can program and want to do X in mIRC but aren't comfortable with the API. It would not be easy to explain this to new or knowledgable programmers.

I would say that + should be used as a prefix in iconfn to indicate that the parameter is a set of switches. There is precedent for prefixing switches with +, albeit in /commands, but it would be easier to explain.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Mar 2004
Posts: 526
HorseC Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Mar 2004
Posts: 526
actually this whole issue could be resolved if the icons that are internally built in mIRC (used in $input) were made available. Then anyone could just use them in $tip



Help others! It makes the world a better place, Makes you feel good, and makes you Healthy!
Joined: Jun 2003
Posts: 81
T
TRT Offline
Babel fish
Offline
Babel fish
T
Joined: Jun 2003
Posts: 81
Those are standard Windows icons, you can already find them in shell32

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
For convenience though, resembling open sourced icons could possibly be added to the 64 mircexe icons...


Link Copied to Clipboard