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 

Help with a channel protection script.

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Hamish
Voice


Joined: 27 Mar 2006
Posts: 25

PostPosted: Fri May 05, 2006 4:30 pm    Post subject: Help with a channel protection script. Reply with quote

Ok, I've got an autoop channel (everyone is autoop on join)...
Of course I don't want everyone banning each other and changing the topic all the time so I tried to write a script to stop that.
Here what I got so far:

Code:
set Hamish "Hamish"

bind topc - "#hamish *" resetopc:topc
proc resetopc:topc { nick uhost handle channel topic } {
  global Hamish botnick
  if { $nick == $Hamish } { }
  if { $nick == $botnick } { }
  else { puthelp "TOPIC #hamish :(original topic)"
  putlog "Reset topic changed by %nick"
  puthelp "PRIVMSG %NICK :Please don't try to change the topic on this channel..." }
}
  bind mode - * mode_proc_fix
  proc mode_proc_fix {nick uhost hand chan mc {victim ""}} {
    if {$victim != ""} {append mc " $victim"}
    mode_proc $nick $uhost $hand $chan $mc
  }


I've probably done it totally wrong... It is ment to reset the topic if someone other than me changes it... And remove all bans other than ones set by me.
If anyone can help I'd appreciate it, thanks!
_________________
Thanks, Hamish.
Back to top
View user's profile Send private message Send e-mail
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri May 05, 2006 6:59 pm    Post subject: Reply with quote

Code:
bind join - "#hamish *" gettopic
bind topc - "#hamish *" resettopic

proc gettopic {nick uhost hand chan} {
 if {[isbotnick $nick]} {
  set ::currenttopic [topic $chan]
 }
}

proc resettopic {nick uhost hand chan topc} {
 global currenttopic
 if {[isbotnick $nick] || [string equal -nocase Hamish $nick]} {
  set currenttopic $topc
 } {
  putserv "topic $chan :$currenttopic"
  putlog "Reset topic changed by $nick"
  puthelp "privmsg $nick :Please don't try to change the topic on this channel..."
 }
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Hamish
Voice


Joined: 27 Mar 2006
Posts: 25

PostPosted: Sat May 06, 2006 3:48 am    Post subject: Reply with quote

Ah yeah! Works perfectly thanks!
Now I'm gonna try a ban reset-er lol.
_________________
Thanks, Hamish.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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