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.

simple "parrot" script

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
s
shixxor
Voice
Posts: 4
Joined: Fri Feb 26, 2010 5:40 pm

simple "parrot" script

Post by shixxor »

hi there,

i need a simple TCL script that just makes the bot repeat what 2 ppl said. for example

[shixxor]: lol
[peter]: lol

then

[eggdrop]: lol



would be cool if you could help me
t
tueb
Halfop
Posts: 76
Joined: Thu Oct 04, 2007 6:09 am
Location: #quiz.de @ irc.gamesurge.net
Contact:

Post by tueb »

Code: Select all

bind pubm - * repeat_pubm
variable lastsaid

proc repeat_pubm {nick host handle channel text} {
global lastsaid
  if {[string equal -nocase $text $lastsaid]} {
     putserv "PRIVMSG $channel :$text"
     set lastsaid $text
  }
}

untested
#Quiz.de @ irc.GameSurge.net
JavaChat
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

tueb:
You'd probably like to have the "set lastsaid $text" line outside of the conditional, otherwize it would never be set in the first place.
Also, you'd better test that the variable exists before attempting to read it..

Code: Select all

bind pubm - * repeat_pubm
variable lastsaid

proc repeat_pubm {nick host handle channel text} {
  global lastsaid
  if {[info exists lastsaid] &&[string equal -nocase $text $lastsaid]} {
    putserv "PRIVMSG $channel :$text"
  }
  set lastsaid $text
}
NML_375
t
tueb
Halfop
Posts: 76
Joined: Thu Oct 04, 2007 6:09 am
Location: #quiz.de @ irc.gamesurge.net
Contact:

Post by tueb »

i agree
#Quiz.de @ irc.GameSurge.net
JavaChat
User avatar
username
Op
Posts: 196
Joined: Thu Oct 06, 2005 9:20 am
Location: Russian Federation, Podolsk
Contact:

Post by username »

I've found this script train.tcl somewhere in french eggdrop site.
Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/
s
shixxor
Voice
Posts: 4
Joined: Fri Feb 26, 2010 5:40 pm

Post by shixxor »

THANK YOU ALL SO MUCH

works perfectly. i <3 u



/closed
Post Reply