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.

Bot response to his nickname

Old posts that have not been replied to for several years.
Locked
User avatar
Thunderdome
Op
Posts: 187
Joined: Tue Mar 15, 2005 4:42 pm

Bot response to his nickname

Post by Thunderdome »

Code: Select all

set bnick "bot"

set frases {
{egghelp rules!}
}

bind pub - "$bnick" pub_falar

proc pub_falar {nick uhost hand chan text} {
 global frases
 set frasedizer [lindex $frases [rand [llength $frases]]] 
 putserv "PRIVMSG $chan :1»4»5 $nick 4«1«:2 $frasedizer"
}

This is a nice script for making the egg talk when someone speaks his name... but only works even his name is in the beggining of the sentence. how can I change it in order to work for the name in any place of a sentence?
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

change bind pub - "$bnick" pub_falar to bind pubm - "* $bnick *" pub_falar
User avatar
Thunderdome
Op
Posts: 187
Joined: Tue Mar 15, 2005 4:42 pm

Post by Thunderdome »

erm... I tough of that too....
now it just replies when someone types

Code: Select all

* $nick *
:|

Perhaps it is another way...
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

No, this should reply on "<whatever> bnick <whatever>" so '*' is considered <whatever> too.
User avatar
Thunderdome
Op
Posts: 187
Joined: Tue Mar 15, 2005 4:42 pm

Post by Thunderdome »

erm... weird, but now it works...
perhaps I had copied it wrong or something...


by the way, why pubm and not just pub?

Thanks a lot for the help! :D
/me throws a cold beer! :)
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Read tcl-commands.doc (/doc dir in your eggdrop's dir) about pub and pubm.
Locked