Custom DCX Identifiers

By Protheus on Dec 03, 2011

Idea from Kentaro Kurosaki These are custom identifiers for DCX.dll. These identifiers make a few things a bit easier and faster, such as instead of typing xdialog -c $dname then the did then the control, you would just type $xdc then the did then the control. Simple as pancakes. Enjoy.

xdc return xdialog -c $dname **For easier control creation**
blk return xdialog -g $dname +b $rgb(0,0,0) **For coloring your dialog black**
grn return xdialog -g $dname +b $rgb(0,255,0) **For green dialogs**
red return xdialog -g $dname +b $rgb(255,0,0) **For red dialogs**
blu return xdialog -g $dname +b $rgb(0,0,255) **For blue dialogs**

Comments

Sign in to comment.
jaytea   -  Dec 09, 2011

You talked about "super complicated" at the beginning and then stressed it again at the end.

from Lucius' comment:

if ($super($+(complicated,retireval)))  {

that's where i got "super complicated retrieval" from.

The goes without saying you talked about easy and then ended it "not simple."

i defined what i meant by 'simple', then went on to say that i would also use Lucius' idea in the case where v1 is not necessarily 'super complicated', but merely 'non-simple'.

You jargonized your explanation, to me, in an awkward manner that didn't make it concise

jargon, awkwardness, and verbosity are 3 distinct and negative features that i don't recognize in my post. it may be slightly wordy, but i believe that's often necessary in order to be satisfactorily accurate - all things considered.

let alone those who utilize English as a second language.

are you genuinely worried about this?

I'm just being blunt to say what I want to say as a straight shooter.

that's fine, i like when people do that ;)

 Respond  
Jethro   -  Dec 09, 2011

You talked about "super complicated" at the beginning and then stressed it again at the end. The goes without saying you talked about easy and then ended it "not simple." You jargonized your explanation, to me, in an awkward manner that didn't make it concise and clear for readers to digest it mentally, let alone those who utilize English as a second language.

I'm not trying to offend you in any way, jaytea. I hope you don't steer me wrong. I'm just being blunt to say what I want to say as a straight shooter.

 Respond  
Protheus   -  Dec 08, 2011

Excellent point. I think what Jethro was trying to say is that at times you can seem overly passionate about mSL, almost to the point of being condescending. And i think soapboxing is a word. It should be, at any rate.

 Respond  
jaytea   -  Dec 08, 2011

i can see 'philosophy' implying romanticizing or soapboxing (is that a word?) in some way, but i can't see how my post comes across as such. after all, we are discussing a scripting language and not campaigning to end hunger or for world peace ;P

what i dislike is the suggestion that i'm being 'roundabout' or speaking in riddles. it's not the first time i've been accused of it, which is puzzling because i do try to explain things in a direct way that can, primarily, be understood by the person or people i'm talking to, and, secondarily, to any other enthusiast who may come across the post. the distribution of information related to mSL is scattered enough as it is without me having to lead people on an easter egg hunt

 Respond  
Protheus   -  Dec 08, 2011

roundabout philosophy. What he's inferring is that you sort of romanticized your explaination. As if you were a philosopher remarking on the meaning of life.

 Respond  
jaytea   -  Dec 08, 2011

roundabout? normally i can infer what you're trying to say when you use words incorrectly, but i'm lost on this one

 Respond  
Jethro   -  Dec 08, 2011

jaytea, does explaning the $v1 identifier have to be a roundabout philosophy? Come on, man...

 Respond  
jaytea   -  Dec 07, 2011
wouldn't it be easier to use $v1?

we don't have any super complicated retrievals up there, just a series of elseifs with $v1 = $3. not sure what you mean by 'easier'. easier to type? perhaps. easier to understand? again, sometimes, since it requires the reader to look up to see where $v1 takes its value from. yes, it's a good technique to use in cases where: 1) the original $v1 is a piece of code that is subject to change, and the nature of the code is such that the subsequent elseifs need to change also, or 2) the original $v1 is a piece of code that isn't a simple identifier (one without arguments) or variable. not 'super complicated', but anything that isn't simple.

 Respond  
Protheus   -  Dec 07, 2011

lol i'll try it. Why does everyone comment on my hair? Is it.... Purdy?

 Respond  
Lucius   -  Dec 07, 2011

wouldn't it be easier to use $v1?

if ($super($+(complicated,retireval)))  {
  if ($v1 == 1) { do this }
  elseif ($v1 == 2) { do this instead }
  elseif ($v1 == savvy) { touch ProSec's hair }

I haven't ever tried it but I should think the elseif would make sure the $v1 would stay for the main if, although in this format it wouldn't make a difference. The point I'm making is you only need to log the first if as in existance then $v1 for what it actually is. that should shorten a code down but I have never seen incomplete if brackets in any msl script.

 Respond  
Protheus   -  Dec 05, 2011

Well thank you, kind sir.

 Respond  
jaytea   -  Dec 05, 2011

hmm, i didn't intend it to be ;> you're curious and your head's in the right place. that's a faultless approach as far as i'm concerned

 Respond  
Protheus   -  Dec 05, 2011

Kinda harsh, wasnt it? But thanks all the same.

 Respond  
jaytea   -  Dec 05, 2011

Suggestions?

yes, re-write the code in such a way that you don't need to use your idea ;P i gave one example of that and there are many more suitable alternatives depending upon the nature of the overall script

Wait. What if i made the identifier $elseif? mIRC would evaluate it and it would still shorten the code, right?

no, not in the way you want at least. 'elseif' has to appear statically and as the name of the command. you'll discover at some point that short code is not necessarily good code. unfortunately, the pages and pages of explanation about this are buried in various places on this site!

 Respond  
Protheus   -  Dec 04, 2011

lmffao wow. Yes, you may touch the hair (no homo). Love the pic. I lold so frakkin hard :P

 Respond  
Jethro   -  Dec 04, 2011

No, your hair is suave. Will you let me touch it? lol

Below pic is just for fun:Image

 Respond  
Protheus   -  Dec 04, 2011

lmao You don't like my hair?

 Respond  
Jethro   -  Dec 04, 2011

I think he said "savvy" because ProSec has a hairdo relatively similar to Jack's. :p lol And jaytea here is the parrot then...:p

 Respond  
Protheus   -  Dec 04, 2011

Wait. What if i made the identifier $elseif? mIRC would evaluate it and it would still shorten the code, right?

 Respond  
Protheus   -  Dec 04, 2011

Yea. Just tested it. $sc dosent work. It actually loops the command given at the end of the elseif statement. Back to drawing board lol. Suggestions?

 Respond  
jaytea   -  Dec 04, 2011

Savvy?

no Jack Sparrow, mIRC script doesn't work like that ;)

if statements, while loops, /var and a few others are commands that involve exceptional parsing routines. in order for this to happen in the case of elseif, for example, "elseif" needs to appear literally at the start of the command. mIRC needs to be able to detect it before it starts evaluating identifiers and variables in your code.

and even if it did work, it would result in rather poor code since the condition(s) contained in '$sc' would be re-examined unnecessarily. this is the logic you're aiming for:

if ($2 == sclick) {
  if ($3 == 2) {

  }
  elseif ($3 == 3) {

  }
  elseif ($3 == 4) {

  }
}
 Respond  
Jethro   -  Dec 04, 2011

If ($2 == sclick) && ($3 == 2) {
can be shortened a tad to:
if ($2-3 == sclick 2) {

 Respond  
Protheus   -  Dec 04, 2011

the initial if statement will have to be typed out manually but in my experience the most tedious and time consuming parts are all the else ifs, which is what $sc was written for. Example: If ($2 == sclick) && ($3 == 2) {
/do this
}
$sc 3) {
/do that
}
$sc 4) {
/do it
}
Savvy?

 Respond  
jaytea   -  Dec 04, 2011
[ $sc ] apple) {

this doesn't work for control structures such as if, elseif, etc.

 Respond  
SReject   -  Dec 04, 2011

that's doubtful unless something like:

if (....) {
  do something
}
[ $sc ] apple) {
  do something else
}

But I haven't tested, so I wouldn't know

 Respond  
Sorasyn   -  Dec 04, 2011

Will your sc identifier work like that? I haven't done mSL in quite some time though but it still just doesn't look right to me... By the way you can use $1 $2 $3- etc etc with aliases as you would in text events

For example:
$test(color) - $1 can call "color".
$test(color, text, name) - $1 calls 'Color'; $2 calls text; $3 calls name.

Just a suggestion as these may clean them up a little bit, but otherwise looks good.

 Respond  
SReject   -  Dec 03, 2011

dcx-color redvalue greenvalue bluevalue

alias dcx-color xdialog -g $dname +b $rgb($$1,$$2,$$3)
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.