mIRC Homepage
Posted By: TheDalekSec easter egg - 14/11/07 06:06 AM
who i do a easter egg

on 1:dialog:new_table:init:*: {
.did -a $dname 1 --= 1 =-- Opcion Menu
.did -a $dname 1 --= 2 =-- Configuracion Scripts
.did -a $dname 1 --= 3 =-- Cargar Configuracion
.did -a $dname 1 --= 4 =-- Grabar Configuracion
.did -a $dname 1 --= 5 =-- salida del menu
.did -a $dname 1 --= 6 =-- no habilitada
.did -a $dname 1 --= 7 =-- configuracion Nick
.did -a $dname 1 --= 8 =-- sysinfo
}


i want add some --= 9 =-- secret stuff

if any can help preciate

Posted By: Horstl Re: easter egg - 14/11/07 08:28 AM
You can hide (and at some point show) a whole dialog item with did -h (or using the style "hidden"), but you can not hide a line of text in a dialog item.
Posted By: Wims Re: easter egg - 14/11/07 10:26 AM
You can add a empty line with a $chr(160) for example but since the line is visible, it's not really a *secret thing*...

Posted By: TheDalekSec Re: easter egg - 14/11/07 03:24 PM
thanx for the tip
Posted By: TheDalekSec Re: easter egg - 14/11/07 03:25 PM
thanx for the tip!!!!!!!!!!
Posted By: Lpfix5 Re: easter egg - 14/11/07 05:16 PM
Here's my shot at an easter egg going over the idea of (Mirc's yellow icon right click for happy face)

Don't mind the cheap design its really no design just a square with a text label.

The syntax is /egg

once open right click the word happy and see what happens, right click it again to see what happens. (Images can be loaded in dialogs)

and BTW if $decode is locked in your options this won't work

if it is locked unlock it or replace the first line $decode section with Happy Label and the second line with Happy Label smile

Code:
dialog egg {
  title "The Egg"
  size -1 -1 143 123
  option dbu
  text "Happy Label", 1, 32 44 40 8
}
on *:DIALOG:egg:rclick:*:{ 
  if ($regex($mouse.x,/([6-9][0-9])/g) == 1) && ($regex($mouse.y,/([8-9][0-9])/g) == 1) && (%e.1) { did -ra $dname 1 $decode(.2&%P<'D@3&%B96P@.E``) | unset %e.1 }
  elseif ($regex($mouse.x,/([6-9][0-9])/g) == 1) && ($regex($mouse.y,/([8-9][0-9])/g) == 1) && (!%e.1) { did -ra $dname 1 $decode(+2&%P<'D@3&%B96P`) | %e.1 = 1 }
}
alias eggs dialog -m egg egg
Posted By: TheDalekSec Re: easter egg - 15/11/07 03:34 AM
thnx friend
Posted By: schaefer31 Re: easter egg - 15/11/07 04:44 AM
I'm no regex genius, but can you please stop suggesting the use of it when it is highly unnecessary? You've done it a number of times and I'm surprised nobody else has said anything yet. A much simpler and faster approach (although speed is of least importance here) would have been to use "isnum".

Besides that, it seems like you don't even understand regex that well because your provided pattern has a fair amount of useless overhead. For example why are you capturing matching results if you're not going to do anything with them elsewhere in the code? The 'g' modifier also has no application here. You might want to view some tutorials before using it further as well as note when it may or may not be the most practical solution.
Posted By: RoCk Re: easter egg - 15/11/07 04:58 AM

Originally Posted By: schaefer31

I'm surprised nobody else has said anything yet.


Maybe others have mentioned it to him... in private where it would be more appropriate. whistle
Posted By: Lpfix5 Re: easter egg - 15/11/07 08:32 AM
Way to bash,... does it even matter it does what it does and who cares. I used to post scripts without regex in it and people would post exactly what I wrote with regex in it, take a look back.

Seem's that everytime I have a good idea of concept either someone is mad or angry.

You should never bash if someone does actually work. And keep your mind outside the box
Posted By: jaytea Re: easter egg - 15/11/07 12:09 PM
$inrect() would've been even simpler :P but i agree, people shouldn't just jump to regex to solve their problems but should consider the suitability of other methods first. it'll improve your scripting logic!
Posted By: qwerty Re: easter egg - 15/11/07 12:44 PM
Quote:
does it even matter it does what it does and who cares
I'm afraid it does matter. Good scripting practice should be encouraged, and that's not 'elitist' or anything: even if something "does what it does", it may not do it fast enough or clearly/cleanly enough. More importantly, even if in a specific case there is no perceivable difference between a good and a not-so-good solution, that doesn't mean that there would be no difference in similar cases in the future.

Quote:
I used to post scripts without regex in it and people would post exactly what I wrote with regex in it
So? This is not a "use regex for everything or don't use it at all" situation. If somebody once told you "use a saw to cut that tree, not a knife", you wouldn't then use a saw to cut meat, bread etc would you? Perhaps you should be putting some more thought as to which cases warrant the use of regex and which don't.
Posted By: schaefer31 Re: easter egg - 15/11/07 07:16 PM
Originally Posted By: Lpfix5
You should never bash if someone does actually work. And keep your mind outside the box


It wasn't intended to bash you in any way, and I apologize if that's how you perceived it. I was merely trying to make a suggestion to you. It would only benefit you in the long run. Sometimes it's also best to think inside the box, since everyone else is too busy thinking outside.

Originally Posted By: RoCk
Maybe others have mentioned it to him... in private where it would be more appropriate. whistle


I have to disagree with you there. It's more beneficial to post it here where others can see it, and take note that using regex is not always practical. As qwerty put it, good scripting practice should always be encouraged.
Posted By: RoCk Re: easter egg - 15/11/07 07:36 PM

Originally Posted By: schaefer31

It's more beneficial to post it here where others can see it, and take note that using regex is not always practical.


Perhaps you could have offered a better, non-regex solution to the op and pointed out the fact that regex was not
necessary rather than trash in public someone who seems to prefer using regex more than you, but was actually
offering his help rather than just criticizing someone elses scripting methods which he didn't like.
Posted By: schaefer31 Re: easter egg - 15/11/07 08:02 PM
Originally Posted By: RoCk
Perhaps you could have offered a better, non-regex solution to the op and pointed out the fact that regex was not
necessary rather than trash in public someone who seems to prefer using regex more than you, but was actually
offering his help rather than just criticizing someone elses scripting methods which he didn't like.


I did offer a more practical non-regex solution, and I did point out regex was unnecessary both in the first couple lines. Read my post again smile . And I wasn't bashing him as I already mentioned, I think that's pretty obvious by my choice of words. Again it comes down to good scripting practice. If you don't want to partake in it fine, but you shouldn't be upset if someone criticizes you for it. Perhaps this topic ought to be locked before it gets out of hand.
Posted By: RoCk Re: easter egg - 15/11/07 08:06 PM

Originally Posted By: schaefer31

I did offer a more practical non-regex solution,


You offered criticism, not an alternative solution.

Originally Posted By: schaefer31

Perhaps this topic ought to be locked before it gets out of hand.


It's not your thread, go away and nothing will get out of hand.
Posted By: schaefer31 Re: easter egg - 15/11/07 08:10 PM
I clearly suggested to use "isnum", it's even marked. Just because I didn't directly apply it to the code, doesn't discredit the fact that I didn't offer the solution.

Anyhow, I have a class to go to and I'm not going to sit here and argue this with you. I know what my intentions were. If you want to take them out of context and twist them around, then that is your problem to deal with. The OP has already been answered and this has strayed off topic enough. Adios!
Posted By: Lpfix5 Re: easter egg - 15/11/07 10:34 PM
wow, out of hand. ... chill guys, There's always many ways to write a script. What's to say that by the use of regex in post one person who inquires about regex stumbles across it then uses it to their advantages. It seems for the last 3 months this forum has been nothing but a who can write it better kind of thing.

There should only be a one time post of a script unless there's an error.

Even to the best they sometimes forget the little calls that can not only make the script less lenghty but also more user readable.

I've picked up many scripts and cut down the size on many, I just overly abused regex because I recently learned my way around it a bit.

Like any other thing, just let things go. Instead of bashing one could say here use this instead because regex is not neccesary.

And one OP via this post was right, all comments should go to Private messages and be dealt with personally.
Posted By: hixxy Re: easter egg - 15/11/07 11:13 PM
In general I'd agree that using regex for things like this is a bad idea, but in this instance I think it actually does a good job of hiding the easter egg code grin
Posted By: Lpfix5 Re: easter egg - 16/11/07 12:13 AM
Thanks hixxy hugs for u :P
© mIRC Discussion Forums