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 

Topic change command

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


Joined: 10 Jan 2006
Posts: 139

PostPosted: Sat Sep 30, 2006 1:55 pm    Post subject: Topic change command Reply with quote

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
View user's profile Send private message
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Sat Sep 30, 2006 2:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
starpossen
Op


Joined: 10 Jan 2006
Posts: 139

PostPosted: Sat Sep 30, 2006 2:08 pm    Post subject: Reply with quote

Thanks will test it later, but how would I make it so only op's and above can use the command?
Back to top
View user's profile Send private message
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Sat Sep 30, 2006 2:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
starpossen
Op


Joined: 10 Jan 2006
Posts: 139

PostPosted: Sat Sep 30, 2006 4:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Sat Sep 30, 2006 6:11 pm    Post subject: Reply with quote

well did you rehash/ restart?
Back to top
View user's profile Send private message
starpossen
Op


Joined: 10 Jan 2006
Posts: 139

PostPosted: Mon Oct 02, 2006 5:01 am    Post subject: Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Oct 02, 2006 11:07 am    Post subject: Reply with quote

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
View user's profile Send private message
starpossen
Op


Joined: 10 Jan 2006
Posts: 139

PostPosted: Mon Oct 02, 2006 3:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
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