| View previous topic :: View next topic |
| Author |
Message |
starpossen Op
Joined: 10 Jan 2006 Posts: 139
|
Posted: Sat Sep 30, 2006 1:55 pm Post subject: Topic change command |
|
|
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: |
#===========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? |
|
| Back to top |
|
 |
cache Master
Joined: 10 Jan 2006 Posts: 306 Location: Mass
|
Posted: Sat Sep 30, 2006 2:06 pm Post subject: |
|
|
Am still learning tcl I think this should work.
| Code: |
#
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
#
|
|
|
| Back to top |
|
 |
starpossen Op
Joined: 10 Jan 2006 Posts: 139
|
Posted: Sat Sep 30, 2006 2:08 pm Post subject: |
|
|
| Thanks will test it later, but how would I make it so only op's and above can use the command? |
|
| Back to top |
|
 |
cache Master
Joined: 10 Jan 2006 Posts: 306 Location: Mass
|
Posted: Sat Sep 30, 2006 2:21 pm Post subject: |
|
|
| by changing the bind depending what flag you give ops to use the bot... example o flag change bind pub - to bind pub o |
|
| Back to top |
|
 |
starpossen Op
Joined: 10 Jan 2006 Posts: 139
|
Posted: Sat Sep 30, 2006 4:59 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
cache Master
Joined: 10 Jan 2006 Posts: 306 Location: Mass
|
Posted: Sat Sep 30, 2006 6:11 pm Post subject: |
|
|
| well did you rehash/ restart? |
|
| Back to top |
|
 |
starpossen Op
Joined: 10 Jan 2006 Posts: 139
|
Posted: Mon Oct 02, 2006 5:01 am Post subject: |
|
|
I rehashed, didnt change anything, I restarted still the same.
This is what I have, but still everyone can do it:
| Code: |
#
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? |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon Oct 02, 2006 11:07 am Post subject: |
|
|
Yep, use "o" (or "o|o" to allow local ops to use it aswell) as flag, not "o-"
| Code: | ...
bind pub o|o !up pub_up
... |
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
starpossen Op
Joined: 10 Jan 2006 Posts: 139
|
Posted: Mon Oct 02, 2006 3:21 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
|