04-27-2017, 12:59 +0200
AuthorPost
Turbo  06-17-2007, 15:31   | Load script MSN  Homepage
Moderator
Member since 06/2007
5 Posts
Location: Netherlands
                                                                                                                              
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
set lflags "n"
set lscriptsdir "scripts"
set ltrigger "!"

bind pub $lflags ${ltrigger}load load:file


proc load:file {nick host hand chan text} {
    global lscriptsdir  ltrigger
    set file [lindex [split $text] 0]
    if {$file == ""} {
        putserv "PRIVMSG $nick :-(Load)- ${ltrigger}load <scriptname.tcl> -(Info)-"
        return 0
    } elseif {![file exists [file join $lscriptsdir $file]]} {
        putserv "PRIVMSG $nick :-(Load)- Sorry $file doesn`t exists -(Info)-"
        return 0
    } else {
        set kbsize [expr {[file size [file join $lscriptsdir/$file]] / 1024.0}]
        if {[catch {uplevel "source [file join $lscriptsdir $file]"} error]} {
            putserv "PRIVMSG $nick :-(Load)- Script: $file Size: $kbsize Kb Status: Error -(Info)-"
            putserv "PRIVMSG $nick :-(Load)- $error -(Info)-"
        } else {
            putserv "PRIVMSG $nick :-(Load)- Script: $file - Size: $kbsize Kb - Status: OK -(Info)-"
        }
    }
}


You need to set the lscriptsdir to your own dir
You can also change the lflags to whatever you want

Example: your trigger is "!"

!load tcldebug.tcl

when no error found he load the script and rehash

when error found he gives you the error and he don`t load

when he load the scripts and no error found it will be like

Script: tcldebug.tcl - Size: 3 kb - Status: No Error
This post was edited 7 times, last on 08-24-2007, 03:54 by Turbo
Advanced options for this topic:

Ignore this topic (Do not list this topic in the "unread topics" search. You are currently not ignoring this topic.)
Hide this topic (Hidden topics are not displayed in the topics list. This topic is currently not hidden.)
Go to forum

Unclassified NewsBoard 1.5.3-d | © 2003-4 by Yves Goergen