egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Testing script before starting eggdrop ?

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Danko
Voice


Joined: 09 Mar 2006
Posts: 18

PostPosted: Wed Mar 22, 2006 11:35 am    Post subject: Testing script before starting eggdrop ? Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Mar 22, 2006 11:53 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Fri Mar 24, 2006 1:39 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
sKy
Op


Joined: 14 Apr 2005
Posts: 194
Location: Germany

PostPosted: Mon Mar 27, 2006 8:36 pm    Post subject: Reply with quote

There is no need to let the bot crash every time. Smile
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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber