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.

[repeat code] need a change in an action check

Old posts that have not been replied to for several years.
Locked
User avatar
dotslasher
Halfop
Posts: 62
Joined: Sun Aug 10, 2003 8:10 pm

[repeat code] need a change in an action check

Post by dotslasher »

Code: Select all

#---------------------------------------------------------------------------------------------
# ACTION repeating (channel actions)
#---------------------------------------------------------------------------------------------
proc repeat_action {nick uhost hand dest keyword text} {
  global botnick altnick repeat_last repeat_num repeatkick repeatmsg repeatban repeatbantime repeatonoff inuse timercalled
  if {$repeatonoff([string tolower $dest]) == 0 } { return }
  set type ""
  set text [trimctrl $text]
  if {$dest == $botnick || $dest == $altnick || [matchattr $hand f|f $dest]} {return 0}
  if [info exists repeat_last([set n [string tolower $nick]])] {

      # Tell other bots I'm handling (or check to see if its being handled.
      set canprocess [check_handling 0]
      if {$canprocess == 1} { return 1 }

      set inuse 1     
      if {[string compare [string tolower $repeat_last($n)] [string tolower $text]] == 0} {
            set type "EXACT MATCH"
            repeat_dostuff $nick $uhost $hand $dest $text $n $type
            set repeat_last($n) $text
            clear_handling
            return
         } \
         elseif {[mask_check $n $text [string tolower $repeat_last($n)]] == 1} {
            set type "Mask check FAIL"
            repeat_dostuff $nick $uhost $hand $dest $text $n $type
            set repeat_last($n) $text
            clear_handling
            return
         } \
         elseif {[letter_check $n $text $dest [string tolower $repeat_last($n)] 1 ""] == 1} {
            set type "Letter check FAIL"
            repeat_dostuff $nick $uhost $hand $dest $text $n $type
            set repeat_last($n) $text
            clear_handling
            return
         } 
      if {$timercalled == 1} {
         catch {unset repeat_last}
         catch {unset repeat_num}
         set timercalled 0
      }
      set inuse 0
      
      # Clear "Im handling" botflags
      clear_handling
  }
  set repeat_num($n) 1
  set repeat_last($n) $text
}
script comes from: http://www.egghelp.org/tclhtml/3478-4-0 ... oleman.htm

now here is the question: i was wondering what i should change for the script to stop kicking/checking for amsgs/ame, and only check for repeats per channel. Cus i dont wanna kick/ban on an /amsg or when some1 goes away and it does an /ame with his away reason.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

unbind repeat_action
User avatar
dotslasher
Halfop
Posts: 62
Joined: Sun Aug 10, 2003 8:10 pm

Post by dotslasher »

hehe its not that simple, i still want it to kick for repeat actions in a single chan, i just want it to allow amsgs because it sees an amsg to 3 chans where the script is activated as a repeat.

lil example:

#chan1
[07:01] *person tests his amsg
#chan2
[07:01] *person tests his amsg
#chan3
[07:01] *person tests his amsg
[07:01] *Eggdrop kicks person from #chan3 (reason: No repeating)

---> 3 repeats according to the script
this would have to be allowed.


now the following thing has to be disallowed.
#chan1
[07:01] *person tests his amsg
[07:01] *person tests his amsg
[07:01] *person tests his amsg
[07:01] *Eggdrop kicks person from #chan1 (reason: No repeating)

i hope i made myself clear this time :)
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

on the contrary - it's that simple

your repeat_action proc binds to CTCP, that is, /ame and /amsg; I presume there is another handler proc for public channel messages

therefore, unbinding repeat_action will eliminate repeat check/punishment for /ame and /amsg only
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

oops... disregard my previous posting, I now see what you mean
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

you need to keep repeat info on per channel basis, in different arrays

but this script seems naive to me, it doesn't have repeat timer/settings; I'd suggest you find another, properly implemented - there should be no shortage of antirepeat scripts, 90% of them would be crap, but still there must be good ones
User avatar
dotslasher
Halfop
Posts: 62
Joined: Sun Aug 10, 2003 8:10 pm

Post by dotslasher »

well i'm using repeat.tcl (netbot version) but this version had a nice warning/kick/ban (3strike) procedure.

btw it does have timers
Locked