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 

need help change dcc to pub command

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
uffs
Voice


Joined: 17 Apr 2008
Posts: 14
Location: 6°10.5S-106°49.7E

PostPosted: Sat Jan 17, 2009 1:33 am    Post subject: need help change dcc to pub command Reply with quote

hi..

I found small script to check tcl script before we running "rehash" command.. (to known the scripts error or no)

here's the code
Code:
bind dcc n chk script:load

proc script:load { handle idx text } {
   if { [catch { uplevel #0 [list source scripts/$text.tcl] } error] } {
      putlog "Error While Loading $text -- Errormsg: $error"
      putlog "script: $text -- ::errorInfo: $::errorInfo"
      return
   }
   putlog "script: <$text> -- Loaded Without Error.."
   return
}


how I make those code so it will be running on public command and display the result on the room chan.


Thanks for your help Smile
Back to top
View user's profile Send private message
tomekk
Master


Joined: 28 Nov 2008
Posts: 255
Location: Oswiecim / Poland

PostPosted: Tue Jan 20, 2009 7:44 am    Post subject: Reply with quote

try:
Code:
bind pub -|- chk script_check

proc script_check { nick uhost hand chan arg } {
   set the_name [lindex [split $arg] 0]

   if {[catch {uplevel #0 [list source scripts/$the_name.tcl]} error]} {
      putquick "PRIVMSG $chan :Error While Loading $the_name -- Errormsg: $error"
      putquick "PRIVMSG $chan :script: $the_name -- ::errorInfo: $::errorInfo"
      return
   }

   putquick "PRIVMSG $chan :script: <$the_name> -- Loaded Without Error.."
}

putlog "chk-script.tcl loaded"


Quote:
12:43:11 <@tomekk> chk chk-script
12:43:13 < botty> script: <chk-script> -- Loaded Without Error..


Quote:
12:43:36 <@tomekk> chk chk-script
12:43:36 < botty> Error While Loading chk-script -- Errormsg: invalid command name "}"
12:43:36 < botty> script: chk-script -- ::errorInfo: invalid command name "}"
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests 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