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.

topic script

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
d
dumbro
Voice
Posts: 8
Joined: Sun May 21, 2006 12:24 am

topic script

Post by dumbro »

i tryed to find... i tryed to edit myself... but i cant find this..

Eggdrop set topic to something... i do like !set topic bleubleu * bleubleu....

when i write !topic testing , the eggdrop change it to bleubleu testing bleubleu ....
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

Code: Select all

bind o|o !settopic settopic
bind o|o !topic topicchange

proc settopic {nick uhost hand chan topic} {
   set ::topicproto($chan) $topic
   return 1
}

proc topicchange {nick uhost hand chan topic} {
   if {[info exists ::topicproto($chan)]} {
      if {[botisop] || [botishalfop]} {
         putserv "TOPIC $chan :[string map [list * $topic] $::topicproto($chan)]"
         return 1
      } else {
         puthelp "NOTICE $nick :Sorry, I don't have ops."
      }
   } else {
      puthelp "NOTICE $nick :You must set the prototype with !settopic first."
   }
   return 0
}
Notes:
if the prototype contains more than one *, every * will be replaced with the same argument. However, you can replace the the * with any other character. You could even use a non readable character or a string like "INSERT HERE".
The prototype gets reset on every restart (not rehash) of the bot, since the array is not saved to disc ^-^.
Change o|o to what every priviliges it should be limited to.
Script is untested and might therefore contain either typos or stupid logical mistakes :).
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
d
dumbro
Voice
Posts: 8
Joined: Sun May 21, 2006 12:24 am

Post by dumbro »

thx very much! your great guys :)
Post Reply