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.

Changed part of the topic from another channel

Old posts that have not been replied to for several years.
Locked
d
d4rk
Voice
Posts: 1
Joined: Wed Apr 27, 2005 7:17 am

Changed part of the topic from another channel

Post by d4rk »

Hello, I'm new here.

I would ask you, if there's a script that makes the bot change only one part of the topic depending on that part of the topic in another channel?
I mean, there's a game server channel. The server is often down, and then it's stated on the channel as "DOWN!". I'm looking for a script for a bot that would be on that channel and every time topic would change to "DOWN!" it would change the topic on my channel to "OFFLINE". Of course its only the part of the topic. The "OFFLINE" word isn't the whole topic set on the channel.

I hope you have understood me.

P.S.: Sorry for my bad English.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Code: Select all

bind topic - "*" check:topic

proc check:topic {nick uhost hand chan text} {
 if {[string equal -nocase "#chan1" $chan] && [botisop #chan2] && [string match -nocase "*DOWN!*" $text]} {
  putserv "TOPIC #chan2 <your_topic_here>"
  }
}
Replace #chan1 with the channel where you want the topic to be detected (DOWN!)
Replace #chan2 with the channel where the topic will be changed (OFFLINE)
Replace <your_topic_here> with the new topic you want to set on #chan2
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

http://www.tcl.tk/man/tcl8.4/TclCmd/regsub.htm
this it command that can change substrings. usage is like:

Code: Select all

regsub {(Status: \003).{6,9}\003} $topic "15,1down\003" newtopic
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Locked