I don't use the date and time identifiers very often, I thought $gmt returned a value in a hh:nn:ss format but I see now it doesn't :P I tested it by changing the date of my PC to 26/3/12 (day after the clocks go forward an hour here) and it returned the correct value, but I've just realised it didn't change the time automatically when I did it that way, so yeah you don't need $daylight :P
A simple:
alias pst { return $asctime($calc($gmt - (8 * 86400)),hh:nn:ss) }
Will do :P
Cheers
WorldDMT: I've done it that way because I see little point in specifying an ascii number when you can just put the actual character in the parameters. For example, say I have a variable called %text.#hawkee.hixxy, it's easier to use $vget(text.,$chan,.,$me) than it is to have to specify the ASCII number!
Which part of my documentation isn't clear enough?
This is the part of my documentation that shows the code examples:
1)
exec VBScript $&
While MsgBox("Do you like my snippet?", vbYesNo) <> vbYes $crlf $&
Wend
2) echo -a $exec(VBScript, Now)
This is how you used the script:
var %code = exec VBScript $&
While MsgBox("Do you like my snippet?", vbYesNo) <> vbYes $crlf $&
Wend
echo -a $exec(VBScript, %code)
That is nothing like what my documentation says.
Feel free to provide constructive criticism of my documentation and/or the script itself. So far your claims are baseless.
I have no idea why that regsubex shortcut is so popular when it can only support small channels. Mircs string limit is 4000 and something chars, so that script wouldn't work in a 100 user channel if everyone had nicknames only 5 characters long. A lot of nicks are longer than that, so in reality it will crap out on considerably smaller channels.
Just use a while loop. It may be longer but it's more suitable for the task at hand. We should never sacrifice functionality just to have a smaller script.
Here's my take (supports both nickmodes and channel modes):
on @*:input:#:{
if ($regex($1,/^[+-][ $nickmode ]/x)) {
if ($2 !ison $chan) { echo 4 User $qt($2) is not currently on the channel. }
else { mode $chan $1- }
}
elseif ($regex($1,/^[+-][ $remove($chanmodes,$chr(44)) ]/x)) { mode $chan $1- }
}
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
FiberOPtics, qwerty and jaytea - the three scripters I respect the most and recognise as the best.
Shame FO quit a long time ago and I rarely see qwerty these days! :-(
But yeah, snippets on this website really do get lower scores than on other sites. I think it's because this site has more of a "social" feel to it.
dialog Whois {
title \"Dialog\"
size -1 -1 296 206
option dbu
text \"Nick:\", 1, 4 6 12 8
combo 2, 30 5 157 10, drop
text \"Address:\", 3, 4 18 21 8
edit \"\", 4, 30 17 157 10
text \"Name:\", 5, 4 62 16 8
edit \"\", 6, 30 61 157 10
text \"Modes:\", 7, 4 74 19 8
edit \"\", 8, 30 73 157 10
text \"IP:\", 9, 4 86 8 8
edit \"\", 10, 30 85 157 10
text \"Away:\", 15, 4 133 15 8
edit \"\", 16, 30 132 157 21, multi
edit \"\", 17, 30 155 157 10
text \"Registered\", 11, 4 184 30 8
text \"Server:\", 12, 4 121 19 8
edit \"\", 18, 30 120 157 10
text \"\", 19, 4 195 94 8
text \"Help\", 20, 37 184 30 8, center
text \"Secure\", 21, 69 184 30 8, center
text \"Sign In:\", 22, 4 110 23 8
text \"Sign Out:\", 29, 4 110 22 8
edit \"\", 23, 30 108 157 10
text \"Idle:\", 24, 4 156 11 8
button \"E&xit\", 25, 256 191 37 12, ok
text \"Not found in /whois or /whowas listings\", 26, 30 18 102 8
edit \"\", 28, 30 167 157 10
list 30, 193 97 100 80, size
text \"0 Common out of 0 Channels:\", 31, 193 86 98 8
text \"0 Clones detected:\", 32, 193 6 98 8
list 33, 193 17 100 66, size
text \"DNS:\", 34, 4 98 13 8
edit \"\", 35, 30 97 157 10
radio \"Kill\", 13, 4 35 22 8, group
radio \"K-Line\", 14, 4 46 25 8
radio \"Z-Line\", 27, 30 46 25 8
radio \"G-Line\", 36, 56 35 25 8
radio \"Shun\", 37, 30 35 22 8
radio \"GZ-Line\", 38, 56 46 28 8
}
I\'ve given the dialog a little breathing space so it\'s not all shoved together, and I\'ve also aligned your controls so that the left/right/top/bottom borders line up on your dialog. It might sound fussy, but something simple like lining up your controls makes a world of difference to the presentation of your dialog.
I\'m not saying it\'s perfect, but I think it\'s a lot less cluttered and more organised. It\'s up to you whether you use it or not but hopefully you\'ll be able to see the improvements I\'ve made.
Seeing as RoninWarrior didn\'t say what was wrong with your alignment, I\'ll have a go:
You have a list of editboxes going down the dialog, but they\'re all different sizes, which means that they\'re not aligned on the right hand side. Make them all the same width, so that they start at the same point on the left and end at the same point on the right. Even if you don\'t need all of that space for the boxes, it\'s space that is otherwise going unused, so there\'s no problem with using up a bit more space to make the dialog look that little bit neater.
Your \"Exit\" button is not in line with the combo box next to it. It\'s 1 or 2 pixels up from it.
Your \"Common Channels\" box could line up with the bottom of the \"Away\" box and the top of the \"Idle\" box, and if you add a little bit of whitespace you could also make the \"Name\" box line up with your \"Clones\" box at the top.
The \"Registered\" text is not in line with the rest of the text down the left hand side of your dialog.
I\'m going to try and reposition everything in your dialog to show you how I think it should look, I\'ll post it later.
I don\'t think this will particularly benefit anyone, including newbies, for the simple reason being that it doesn\'t many events and some of the features in it are broken. The dialog is far too big for its purpose and it\'s kinda awkward to work with. For example; why make people press the \"Choose new event\" button to pick another instead of just letting them?
Anyway, not bad for one of your first scripts I guess, but I think it has a lot of room for improvement.