| View previous topic :: View next topic |
| Author |
Message |
MrBeta Voice
Joined: 28 Dec 2013 Posts: 35
|
Posted: Fri Jul 06, 2018 5:00 am Post subject: Random part messages |
|
|
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  |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
|
| Back to top |
|
 |
MrBeta Voice
Joined: 28 Dec 2013 Posts: 35
|
Posted: Sun Jul 08, 2018 11:14 am Post subject: |
|
|
| Yes, I found a French TCL for info and messages on part |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Tue Jul 24, 2018 2:33 am Post subject: |
|
|
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. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
|