This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Dictionary.com script (finished/final)

Support & discussion of released scripts, and announcements of new releases.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

>> You've embedded unescaped control-codes to handle the bold rather than the proper escape sequence \002. Synonyms and antonyms suffer from this.

Ahh ok.. As I recall, trying to use escape codes in a regsub using the & subs, doesn't work, hence having to use embedded code (which I generally dislike and avoid, however it didn't work for this case, iirc.)

>> This directly stems from using *.tcl.txt to name the script, the browser will display these itself.

Actually, dandy.net has a badly configured webserver, their mime-types is not right, so if I did not use the .txt extension, your browser would get text anyway, but cooked/line-wrapped (their server sends a lot of stuff as text, regardless of extension. Getting them to fix it is an exercise in futility - it took months for them to even add .rar as a compressed archive type to their mime-types, despite many email complaints about the problem from me. Ever have a webserver send binary data as text? It's not pretty and you can't save it.) Browsers depend on the Content-Type string sent by the server, they don't generally rely on file extensions to determine anything. If Apache's default is content-type - ascii, you'll get cooked [edit] content, for every file extension not specifically defined in the sever's mime-types [edit2] which would mean even those embedded control codes (bolds) would be cooked. so if you did try saving it, it would be broken. So, yes, the simple solution is to either download the script by right-clicking the link, or download from the tcl archive.

>> Calling windrop inferior rather than investigate your own code is just silly.

I view tcl & eggdrop as primarily unix based, so any incompatibilities between the scripts I write for linux/tcl/eggdrop, and windrop, are beyond my control. Feel free to adapt the script to suit your platform. I don't think its fair to blame my script, which is written to the best standards of my abilities (which may not be saying much) for platform-specific problems on platforms I don't use or test on (nor for which tcl & eggdrop were designed.)

I always recommend windows users to install cygwin, if they want a genuinely unix-like environment (short of installing linux or bsd.) And that remains my solution to any platform-specifc problems such as this :)
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

rosc2112 wrote:>> You've embedded unescaped control-codes to handle the bold rather than the proper escape sequence \002. Synonyms and antonyms suffer from this.

Ahh ok.. As I recall, trying to use escape codes in a regsub using the & subs, doesn't work, hence having to use embedded code (which I generally dislike and avoid, however it didn't work for this case, iirc.)
Despite my better judgement for helping you, most likely your problem stemmed from you trying it with curly braces and not quotes.

Code: Select all

regsub -all -nocase "<b>.*?</b>" $dcsynon "\002&\002" dcsynon
Should work correctly.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

strikelight wrote:Despite my better judgement for helping you, most likely your problem stemmed from you trying it with curly braces and not quotes.
It wasn't my problem, as I said, my script works without error for me. Other people can feel free to implement the fix you posted. When crafting this script, I used the regsub manpage provided with tcl, following the "accepted standard."

If you have a personal problem with offering me help (presumably because I "dared" to fix one of your scripts - and posted it according to the rules of the tcl archive with a name indicating it was a modified version, eg, script-version-rosc) you really don't need to.

In fact, given the apparent rising antagonism toward me here, I'll just take a vacation. I have enough bullshit in real life.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

strikelight wrote:Despite my better judgement for helping you, most likely your problem stemmed from you trying it with curly braces and not quotes.
It wasn't my problem, as I said, my script works without error for me. Other people can feel free to implement the fix you posted. When crafting this script, I used the regsub manpage provided with tcl, following the "accepted standard."

If you have a personal problem with offering me help (presumably because I "dared" to fix one of your scripts - and posted it according to the rules of the tcl archive with a name indicating it was a modified version, eg, script-version-rosc) you really don't need to.

In fact, given the apparent rising antagonism toward me here, I'll just take a vacation. I have enough bullshit in real life. 99% of the posts here are either faqs, users who can't be arsed to read documentation, or requests for spam, warez or mirc scripts, so my participation has naturally dwindled anyway.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

I'm not going to turn this into a thread of flames... But allow me to just make a couple of comments and corrections to your previous post.
rosc2112 wrote:
strikelight wrote:Despite my better judgement for helping you, most likely your problem stemmed from you trying it with curly braces and not quotes.
It wasn't my problem, as I said, my script works without error for me. Other people can feel free to implement the fix you posted. When crafting this script, I used the regsub manpage provided with tcl, following the "accepted standard."
What you quoted me saying was infact in response to a direct quote of you acknowledging something not working for you (& with escaped codes). Thus, by definition, you had a "problem".
rosc2112 wrote: If you have a personal problem with offering me help (presumably because I "dared" to fix one of your scripts - and posted it according to the rules of the tcl archive with a name indicating it was a modified version, eg, script-version-rosc) you really don't need to.
Actually, according to the "rules of the land", you must seek permission from the original author first.

That's all I have to say.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Code: Select all

# above code
regsub -all -nocase {(?:<b>|</b>)} $dcsynon "\002" dcsynon

# below code
regsub -all -nocase {<b>.*?</b>} $dcsynon {*control-code 002 is embedded here*&*control-code 002 is embedded here*} dcsynon
@rosc2122, I've got to wonder, why in all honesty you would use the below code when the above code serves the same purpose? Sometimes when your too used to overcoming obstacles with minimalistic coding in mind, you overlook the most simplistic and rational answer. Not to cause problems but surely even you can see that even the most talented, brilliant scripter would suffer to a degree if they don't constantly heed the advice from those they feel are less apt...right? What that means is even a genius can forget to use a curly brace at times (and shall we all once, or even a gazillion times) and you will get reminded by someone new to the language (a newb) that you simply forgot a brace somewhere. Because of their closeness with the early syntax of tcl, this catches their eye. To someone already adept in tcl, these simple rules can sometimes be easily overlooked and forgotten... These are reminders, not harrassment, don't take advice the wrong way.

While you may prefer linux, someone else may prefer windows. Now where we go from here should be always the same. But the way you script appears always biased for linux (purposely using code that breaks on windrop), and then you tout to others how they should fully install cygwin (pfft). To me I see this as a game for you to attract new users or zealots such as yourself to linux. All this in uneccessary to run a simple eggdrop with some simple tcl scripts, so give these windrop users a break, kthx..
a
anotheregglover
Voice
Posts: 38
Joined: Thu Jan 13, 2005 12:01 am
Contact:

Post by anotheregglover »

Erm...hi! :)


Bit of a problem with this script, when I type .dict blahblah, it just tells me that it's looking it up, and then it says 'no results found for 'blah' in any of the active dictionaries', I've tried specifying dictionaries, etc....Thoughts?
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Presumably the website changed again. I'll have a look and post a fix. Might be a while, I don't have a shell to test from right now.
Post Reply