egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

On text Script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Football
Master


Joined: 26 Dec 2008
Posts: 205
Location: Quakenet, #Football

PostPosted: Sat Mar 19, 2011 6:44 am    Post subject: On text Script Reply with quote

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.
Back to top
View user's profile Send private message
Madalin
Master


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Thu Jan 31, 2013 4:55 pm    Post subject: Reply with quote

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:

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"
         }
      }
   }
}

_________________
https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber