A quine is a piece of code that, when executed, outputs its own source. There are a number of ways to create quines in mIRC script; the most apparent methods are those that have a sort of self referential component such as $isalias().alias, $read($script, n, $scriptline), or $timer($ctimer).com. A little more interesting are quines without an obvious such component, an example of which is given below.
; Copy & Paste this and enter it into a window's editbox to experience the quine-ness!
//echo $iif($( //echo $!iif($( $v1 ,),$(,$v1)) ,),$(,$v1))
A nice little example of how quine's can be useful. A rejoin-on-kick timer, that tries to rejoin then reactivates itself if not on the channel you were kicked from:
on *:KICK:#:{
if ($knick == $me) {
$+(.timerRejoin:,$cid,:,#) 1 10 if ($me !ison # ) $chr(123) join # $(|) $!+(.timer,$ctimer) 1 10 $!timer($ctimer).com $chr(125)
}
}
I've noticed a lot of Jaytea's work to be proof-of-concept, which is perfectly fine and acceptable for a snippet post, by my standards. Showing people new ways to do things, or how to do things they didn't even KNOW they could do on mIRC, is part of the idea behind having a section on Hawkee dedicated to mSL in the first place, I would assume.
And I did learn something! I never knew quine was a word. =P
It's not supposed to be a useful script.. not all code snippets have to be useful guys. mIRC scripting is a hobby for most people, so developing things that are challenging, albeit useless, is quite fun.
This is a prime example of such a snippet.
Nice work jaytea! A quine is one of the few things I've never been able to figure out on my own :P
Conscious, if you don't see the point in this then that's fine, by all means ignore it. there are many other scripts on this site that are likely to interest you and that you can focus your efforts on instead. if your point was to suggest that i refrain from posting these sorts of snippets in the future, then i'm afraid i'm not persuaded :P
hah [Plornt], sorry, i did make it a bit cryptic! if it helps, here's the same line with proper syntax:
//echo $iif($eval( //echo $!iif($eval( $v1 , 0),$eval($v1, 2)) , 0),$eval($v1, 2))
Ohai Conscious,
Before messaging me on IRC about this script expecting me to go ape sht and call it useless etc with you. Please understand what it is actually doing instead of showing me examples you have made that "achieve the same thing" when they dont do the slightest. Its supposed to message its source so your $($1-,0) wont work mainly because that only returns $1- which is not its source.
Anyway let me try and figure out how this one works (fulleh) as its a proper mind fuck >.>