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.

i need help whit a script

Old posts that have not been replied to for several years.
Locked
x
xuser

i need help whit a script

Post by xuser »

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 8)
User avatar
CrazyCat
Revered One
Posts: 1359
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

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 »

Ok, it's realy works
Thanks :lol:
Locked