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.

On text Script

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

On text Script

Post by Football »

Hey, I need quite a simple, yet configurable script that relays when 'on text' messages match on one room to one/more other rooms.

Example

Text matching: *hello* Love* *Spear
* The text matching can be infinte and added via pub message or on the .tcl script itself.

* To what room(s) relay?
* Configure: #Alan, #Tony

<Someone> good morning people. What a lovely day

* bot will relay the whole sentence to #Alan & #Tony

Another example:
<Someone> Spear

Will relay it to #Alan & #Tony

Help please. thanks.
Idling at #Football, Quakenet.
User avatar
Madalin
Master
Posts: 310
Joined: Fri Jun 24, 2005 11:36 am
Location: Constanta, Romania
Contact:

Post by Madalin »

You can add as many channels you want and as many texts to watch. If any text is found it will be relayed to the other channels from temp(chans)

Code: Select all

bind PUBM - * relay:pubm

set temp(chans) {
	"#channel1"
	"#channel2"
}

set temp(msg) {
	"im here"
	"no im there"
}

proc relay:pubm {nick uhost hand chan arg} {
	global temp


	foreach w [split $temp(msg)] {
		if {[string match "*$w*" $arg]} {
			foreach c $temp(chans) {
				putserv "PRIVMSG $c :$arg"
			}
		}
	}
}
Post Reply