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.

Script to relay a Single User.

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
g
gamer12
Voice
Posts: 10
Joined: Tue Aug 14, 2012 6:58 pm

Script to relay a Single User.

Post by gamer12 »

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.
User avatar
Madalin
Master
Posts: 310
Joined: Fri Jun 24, 2005 11:36 am
Location: Constanta, Romania
Contact:

Post by Madalin »

Test this and tell me if this is what you wanted

Code: Select all

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"
		}
	}
}
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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

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.
g
gamer12
Voice
Posts: 10
Joined: Tue Aug 14, 2012 6:58 pm

thanks!

Post by gamer12 »

yes it worked fine! thanks both of you!
Post Reply