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 

OnDeop

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


Joined: 03 Apr 2006
Posts: 32

PostPosted: Sat Jul 29, 2006 2:39 pm    Post subject: OnDeop Reply with quote

Hey all,

I'm working with the abuse script that H@0 made, I was looking to make some additions to it like OnDeop and OnBan here's what I have so far..

I'm not 100% sure with the OnDeop or OnBan as I don't know the args or the bind to use =x

Code:
#  abuse user report by H@0 ver 1.0.

  #  configuration

     #  variables

          set validchannel "#reportcentre"
          set abuselogfile "logs/abuse.log"

          if {![info exists validchannel]} {die "ERROR:Check back again in set validchannel settings.."}
          set arg.v "Abuse User Report"

     #  bindings

          bind KICK -   *                   abuse_kick
          bind NEED -   "* -o"              abuse_deop
          bind PUB  n   -history            abuse_report


     #  source (again DO NOT change anything if you are not 100% sure)


     #  process kicked


proc abuse_kick {nick host handle chan who excuse} {
  global abuselogfile botnick validchannel
  if {$who != $botnick} {return 0}
    set data "Info: Kick $botnick by $nick from $chan with excuse ($excuse)"
  if {$abuselogfile != ""} {set r [open $abuselogfile a+]; puts $r "[strftime "%d %b %Y, %H:%M %z"]: $data"; close $r}
    putquick "privmsg $validchannel :Important: (Bot: $botnick) (Action: Kicked) (Channel: $chan) (Reason: $excuse) (User: $nick)"
return 0
}

     #  process deopped

proc abuse_deop {nick uhost handle chan arg} {
  global abuselogfile botnick validchannel
  if {$who != $botnick} {return 0}
    set data "Info: Deop $botnick by $nick in $chan"
  if {$abuselogfile != ""} {set r [open $abuselogfile a+]; puts $r "[strftime "%d %b %Y, %H:%M %z"]: $data"; close $r}
    putquick "privmsg $validchannel :Important: (Bot: $botnick) (Action: Deopped) (Channel: $chan) (User: $nick)"
return 0
}

     #  process report

proc abuse_report {nick host handle channel var} {
global abuselogfile botnick validchannel
set fd [open $abuselogfile r]
set abuselist { }
while {![eof $fd]} {
 set tmp [gets $fd]
 if {[eof $fd]} {break}
  set abuselist [lappend abuselist [string trim $tmp]]
 }
 close $fd
 if {[llength $abuselist] == 0} {
     putserv "privmsg $validchannel :Error: There is no history for $botnick."
      return 0
 }
 putserv "privmsg $validchannel :Log History for $botnick:"
 foreach tmp $abuselist {
   putserv "privmsg $validchannel :$tmp"
 }
putserv "privmsg $validchannel : End of Abuselist\n"
 return 0
}
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Sat Jul 29, 2006 9:33 pm    Post subject: Reply with quote

You may find the IRC/2 Numeric List of some help.

You might also read up on "botisop" in tcl-commands.doc in your bots ~/doc folder.
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
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