Jump to content

Help In Emotion Kicker


Recommended Posts

This code supposed to kick person who make similar 8 emotions , But doesn't work with me what's the wrong???

 

 

#EmoteKicker off 
on *:TEXT:*:*: { 
  if (($nick != $me) && ($nick !isowner #) && ($nick !isop #)) { 
    var %text = $hash($strip($1-),32) 
    var %old.text = %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] 
    var %old.text = $deltok(%old.text,1,46) 
    if (%rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] == $null) || (%old.text != %text) { 
      set -u10 %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] 1. $+ %text 
      return 
    } 
    var %temp = %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] 
    var %count = $gettok(%temp,1,46) 
    inc %count 
    set -u10 %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] %count $+ . $+ %text 
    if (%count >= 8) { 
      /access $chan add deny $address 1440 :FLOODING $nick | /kick $chan $nick NOPE NOT HERE 
    } 
  } 
} 

on *:ACTION:*:*: { 
  if (($nick != $me) && ($nick !isowner #) && ($nick !isop #)) { 
    var %text = $hash($strip($1-),32) 
    var %old.text = %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] 
    var %old.text = $deltok(%old.text,1,46) 
    if (%rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] == $null) || (%old.text != %text) { 
      set -u10 %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] 1. $+ %text 
      return 
    } 
    var %temp = %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] 
    var %count = $gettok(%temp,1,46) 
    inc %count 
    set -u10 %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] %count $+ . $+ %text 
    if (%count >= 8) { 
      /access $chan add deny $address 1440 :FLOODING $nick | /kick $chan $nick NOPE NOT HERE 
    } 
  } 
} 
#EmoteKicker end 

Menu Channel { 
Emote Kicker $upper($group(#EmoteKicker)) 
.Enable: enable #EmoteKicker 
.Disable: disable #EmoteKicker 
}

Link to comment
Share on other sites

Here is one based on a old msn emot per line kicker that should work.

 

The > 8) sets the number of emots they can post in one line. In this instance if it's more than 8 in one line they get booted

 

#EmoteKicker off
on *:TEXT:*:*: {
  if ($nick == $me) || ($nick isop $chan) halt
  if ($calc($wildtok($1-,*,0,41) + $wildtok($1-,*,0,58) - $wildtok($1-,:,0,41)) > 8) {
    /access $chan add deny $address($nick,1) 1 : Emoticon Flood $replace($nick,>,Guest_) added by $replace($me,>,Guest_) at $date @ $asctime(hh:nn:ss)
    /kick $chan $nick Emoticon Flood (ban set for 1 min)
  }
}
on *:ACTION:*:*: {
  if ($nick == $me) || ($nick isop $chan) halt
  if ($calc($wildtok($1-,*,0,41) + $wildtok($1-,*,0,58) - $wildtok($1-,:,0,41)) > 8) {
    /access $chan add deny $address($nick,1) 1 : Emoticon Flood $replace($nick,>,Guest_) added by $replace($me,>,Guest_) at $date @ $asctime(hh:nn:ss)
    /kick $chan $nick Emoticon Flood (ban set for 1 min)
  }
}

#EmoteKicker end

Menu Channel {
  Emote Kicker $upper($group(#EmoteKicker))
  .Enable: enable #EmoteKicker
  .Disable: disable #EmoteKicker
}

Link to comment
Share on other sites

Guest Travis

I noticed the code halts when the event is looking for all text. When you do this it will not process any other text event in any other file with 2 exceptions that I know about.

 

1. any text event with the prefix ^

2. a text event in a file that's $script number is closer to 0.

if ($script($script) > $script(otherfile.mrc)) the text event should execute

 

/halt

The /halt command halts a script and prevents any further processing.

 

Halt is usefull in raw events and such to halt status echo's. If I want a script to stop but I want other scripts to continue processing, I use /return.

 

As a rule if I use the wildcard * in an common event like text, I do not use halt. Unless, of course it is indeed my intention to halt all scripts as in a theme script.

 

Also, look into Event Prefixes. It is more efficient to use them.

 

on !*:text:*:#:{ }

The ! means "if ($nick = $me) return"

@ means, "if ($me !isop $chan) return"

 

Whenever you use code that does functions that need a hammer, like kicking or changing a mode, you should make sure you are an op in the channel. Using a prefix makes this very easy.

 

 

 

on !@*:TEXT:*:*: {
  if ($nick isop $chan) return
rest of code
}

Link to comment
Share on other sites

maybe i'm misunderstanding you..

 

you are saying if i were to just do

 

on *:TEXT:*:#: { halt }

 

in one file and in one after that in another file after the first loaded file with the halted on text like

 

on *:TEXT:*:#: {

.msg $chan $1-

}

 

The second wouldn't work?

 

i was under the impression that the halt inside a snippet of code only applied to that snippet

 

i could very well be wrong but i assumed that by halting it would just stop processing in that snippet like

 

<start processing>

on text * {

halt

<stop processing this script>

do stuff here

}

<resume processing>

 

am i wrong in this thinking?

Link to comment
Share on other sites

Guest Travis

Exclamation prefix was an example. You are right but I was using the event he was familiar with,

 

Error, the way I understand it is that you receive an event.

 

First priority, unless using a socket to connect, is mIRC.

Next priority is any script using the ^ prefix for that event.

Next priority is the first matching event in the first file starting from file 1.

If I have 3 files and each has a text event like this.

 

on *:text:*:#:echo -s $script

 

It is my understanding that:

 

$script(1) text event will perform first.

$script(2) text event second

$script(3) text event third, etc.

 

Now understand the event you are capturing is * meaning anything. If the text event in $script(1) says halt, it halts that event. So then $script(2) wouldn;t have the chance of processing it.

 

This is the way it seemed to me from my experience if I am wrong please let me know. It can easily be tested I'm just lazy. This happens when you specify * for the match text.

 

 

 

Link to comment
Share on other sites

I have used halts in multiple on text * events and never had one not process because i halted on another. halts have always worked on per snippet basis for me unless dealing with mirc default messages. Fanfare is correct in the nick == me.. i overlooked that when i copied the line

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...