mIRC Home    About    Download    Register    News    Help

Topic Options
#229833 - 17/02/11 11:37 PM Flood control is conflicting with script
ohaithar Offline
Ameglian cow

Registered: 18/01/11
Posts: 34
Code:
on *:text:*:#mychan: {
  if (%flood) { return }
  set -u5 %flood On
  if ($nick isvoice $chan) || ($nick ishop $chan) || ($nick isop $chan) {
    if ($1 == .vent) || ($1 == !vent) .notice $nick 4Host/Ip:4 ***************1 4Port number:1 ****1
    elseif ($1 == @vent) msg $chan 4Host/Ip: *************** 4Port number:1 ****
  }
}


This is a script that displays ventrillo info for my chan. I don't know why but as long as

Code:
if (%flood) { return }
  set -u5 %flood On 
is in this script it refuses to work, but otherwise it's fine. Can anyone help me to get it working because i know there will be some trouble makers that will try and flood me off the irc

Top
#229835 - 17/02/11 11:48 PM Re: Flood control is conflicting with script [Re: ohaithar]
hixxy Offline
Hoopy frood

Registered: 06/09/05
Posts: 2876
The problem is that you're setting %flood whenever anybody says anything in a channel. You need to put set -u5 %flood On inside your if statements like this:

Code:
on *:text:*:#mychan: {
  if (%flood) { return }
  if ($nick isvoice $chan) || ($nick ishop $chan) || ($nick isop $chan) {
    if ($1 == .vent) || ($1 == !vent) { 
      set -u5 %flood on 
      .notice $nick 4Host/Ip:4 ***************1 4Port number:1 ****1
    }
    elseif ($1 == @vent) {
      set -u5 %flood on
      msg $chan 4Host/Ip: *************** 4Port number:1 ****
    }
  }
}

Top
#229836 - 18/02/11 12:07 AM Re: Flood control is conflicting with script [Re: hixxy]
ohaithar Offline
Ameglian cow

Registered: 18/01/11
Posts: 34
Hmm it's still refusing to work for me. I have another script that's fairly identical and it works no problem.

Code:
on *:TEXT:*:#mychan: { 
  if (%flood) { return }
  set -u5 %flood On
  if ($nick == example1) || ($nick == example2) && ($1- == example3) || ($1- == example4) || ($1- == example5) msg $chan $read(example1.txt)
  elseif ($1- == example6) || ($1- == example8) || ($1- == example7) msg $chan $read(example2.txt)
}




Edited by ohaithar (18/02/11 12:08 AM)

Top
#229837 - 18/02/11 12:29 AM Re: Flood control is conflicting with script [Re: ohaithar]
Tomao Offline
Hoopy frood

Registered: 07/07/07
Posts: 1129
Loc: United States
This should work and you can do it more efficiently with $istok
Code:
on *:TEXT:*:#mychan: { 
  if (!%flood) {
    set -u5 %flood On
    if ($istok(example1 example2,$nick,32)) {
      if ($istok(example3 example4 example5,$1,32)) {
        msg $chan $read(example1.txt)
      }
      elseif ($istok(example6 example7 example8,$1,32)) {
        msg $chan $read(example2.txt)
      }
    }
  }
}

Top
#229838 - 18/02/11 12:35 AM Re: Flood control is conflicting with script [Re: Tomao]
ohaithar Offline
Ameglian cow

Registered: 18/01/11
Posts: 34
Tomao could you incorporate that into my first script
Code:
on *:text:*:#mychan: {
  if (%flood) { return }
  set -u5 %flood On
  if ($nick isvoice $chan) || ($nick ishop $chan) || ($nick isop $chan) {
    if ($1 == .vent) || ($1 == !vent) .notice $nick 4Host/Ip:4 ***************1 4Port number:1 ****1
    elseif ($1 == @vent) msg $chan 4Host/Ip: *************** 4Port number:1 ****
  }
}


that second one was just my example of the other one that's working.

Top
#229839 - 18/02/11 12:39 AM Re: Flood control is conflicting with script [Re: ohaithar]
Tomao Offline
Hoopy frood

Registered: 07/07/07
Posts: 1129
Loc: United States
You first one can be written as follows:
Code:
on $*:text:/^([.!@])vent$/iS:#mychan: {
  if (!%flood) && ($nick !isreg $chan) {
    set -u5 %flood On
    $iif($regml(1) == @,msg $chan,notice $nick) 4Host/Ip: *************** 4Port number:1 ****
  }
}


Top
#229840 - 18/02/11 12:50 AM Re: Flood control is conflicting with script [Re: Tomao]
ohaithar Offline
Ameglian cow

Registered: 18/01/11
Posts: 34
I just tried that one too and it still refuses to respond. I'm not sure whats going on. frown

Top
#229841 - 18/02/11 12:58 AM Re: Flood control is conflicting with script [Re: ohaithar]
Tomao Offline
Hoopy frood

Registered: 07/07/07
Posts: 1129
Loc: United States
You need to be at least a halfop or op or above to trigger the script. I thought that was what your initial code had indicated. Place the code in a new remote and make sure your remote is on by entering: /remote on

Top
#229842 - 18/02/11 12:59 AM Re: Flood control is conflicting with script [Re: ohaithar]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
Most likely, you have a %flood variable that is set. /unset %flood and try again. It's also a very good idea to use unique variable names that are not likely to appear anywhere else. For example, %vent.flood or something.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#229843 - 18/02/11 01:02 AM Re: Flood control is conflicting with script [Re: Tomao]
ohaithar Offline
Ameglian cow

Registered: 18/01/11
Posts: 34
Oh, sorry i need it to activate if the person is a voice, hop or op.

Top
#229844 - 18/02/11 01:05 AM Re: Flood control is conflicting with script [Re: Riamus2]
ohaithar Offline
Ameglian cow

Registered: 18/01/11
Posts: 34
Lol your right Riamus2, i changed it to %flood.vent and its working now smile. I'm so stupid lol thanks alot to everyone.

Top
#229845 - 18/02/11 01:10 AM Re: Flood control is conflicting with script [Re: ohaithar]
Tomao Offline
Hoopy frood

Registered: 07/07/07
Posts: 1129
Loc: United States
I think it'd better you use a dynamic variable. When one script is triggered before %flood.vent's expiration, you won't be able to make another script to respond to you until it's been unset in 5 seconds. This is to assume that you've applied %flood.vent to all the triggers of your scripts.
Code:
on $*:text:/^([.!@])vent$/iS:#MyChan: {
  if (!$(,$+(%,..,flood,..,$chan,..,$cid,..,$network,..,$nick))) && ($nick !isreg $chan) { 
  set -u5 $+(%,..,flood,..,$chan,..,$cid,..,$network,..,$nick) on
    $iif($regml(1) == @,msg $chan,notice $nick) 4Host/Ip: *************** 4Port number:1 ****
  }
}


Edited by Tomao (18/02/11 01:30 AM)

Top
#229846 - 18/02/11 01:15 AM Re: Flood control is conflicting with script [Re: Tomao]
ohaithar Offline
Ameglian cow

Registered: 18/01/11
Posts: 34
yeah, that will help a lot, thank you. smile

Top
#229847 - 18/02/11 01:25 AM Re: Flood control is conflicting with script [Re: ohaithar]
Tomao Offline
Hoopy frood

Registered: 07/07/07
Posts: 1129
Loc: United States
ohaithar, I made a mistake. Please copy it again.

Top
#229848 - 18/02/11 03:51 AM Re: Flood control is conflicting with script [Re: Tomao]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
Lol. Specific enough? smile

Just my opinion, but most flood control for a specific script works well just to have it only allow the command once every X seconds, no matter who uses it. For those, using different variables for each flood check (vent being just for this vent check) is fine. There are times when you want it to allow "everyone" (no limit in other words) to use the command at once, but only allow each person to use it one time every X seconds. For those situations, including $nick in the timer name is very useful. In the first situation, it really isn't necessary. And I really can't see any need to include $cid and probably 99% of the time, $network isn't all that useful and 90% of the time, $chan isn't very useful. But, again, that's just my opinion. It won't hurt to have all of that (or more). smile

As a note, Tomao's flood control would still let you be flooded off of the server. If 10 voiced users all type .vent at once, you're going to get kicked, unless the network is very relaxed in the number of lines per second they allow from someone.


Edited by Riamus2 (18/02/11 03:54 AM)
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#229851 - 18/02/11 06:10 AM Re: Flood control is conflicting with script [Re: Riamus2]
Tomao Offline
Hoopy frood

Registered: 07/07/07
Posts: 1129
Loc: United States
Yes, Riamus2 has a valid point. Go back to the one using %vent.flood var. It's more suitable. We can't be too careful these days.

Top