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.

Auto-Reply private messages

Old posts that have not been replied to for several years.
Locked
S
Sloop
Halfop
Posts: 44
Joined: Tue Jul 12, 2005 7:04 pm

Auto-Reply private messages

Post by Sloop »

Hi @ll,

I cannot find a script which does following:

When someone sends me a private message, I want my bot to reply after a certain period time (for example after 20 seconds) with pre-defined messages, which randomly will be choosed. I tried the botaway script, it works fine with all my pre-defined away-messages, but the bot does NOT reply to the user, if he gets a private message.

Can someone help?

Tnx in advance,
Sloop
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

If you mean "when someone sends the bot a message" then this should do it:

Code: Select all

# delay time (seconds)
set areply(time) 20

# replies list
set areply(list) {
 "foo"
 "bar"
}

bind msgm - * delayed:reply

proc delayed:reply {nick uhost hand arg} {
 global areply
 utimer $areply(time) [list puthelp "PRIVMSG $nick :[lindex $areply(list) [rand [llength $areply(list)]]]"]
}
S
Sloop
Halfop
Posts: 44
Joined: Tue Jul 12, 2005 7:04 pm

Post by Sloop »

Thanks for the code, but how do I implent that in my eggdrop bot?

I created a new file "autoreplymsg.tcl" in my scripts/ directory and entered your code and altered it with my desired messages.

I logged in with telnet and did .rehash but it doesn't seem to work. When I /msg my bot I don't get a reply??

What am I doing wrong?
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

you probably missed to source scripts/autoreplymsg.tcl in your config
S
Sloop
Halfop
Posts: 44
Joined: Tue Jul 12, 2005 7:04 pm

Post by Sloop »

EDITED: NOW IT WORKS!!! :) MY FAULT, I MESSED SOMETHING UP! ;) TNX AGAIN TO YOU!!!!

No, I DID that. I also attached to your code on the bottom:

putlog "Autoreply to private messages - script loaded"

And when starting eggdrop I get this message as well, that means the script was loaded. But when I send a /msg to my bot I do not get the reply.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

You can also place it in your .conf file, in a new line at the end of the file. To your surprise it will work there as well. :P

Not sure why it doesn't respond, the code looks fine to me. Try replacing "puthelp" with "putquick" if not then, then try removing the utimer and testing it without a utimer.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked