| View previous topic :: View next topic |
| Author |
Message |
gamer12 Voice
Joined: 14 Aug 2012 Posts: 10
|
Posted: Thu Apr 25, 2013 2:15 am Post subject: Script to relay a Single User. |
|
|
I am searching for a script which can relay a single user only. The ones I have found are the ones which relays the whole channel.
For eg,
I have added Xyz@192.168.1.1 to the list and the bot only relays what 'XYZ' says on a channel to a different channel.
<XYZ> The CUZ is going to have lunch.
I want this line to be relayed without the nick and with the bold/colors etc like,
The CUZ is going to have lunch.
Any help in this case will be highly appreciated.
Thanks. |
|
| Back to top |
|
 |
Madalin Master

Joined: 24 Jun 2005 Posts: 310 Location: Constanta, Romania
|
Posted: Thu Apr 25, 2013 11:04 am Post subject: |
|
|
Test this and tell me if this is what you wanted
| Code: |
bind PUBM - * pub_random
set temp(to) "#to"
set temp(allow) {
"nick1"
"nick2"
}
proc pub_random {nick mask hand channel arg} {
global temp
foreach n $temp(allow) { if {[string tolower $nick] == [string tolower $n]} {
putquick "PRIVMSG $temp(to) :$arg"
}
}
}
|
_________________ https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Thu Apr 25, 2013 2:15 pm Post subject: |
|
|
He asked for a user@host match, not a nick one, not to mention that you could use lsearch instead of the foreach loop.
| Code: |
set relayList [list "user@host.com" "*@blah.net" "Xyz@192.168.1.1"]
bind PUBM - * relayPubm
proc relayPubm {nick uhost hand chan text} {
if {[lsearch -glob $::relayList "$uhost"]!=-1]} {
puthelp "PRIVMSG #relay_channel :$text"
}
}
|
Btw, it's healthy to break the loop in case of a match and use puthelp and leave putquick for other important stuff. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
gamer12 Voice
Joined: 14 Aug 2012 Posts: 10
|
Posted: Fri Apr 26, 2013 11:47 am Post subject: thanks! |
|
|
| yes it worked fine! thanks both of you! |
|
| Back to top |
|
 |
|