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.

Random part messages

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
MrBeta
Voice
Posts: 35
Joined: Sat Dec 28, 2013 2:16 pm
Contact:

Random part messages

Post by MrBeta »

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:
s
simo
Revered One
Posts: 1069
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

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

ive seen some there for the greet on part as well
User avatar
MrBeta
Voice
Posts: 35
Joined: Sat Dec 28, 2013 2:16 pm
Contact:

Post by MrBeta »

Yes, I found a French TCL for info and messages on part
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I know this is a bit late..

Code: Select all

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: Select all

if {[isbotnick $nick]} return
add:

Code: Select all

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

Code: Select all

bind part - * part:message
add:

Code: Select all

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.
Once the game is over, the king and the pawn go back in the same box.
Post Reply