This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

newb question, wildcard in command variable?

Help for those learning Tcl or writing their own scripts.
Post Reply
r
rayvtirx
Voice
Posts: 16
Joined: Mon May 31, 2010 9:35 am
Location: bristol,england
Contact:

newb question, wildcard in command variable?

Post by rayvtirx »

how would i use wildcards in the command to post this txt file?
so i could type e.g fadfsjoke and have it work
i tried adding * and it then requires me to type *joke lol

Code: Select all

set bfile "scripts/joke.txt"

#sets the command it should go on off in a chan or so
set cmd "joke"

#this is where you set where the file should be printed out
#private = 0
#channel = 1
set bwhere 1

## don't edit below this line -----------------------------------
bind pub -|- $cmd dumpfile
proc dumpfile {nick handle host chan text } {
global bfile bwhere
set foo [open $bfile r]
while { ! [eof $foo] } {
        set line [gets $foo]
                if {!$bwhere} {
                puthelp "NOTICE $nick :$line"
                } else {
                puthelp "NOTICE $chan :$line"
                }
        }
}
is there something easy i could do to implement this?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Tried 'bind pubm' instead?
Once the game is over, the king and the pawn go back in the same box.
r
rayvtirx
Voice
Posts: 16
Joined: Mon May 31, 2010 9:35 am
Location: bristol,england
Contact:

Post by rayvtirx »

oh my :oops: goodness lol
thank you v much works a treat
i didnt think it would be that simple :D
Post Reply