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.

NASA Launch Schedule Script

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

NASA Launch Schedule Script

Post by rosc2112 »

This script pulls the launch data from NASA's schedule page.

# Commands typed in channel or privmsg (using the default configured command):
# .nasa - show the next launch schedule.
# .nasa 5 - show the next 5 launches.
# .nasa all - show all launches on the schedule (output goes to privmsg)
# .nasa help - show the brief helpfile.

Output format:
Next Launch: Feb. 15 6:07:37 p.m. - FL - THEMIS
URL: http://www.nasa.gov/mission_pages/themi ... index.html
THEMIS will study the dynamic and colorful eruptions of auroras.
Vehicle Type: Delta II rocket
Launch Site : Cape Canaveral Air Force Station launch pad 17-B
--

http://members.dandy.net/~fbn/nasalaunch.tcl.txt
User avatar
ZEXEL
Halfop
Posts: 45
Joined: Tue Jun 27, 2006 10:47 pm
Contact:

Yo!

Post by ZEXEL »

Interesting and original idea..
good works...
:wink: :wink: :wink: :wink: :wink:
.:[ Knowledge Is The Power ]:.
Q
QQleQ
Voice
Posts: 14
Joined: Mon Nov 20, 2006 10:05 pm

Post by QQleQ »

Thanx!

I get an error though:

[23:44] <QQleQ> .nasa
[23:44] <Dinges> Checking NASA Launch Schedule..Please stand by...
thats it

and in the partyline it says:
[23:44] TCL error [nasacmdpub]: wrong # args: should be "lindex list index"

:(

Im running Eggdrop 1.6.8. TCL 8.3.3.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

# When reporting bugs, PLEASE include the .set errorInfo debug info!
# Read: http://forum.egghelp.org/viewtopic.php?t=10215

I get no such errors, I suggest upgrading tcl as 8.3 is an old development version and upgrade eggdrop as 1.6.8 is ancient and no longer supported..

I also need the above set errorInfo if you expect me to know what's actually going on with your system.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

I have a suspicion that older eggdrops/tcl's didn't use a variable in the lindex command, so if you changed [lindex $text 0] to [lindex text 0] it should probably work. You'd have to remove the $ from the other [lindex] commands elsewhere, as well. I counted five of them in the script.. Try that and let me know if that works for you (otherwise, just upgrade.. Be a good idea to upgrade anyway.)

The other idea that occurs to me is that the older versions expected the variable to be a list already, which could be accomplished by using [split] or
  • on the variables in question.. That would take a bit more work, and it's just easier for me if you upgrade rather than me rework the script to work with obsolete and unsupported old versions :P
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

[lindex $text 0] and [lindex text 0] both will work (on older tcl versions and newer) but the difference is that the first one will return the first element in the list called "text" while the second one will always return the word "text."

The error is here:

Code: Select all

set nlmission [lindex $nlmission 2 end]
This probably should be

Code: Select all

set nlmission [join [lrange $nlmission 2 end]]
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Thanks Sir_Fz, one of those late night coding oversights :)

Strangely, despite the lindex/lrange thing, my copy of the script worked, even after doing a restart..Oddness.. Anyway, I'll upload a new copy of the script, but I changed the format of the output some, cos I thought the original was a bit ugly.
Q
QQleQ
Voice
Posts: 14
Joined: Mon Nov 20, 2006 10:05 pm

Post by QQleQ »

Ah yes, it works now, thanx y'all :)
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Oh, you probably don't need [join] since nlmission is supposed to stay a list.
Q
QQleQ
Voice
Posts: 14
Joined: Mon Nov 20, 2006 10:05 pm

Post by QQleQ »

Could someone have a look at this script, the output contains HTML :(
Thanx :)
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

QQleQ wrote:Could someone have a look at this script, the output contains HTML :(
Thanx :)
You'd help more by pasting the output.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Fixed. Same url as above.
R
Roger-Ca
Voice
Posts: 8
Joined: Sun Apr 16, 2006 2:10 pm
Location: California

NASA launch script - no work

Post by Roger-Ca »

Hi,

Eggdrop version 1.6.18

NASA launch script version: 0.01c

I get nothing. The only thing I changed was .nasa to !nasa

thanks in advance
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Post the results (if any) of ".set errorInfo"
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

HTML changed, working on fixing (extensive.) Fix should be posted by tomorrow.
Post Reply