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.
Old posts that have not been replied to for several years.
x
xuser
Post
by xuser » Fri Mar 12, 2004 2:00 am
i need help with a little script, the script works but for all channels and
i want to make it work just for 1 channel, but i made somethig wrong and I don't no where is the mistake
here is the code, maybe you can help me
Code: Select all
set addqpubprefix !
set addqchan "#somethinghere"
set addqfile scripts/questions.txt
#######################################
# THIS IS CODE #
#######################################
if { ![info exists toolbox_loaded] } { source scripts/alltools.tcl }
bind pub - [string trim $addqpubprefix]addquestion addq:pub:addquestion
proc addq:pub:addquestion {nick uhost hand chan arg} {
global addqchan addqfile
if { $arg == "" } {
putnotc $nick "Usage: !addquestion <Question here>"
return 0
}
set file [open $addqfile a]
puts $file "$arg"
close $file
putnotc $nick "Added Question...$arg"
return 1
}
Thanks
CrazyCat
Revered One
Posts: 1359 Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:
Post
by CrazyCat » Fri Mar 12, 2004 4:56 am
Code: Select all
set addqpubprefix !
set addqchan "#somethinghere"
set addqfile scripts/questions.txt
if { ![info exists toolbox_loaded] } {
source scripts/alltools.tcl
}
bind pub - [string trim $addqpubprefix]addquestion addq:pub:addquestion
proc addq:pub:addquestion {nick uhost hand chan arg} {
if {[string tolower $chan] != [string tolower $::addqchan]} {
putserv "NOTICE $nick :You're not in the good channel, try it in $::addqchan"
return 0
}
if { $arg == "" } {
putserv "NOTICE $nick :Usage: !addquestion <Question here>"
return 0
}
set file [open $::addqfile a]
puts $file "$arg"
close $file
putserv "NOTICE $nick :Added Question...$arg"
return 1
}
x
xuser
Post
by xuser » Fri Mar 12, 2004 6:44 am
Ok, it's realy works
Thanks