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.

Topic change command

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
s
starpossen
Op
Posts: 139
Joined: Tue Jan 10, 2006 1:08 am

Topic change command

Post by starpossen »

I have the PubModes.tcl script
And there is a command for changing topic
But I want it to have 2 topics
like if I type:
!siteup
It will change the topic to something like The Site Is UP
and
!sitedown
It will change the topic to something like The Site Is Down

this is a snippet from the pubmodes.tcl

Code: Select all

#===========topic============

proc modes:topic {nick userhost handle  chan text} {
set topic $text
if {$topic != ""} {
     putserv  "TOPIC $chan :$topic"
 }
}
I was thinking if this could be modified to please my needs
or if a new script is needed?
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

Am still learning tcl I think this should work.

Code: Select all

#
proc pub_siteisup {nick uhost hand chan rest} {
    putserv "TOPIC $chan :The Site is up!"
    return 0
  }
bind pub - !siteup pub_siteisup
#
proc pub_siteisdown {nick uhost hand chan rest} {
    putserv "TOPIC $chan :The Site is down!"
    return 0
  }
bind pub - !sitedown pub_siteisdown
#

s
starpossen
Op
Posts: 139
Joined: Tue Jan 10, 2006 1:08 am

Post by starpossen »

Thanks will test it later, but how would I make it so only op's and above can use the command?
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

by changing the bind depending what flag you give ops to use the bot... example o flag change bind pub - to bind pub o
s
starpossen
Op
Posts: 139
Joined: Tue Jan 10, 2006 1:08 am

Post by starpossen »

Doh, my bad I actually knew this about flags, maybe im just tired hehe, but thanks anyway, and I havent tested it yet, but will do so soon.

*EDIT*
It works but I put in o but still every one can use the command.
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

well did you rehash/ restart?
s
starpossen
Op
Posts: 139
Joined: Tue Jan 10, 2006 1:08 am

Post by starpossen »

I rehashed, didnt change anything, I restarted still the same.
This is what I have, but still everyone can do it:

Code: Select all

#
proc pub_up {nick uhost hand chan rest} {
    putserv "TOPIC $chan :Site Up"
    return 0
  }
bind pub o- !up pub_up
#
proc pub_down {nick uhost hand chan rest} {
    putserv "TOPIC $chan :Site Down"
    return 0
  }
bind pub o- !down pub_down
# 
Any ideas?
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Yep, use "o" (or "o|o" to allow local ops to use it aswell) as flag, not "o-"

Code: Select all

...
bind pub o|o !up pub_up
...
NML_375
s
starpossen
Op
Posts: 139
Joined: Tue Jan 10, 2006 1:08 am

Post by starpossen »

Ohh.. my bad, hehe lack of sleep again, but thank you guys, its working, will think of more stuff to add, after I read some more.
Post Reply