| View previous topic :: View next topic |
| Author |
Message |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Thu Dec 28, 2006 6:26 am Post subject: NASA Launch Schedule Script |
|
|
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/themis/main/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 |
|
| Back to top |
|
 |
ZEXEL Halfop

Joined: 27 Jun 2006 Posts: 45
|
Posted: Thu Dec 28, 2006 8:58 am Post subject: Yo! |
|
|
Interesting and original idea..
good works...
 _________________ .:[ Knowledge Is The Power ]:. |
|
| Back to top |
|
 |
QQleQ Voice
Joined: 20 Nov 2006 Posts: 14
|
Posted: Thu Dec 28, 2006 6:15 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Thu Dec 28, 2006 8:41 pm Post subject: |
|
|
# 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. |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Thu Dec 28, 2006 8:55 pm Post subject: |
|
|
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 [list] 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  |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Dec 28, 2006 9:38 pm Post subject: |
|
|
[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: | | set nlmission [lindex $nlmission 2 end] |
This probably should be
| Code: | | set nlmission [join [lrange $nlmission 2 end]] |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Thu Dec 28, 2006 10:36 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
QQleQ Voice
Joined: 20 Nov 2006 Posts: 14
|
Posted: Fri Dec 29, 2006 9:30 am Post subject: |
|
|
Ah yes, it works now, thanx y'all  |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Dec 29, 2006 9:52 am Post subject: |
|
|
Oh, you probably don't need [join] since nlmission is supposed to stay a list. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
QQleQ Voice
Joined: 20 Nov 2006 Posts: 14
|
Posted: Wed Mar 21, 2007 9:14 am Post subject: |
|
|
Could someone have a look at this script, the output contains HTML
Thanx  |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Wed Mar 21, 2007 10:01 am Post subject: |
|
|
| QQleQ wrote: | Could someone have a look at this script, the output contains HTML
Thanx  |
You'd help more by pasting the output. |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Thu Mar 22, 2007 1:55 am Post subject: |
|
|
| Fixed. Same url as above. |
|
| Back to top |
|
 |
Roger-Ca Voice
Joined: 16 Apr 2006 Posts: 8 Location: California
|
Posted: Sun Jan 20, 2008 11:46 pm Post subject: NASA launch script - no work |
|
|
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 |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Mon Jan 21, 2008 12:36 am Post subject: |
|
|
Post the results (if any) of ".set errorInfo" _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Mon Jan 21, 2008 1:27 am Post subject: |
|
|
| HTML changed, working on fixing (extensive.) Fix should be posted by tomorrow. |
|
| Back to top |
|
 |
|