This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

a simple topic script!

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
g
gamer12
Voice
Posts: 10
Joined: Tue Aug 14, 2012 6:58 pm

a simple topic script!

Post by gamer12 »

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
S
Sane
Voice
Posts: 19
Joined: Sun Nov 17, 2013 12:38 am
Location: #kl-channel@Rizon.net

Re: a simple topic script!

Post by Sane »

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.
User avatar
CrazyCat
Revered One
Posts: 1253
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

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: Select all

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
}
S
Sane
Voice
Posts: 19
Joined: Sun Nov 17, 2013 12:38 am
Location: #kl-channel@Rizon.net

Post by Sane »

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.
Post Reply