| View previous topic :: View next topic |
| Author |
Message |
gamer12 Voice
Joined: 14 Aug 2012 Posts: 10
|
Posted: Fri Mar 28, 2014 2:37 pm Post subject: a simple topic script! |
|
|
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 |
|
 |
Sane Voice
Joined: 17 Nov 2013 Posts: 19 Location: #kl-channel@Rizon.net
|
Posted: Sun Jun 08, 2014 12:39 am Post subject: Re: a simple topic script! |
|
|
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 |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Tue Jun 10, 2014 9:31 am Post subject: |
|
|
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 |
|
 |
Sane Voice
Joined: 17 Nov 2013 Posts: 19 Location: #kl-channel@Rizon.net
|
Posted: Sat Jun 14, 2014 6:26 am Post subject: |
|
|
| 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 |
|
 |
|