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.

help echo script

Help for those learning Tcl or writing their own scripts.
Post Reply
h
harry1
Voice
Posts: 2
Joined: Sun Feb 26, 2006 1:46 pm

help echo script

Post by harry1 »

i have already a script who make echo of some word but il would like to make an echo of only certain nickname(with usernane on irc) .can someone could put an line in my script for that please?

exemple : if roger (~Tatian4@*******abo.*****.fr) says hello it will make on echo on my second chan.

sorry i'm french and my englsih is very bad

Code: Select all

# Liste des mots à intercepter (séparé par des espaces)
set wordlist "bla bla joli merde "

# Chan où le bot capture ls phrase selon les mots
set chan1 "#w****"

# Chan ù le bot enverra les phrases
set chan2 "#z**"

bind pubm -|- "* *" capture:word

proc capture:word {nick host hand chan arg} {
   if { [string tolower $chan] != [string tolower $::chan1] } { return 0 }
   
   foreach word $::wordlist {
      if { [lsearch -exact $arg $word] > -1 } {
         puthelp "PRIVMSG $::chan2 :\[$nick\] $arg"
         break
      }
   }
   
   return
}
Moderator edit: added 'code' .. please check Things to do before posting..
C
Caribou
Voice
Posts: 28
Joined: Thu Apr 15, 2004 12:51 pm
Location: France

Post by Caribou »

Salut, je suis français aussi :D

Je pense que tu peux rajouter un foreach avec une deuxieme liste mais cette fois une liste de nom à intercepter, en reprenant le principe de ton script, mais uniquement le pseudo ou le host aussi compte ?
(I think you can add another foreach with a second list but this time for the names to intercept, reusing the same system for words, but you want only names or hosts too ?)

Uniquement le pseudo ça donnerait :
(Only the nickname will make : )

Code: Select all

# Liste des mots à intercepter (séparé par des espaces) 
set wordlist "bla bla joli merde"

# Liste de noms à intercepter (séparé par des espaces) 
set namelist "roger pierre patrice"

# Chan où le bot capture ls phrase selon les mots 
set chan1 "#w****" 

# Chan ù le bot enverra les phrases 
set chan2 "#z**" 

bind pubm -|- "* *" capture:word 

proc capture:word {nick host hand chan arg} { 
  if { [string tolower $chan] != [string tolower $::chan1] } { return 0 } 

  foreach name $::namelist {
    if { [lsearch -exact $nick $name] > -1 } {
      foreach word $::wordlist {
        if { [lsearch -exact $arg $word] > -1 } { 
          puthelp "PRIVMSG $::chan2 :\[$nick\] $arg" 
          break 
        }
      }
    }
  }

  return

}
h
harry1
Voice
Posts: 2
Joined: Sun Feb 26, 2006 1:46 pm

Post by harry1 »

j aimerai le host name et le nick pour etre sur que c bien le bon gars et avoir le bon echo.car j aimerai vraiment ke ca me copie vraiment toute les frase comportant des mot precis ke les mec disent meme kan eux meme font des echo ou des msg truc du genre.



i'd like the host and the nick to be sure to have the good guys:)

merci

ps: mon autre probleme c que j aimerai me connecter a un server ssl avec mon eggdrop . sqi vous avez une solution aussi :) car me dis requette dns echoue :) merci
Post Reply