maketcl

By mentalglitch on May 14, 2008

NOTE!!: This is NOT an eggdrop tcl if you 'source scripts/maketcl.tcl' you will most likely crash your eggy. This script requires that tclsh 8.5 be installed.

The proper way to use this script is as follows :
This script can be used stand-alone by running 'tclsh maketcl.tcl' which will open a terminal window and ask for the required params " <"header">", or can be executed by:
'tclsh maketcl.tcl <"header">.' which will just create the file and close terminal window itself. no manual input would be required.
To use this script with eggdrop place maketcl.tcl into your scripts directory and use the following code: 'exec tclsh maketcl.tcl <"header">'
I.E: tclsh maketcl.tcl test mentalglitch 1.0 "Test tcl file." would create the file test.tcl and insert text: #### Test Tcl File., Version: 1.0, Created by: mentalglitch.

i made this due to several friends asking for an easier way to create tcl files rather then opening notepad saving as *.tcl etc.

### make Tcl, Version: 1.0, Created by: mentalglitch

package require Tcl 8.5

set argv [split $argv]
if {[llength $argv] == "0"} {
 puts "Please insert the following params..\n <filename> <creator> <version> <\"header\">"
 gets stdin params
 set params [split $params]
 while {[llength $params] < "4"} {
  puts "Invalid params:\n<filename> <creator> <version> <\"header\">"
  gets stdin params
  set params [split $params]
 }
} else {
 set params [split $argv]
}

if {![string match "*.tcl" [set file [lindex $params 0]]]} {set file $file.tcl}

set fid [open $file w]
puts $fid "#### [join [lrange $params 3 end]], Version: [lindex $params 2], Created by: [lindex $params 1]"
close $fid

unset params

Comments

Sign in to comment.
mentalglitch   -  May 14, 2008

oh as a side note. i don\'t care what you do with the code. modify it to your liking. if you have any questions just send me a msg here on hawkee.com and I\'ll be glad to help. weather its modifying this for full use with an eggdrop or whatever.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.