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 

Simple !topic changing~

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


Joined: 25 Dec 2010
Posts: 27

PostPosted: Mon Mar 28, 2011 12:03 pm    Post subject: Simple !topic changing~ Reply with quote

Hi guys!

Me and my fellows was discussing an idea the other night. The usual "!topic <new topic>" is a feature that probably exists in hundreds of forms. However, we are looking for a small refinement. Say you want to _add_ something to the topic without deleting the previous topic.

Baseline. Say we have a variable %separator to set within the .TCL script, which is per default "|". Now, if I do "!t This will be our topic" the bot will simply change topic on its whole (on the channel where the command is executed, of course). Furthermore, now say that another authorized (+o) person drops "!ta Also checkout www.egghelp.org for cool scripts" (where !ta is short for "topic/add"), then the bot simply changes the topic to "This will be our topic | Also checkout www.egghelp.org for cool scripts".

You guys feel my baseline here? Wouldn't be _too_ complicated to make a script that has these two commands (!t and !ta) and listens to +o users only, right? Would be much appreciated if some bored out scripter could help us out here.

Cheers!
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Mon Mar 28, 2011 1:14 pm    Post subject: Re: Simple !topic changing~ Reply with quote

Just thinking....

First, post whatever you have now... your current working script that will change the topic.

Next -
Explore the options available in your server's Chanserv.
Possibly '/msg chanserv help' or '/msg chanserv help topic' and look closely for another option topicappend or maybe appendtopic or even
topicprepend (I've seen all three).

You are looking to see if Chanserv even offers some sort of option to append to the current topic.

I'm thinking that with seeing what you have now, that works, and presuming there is a command available to append to current topic, - that you could do something with editing the commands in your current script.
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Mar 28, 2011 1:34 pm    Post subject: Reply with quote

Something like this should do the trick, I suppose:
Code:
bind pub o|o "!ta" pubAddTopic
set topicSeparator " | "
proc pubAddTopic {nick host handle channel text} {
  if {[topic $channel] != ""} {
    puthelp "TOPIC $channel :[topic $channel]${::topicSeparator}${text}"
  } else {
    puthelp "TOPIC $channel :$text"
  }
}


Be adviced that this code does not check the length of the new topic...
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Gewan
Voice


Joined: 25 Dec 2010
Posts: 27

PostPosted: Mon Mar 28, 2011 3:28 pm    Post subject: Reply with quote

@willyw:
To be frank, I have (had*) nothing until just now. I searched egghelp TCL archive and tclscriptsdotcom and some other place with and search string "topic" and it yielded tons of hits. Also, since I'm not sure if any of these were copyrighted or anything, I didn't dare to just copy/paste any of their codes in here. Instead, I thought I'd start from scratch, since it feels like a quite simple function to implement.

Thanks a lot nml375!
Your code works perfectly well!

Any chance that anyone can fill in a little section for "!t" (change/override topic), I tried modifying the !ta section by free hand, but I'm too lousy with scripting to make it work. Sorry! :/

Again, thanks!
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Mar 28, 2011 3:30 pm    Post subject: Reply with quote

Code:
bind pub o|o "!t" pubTopic
proc pubTopic {nick host handle channel text} {
  puthelp "TOPIC $channel :$text"
}

_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Gewan
Voice


Joined: 25 Dec 2010
Posts: 27

PostPosted: Mon Mar 28, 2011 3:38 pm    Post subject: Reply with quote

Script works like a charm!
Many thanks (again) nml375.

Case closed! Very Happy
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