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.

"No such variable" in my script

Old posts that have not been replied to for several years.
User avatar
Thunderdome
Op
Posts: 187
Joined: Tue Mar 15, 2005 4:42 pm

Post by Thunderdome »

"here, if [regexp] doesn't find a match, served won't be set, hence the "No such variable" error on the next line; in TCL, unlike C, every variable must be initialized (with [set] or implicitly by some other commands) before being used "
hence I wrote that

set served ""

"that [regexp], judging by its arguments, needs to be changed to [regsub] "
done that too...
using regsub won't work since I see this

Code: Select all

Soulseek server <html><head><title>slsk serverstatus</title><style>body { font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; font-size : 8pt; color : gray; font-weight: bold; scrollbar-face-color: #ffffff; scrollbar-highlight-color: #efefef; scrollbar-3dlight-color: #ffffff; scrollbar-darkshadow-color: #ffffff; scrollbar-shadow-color: #afafaf; scrollbar-arrow-color: #afafaf; scrollbar-track-color: #ffffff; overflow: auto;}A, A:ACTIVE, A:FOCUS, A:HOVER, A:LINK, A:VIS
in the partyline!

using each one in particular or both together, simply does not work...
shows the line without any info regarding what "served" should bring.

hence, help was given, but it does not work.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Thunderdome wrote: hence, help was given, but it does not work.
it will work when you get a clue on how to strip HTML tags using regexps and fix your code; here's another hint (I won't write the script for you):

Code: Select all

regsub -all -- {<[^>]*>} $html_string "" plain_string
this will strip all characters in-between (and including) < and > brackets in html_string and put the result in plain_string
User avatar
Thunderdome
Op
Posts: 187
Joined: Tue Mar 15, 2005 4:42 pm

Post by Thunderdome »

but you see... did you run the script on an eggdrop?
If you did, you would have notice it does get the info... only from the second time and beyond... so the code for fetching stuff is ok, is does get exactly was is intended...

but it just does not work at the first time in public! but in the partyline it shows the complete info!
I tried to insert your code, but now the relevant info does not show up...
I don't know what do you intend with your code, so I could use a bit more of help...
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

*sigh*

it doesn't work the first time "in public" since you output the result (served) immediately after passing the callback to egghttp, meaning that by the time you issue that NOTICE, your callback proc still hasn't completed (or even invoked), so served is not set

in the public trigger proc, save the inquiring nick in a global variable and then output your NOTICE in the callback, using that variable
User avatar
Thunderdome
Op
Posts: 187
Joined: Tue Mar 15, 2005 4:42 pm

Post by Thunderdome »

it doesn't work the first time "in public" since you output the result (served) immediately after passing the callback to egghttp, meaning that by the time you issue that NOTICE, your callback proc still hasn't completed (or even invoked), so served is not set
I know that from the start, it's pretty obvious, and I already tried to put the notice nick in the callback, but nothing shows up! :\
So I did not know what to do!
You kept talking about how do select the text, so I was not getting what was to be done... The text showed fine... I was not understanding what you meant...
Until I read this line!

in the public trigger proc, save the inquiring nick in a global variable and then output your NOTICE in the callback, using that variable
DONE! I know what I was doing wrong... I used notice nick... but it did not get the nick to notice! Using the global varible, it will get the nick. Thanks!
Works fine...
I can upload the code to egghelp.org if you guys are interessed... also made it to fit Shoutcast servers for info without owning them!
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

your blah is not global, and needs to be set before passing callback to egghttp (I told you to get a clue about the very basics for a reason... now if you'll excuse me, my hints for you on this topic stop here)
Locked