egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

putnotc $nick help

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
xmods
Voice


Joined: 08 Sep 2010
Posts: 3

PostPosted: Sat Jan 15, 2011 12:02 am    Post subject: putnotc $nick help Reply with quote

im trying to change this script to notice nic instead on msg channel, when i change putmsg $channel "\002$tellnick\002: ($dbfact) $out1" to putnotc $nick "\002$tellnick\002: ($dbfact) $out1" it only notices the nic sending the command

it's the faq.tcl i just changed all the rest with putnotc $nick so people can't flood the chan and it goes specifically to the nic it's ment for
Code:

proc faq:tell_fact {nick idx handle channel args} {
   global faq
   if { [lsearch -exact [split [string tolower $faq(channels)]] [string tolower $channel]] < 0 } {
      return 0
   }
   if {$faq(status)==1} {
      putnotc $nick "The faq-database is \002closed\002."
      return 0
   }
   if {![file exist $faq(database)]} {
      set database [open $faq(database) w]
      puts -nonewline $database ""
      close $database
   }
   set tellnick [ lindex [split [join $args]] 0 ]
   set fact [ string trim [ string tolower [ join [ lrange [split [join $args]] 1 end ] ] ] ]
   if {$tellnick == ""} {
      putnotc $nick "Syntax: [string trim $faq(cmdchar)]faq \002nick\002 keyword"
      return 0
   }
   if {$fact == ""} {
      putnotc $nick "Syntax: [string trim $faq(cmdchar)]faq nick \002keyword\002"
      return 0
   }
   set database [open $faq(database) r]
   set dbline ""
   while {![eof $database]} {
      gets $database dbline
      set dbfact [ string tolower [ lindex [split $dbline [string trim $faq(splitchar)]] 0 ] ]
      set dbdefinition [string range $dbline [expr [string length $fact]+1] end]
      if {$dbfact==$fact} {
         if {[string match -nocase "*$faq(newline)*" $dbdefinition]} {
            set out1 [lindex [split $dbdefinition "$faq(newline)"] 0]
            set out2 [string range $dbdefinition [expr [string length $out1]+2] end]
            putmsg $channel "\002$tellnick\002: ($dbfact) $out1"
            putmsg $channel "\002$tellnick\002: ($dbfact) $out2"
         } else {
            putmsg $channel "\002$tellnick\002: ($dbfact) $dbdefinition"
         }
         putlog "FAQ: Send keyword \"\002$fact\002\" to $tellnick by $nick ($idx)"
         close $database
         return 0
      }
   }
   close $database
   putnotc $nick "I don't have the keyword \002$fact\002 in my database."
   if {[matchattr $handle [string trim $faq(glob_flag)]|[string trim $faq(chan_flag)] $channel]} {
      putnotc $nick "You could add \002$fact\002 by using [string trim $faq(cmdchar)]addword \002$fact\002[string trim $faq(splitchar)]Definition goes here."
   } else {
      putnotc $nick "If you're looking for a TCL-Script try http://www.egghelp.org/cgi-bin/tcl_archive.tcl?strings=$fact"
   }
   return 0
}
Back to top
View user's profile Send private message
username
Op


Joined: 06 Oct 2005
Posts: 196
Location: Russian Federation, Podolsk

PostPosted: Sat Jan 15, 2011 5:28 am    Post subject: Reply with quote

Code:
            putnotc $tellnick "\002$tellnick\002: ($dbfact) $out1"
            putnotc $tellnick "\002$tellnick\002: ($dbfact) $out2"

_________________
Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber