| View previous topic :: View next topic |
| Author |
Message |
Danko Voice
Joined: 09 Mar 2006 Posts: 18
|
Posted: Wed Mar 22, 2006 11:35 am Post subject: Testing script before starting eggdrop ? |
|
|
Is there any way to test a script (that it wont crash the egg etc) ?
Atm I'm editing script, rehashing eggdrop, editing again, etc etc..
This works, but I feel its a waste of time, re-starting the eggdrop every time it crash...... huh..? |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Wed Mar 22, 2006 11:53 am Post subject: |
|
|
Enclose the code within catch.
| Code: | catch {
#code here
} |
and use .set errorInfo to see errors. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Fri Mar 24, 2006 1:39 pm Post subject: |
|
|
I personally use this little script to load my scripts:
| Code: | # # # # # # # # #
# .loadtcl
#
bind dcc n loadtcl loadtcl
proc loadtcl {hand idx args} {
if {$args == {{}}} {
set args $::lasttclloaded
} else {
set ::lasttclloaded $args
}
uplevel #0 [list source scripts/$args.tcl]
return 1
} |
This will simply "rehash" a single script, very fast and very usefull imho.
ex.:
If you want to rehash 'scripts/google.tcl' just type:
.loadtcl google
If you get something like '[18:28:57] #De_Kus# loadtcl google' loading was successfull, else you should see the TCL error (if not disabled on console).
ex.:
.loadtcl idonotexist
[18:38:42] Tcl error [loadtcl]: couldn't read file "scripts/idonotexist.tcl": no such file or directory _________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
| Back to top |
|
 |
sKy Op

Joined: 14 Apr 2005 Posts: 194 Location: Germany
|
Posted: Mon Mar 27, 2006 8:36 pm Post subject: |
|
|
There is no need to let the bot crash every time.
Use the 'saved source' command, errorInfo and backtraces. Should be enugh help. Enjoy. =)
http://forum.egghelp.org/viewtopic.php?t=10291 _________________ socketapi | Code less, create more. |
|
| Back to top |
|
 |
|