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 

a simple topic script!

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


Joined: 14 Aug 2012
Posts: 10

PostPosted: Fri Mar 28, 2014 2:37 pm    Post subject: a simple topic script! Reply with quote

Hello fellow eggdroppers!

Need a script which adds and deletes selected text on topic!

for example,

If I type !add XYZ - the bot changes/adds the topic without deleting anything which is still on the topic and announces that 'XYZ is on the topic now'

and I type !del XYZ - it deletes only the text i asked for and announces 'XYZ has been removed'.

and only users with +o status on eggdrop can do that.

any help will be appreciated. Thanks
Back to top
View user's profile Send private message
Sane
Voice


Joined: 17 Nov 2013
Posts: 19
Location: #kl-channel@Rizon.net

PostPosted: Sun Jun 08, 2014 12:39 am    Post subject: Re: a simple topic script! Reply with quote

Hi, gamer12.

Sorry that I cannot be of more help than this but:

On certain networks I'm pretty sure that there's an 'append' and a 'prepend' topic command which can do some of what you wanted. For e.g., '.TOPICAPPEND' or is it '.APPENDTOPIC', regardless-- if you use one of those commands with 'text' after it, it would add that 'text' at the end of the current topic without changing or deleting anything that's currently there already; it just adds to it. The same thing applies to "prepend" except it would add that text to the beginning of the current topic without changing or deleting anything that's currently there.

Some examples:

- .appendtopic TextHere
- .topicappend TextHere
- .append topic TextHere
- .topic append TextHere

The bind could actually be: a '.' or an '!', or even an '@' symbol; who knows? It really depends on the network.

- .prependtopic TextHere
- .topicprepend TextHere
- .prepend topic TextHere
- .topic prepend TextHere

Now, I'm not 100% percent sure which combination is the correct one but I know one of them will work.

Hope this helps somewhat.

You should check out the ChanServ/NickServ/BotServ/HostServ etc.. etc.. commands of the network(s) that you frequent to find out more information on which are available to you.
Back to top
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1032
Location: France

PostPosted: Tue Jun 10, 2014 9:31 am    Post subject: Reply with quote

Sorry Sane, but replying with a server-side potential option is a bad answer imho.

@gamer12: here is a small example of script, without securities or any improved check.
Code:
bind pub o|o "!tadd" topic:append
bind bub o|o "!tdel" topic:remove

# Appends a text to the current topic
proc topic:append {nick uhost handle chan text} {
   set topic "[topic $chan] $text"
   putserv "TOPIC $chan :$topic"
   return 0
}

# Removes a text from a topic, whenever the text
# is located in the topic
proc topic:remove {nick uhost handle chan text} {
   set topic [topic $chan]
   regsub -- $text $topic "" topic
   putserv "TOPIC $chan :[string trim $topic]"
   return 0
}

_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
Sane
Voice


Joined: 17 Nov 2013
Posts: 19
Location: #kl-channel@Rizon.net

PostPosted: Sat Jun 14, 2014 6:26 am    Post subject: Reply with quote

Yeah, I see where you're coming from but it was just a quick and simple fix until someone else wrote or posted an exact script for it.
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