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 

Random part messages

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
MrBeta
Voice


Joined: 28 Dec 2013
Posts: 16
Location: The World

PostPosted: Fri Jul 06, 2018 5:00 am    Post subject: Random part messages Reply with quote

Hello,
I'm looking for a script that sends random messages to each channel part, I need at least 10 different messages to send to users (not together, of course) when they leave the room.
The ones I found allow only one default message

thx Wink
Back to top
View user's profile Send private message Visit poster's website
simo
Master


Joined: 22 Mar 2015
Posts: 251

PostPosted: Sat Jul 07, 2018 3:35 pm    Post subject: Reply with quote

check out https://tclarchive.org/search.php?Greet

ive seen some there for the greet on part as well
Back to top
View user's profile Send private message
MrBeta
Voice


Joined: 28 Dec 2013
Posts: 16
Location: The World

PostPosted: Sun Jul 08, 2018 11:14 am    Post subject: Reply with quote

Yes, I found a French TCL for info and messages on part
Back to top
View user's profile Send private message Visit poster's website
caesar
Ass Kicker


Joined: 14 Oct 2001
Posts: 3489
Location: Area 51

PostPosted: Tue Jul 24, 2018 2:33 am    Post subject: Reply with quote

I know this is a bit late..
Code:

set partMessages {
   "message 1"
   "message 2"
   "message 3"
   "message 4"
   "message 5"
   "message 6"
   "message 7"
   "message 8"
   "message 9"
   "message 10"
}

bind part - * part:message

proc part:message {nick uhost hand chan msg} {
   if {[isbotnick $nick]} return
   global partMessages
   set no [expr [rand [llength $partMessages]] - 1]
   set message [string map [list %nick $nick %chan $chan] [lindex $partMessages $no]]   
   puthelp "PRIVMSG $nick :$message"
}

in your messages you can use %nick and %chan that will get replaced with actual values, so you could get something like "Thanks for visiting %chan channel %nick. Have a nice day!" to be turned into "Thanks for visiting #friends channel John. Have a nice day!"

Keep in mind that this works for all channels, so if you want to have it active just for a few before:
Code:

if {[isbotnick $nick]} return

add:
Code:

if {![channel get $chan partMsg]} return

and before:
Code:

bind part - * part:message

add:
Code:

setudef flag partMsg

Restart the bot and then all you have to do is get on Telnet/DCC Chat with the bot and .chanset #channel +partMsg where #channel is the actual name of the channel you want this active. Replace #channel with another to activate it there too.

Honestly I would implement user's throttled function to prevent getting the bot flood itself off the network. Here's and older post for another function where I used the throttled function.
_________________
You may say anything about me, but at least don't misspell my name. xD
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests 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