mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2011
Posts: 34
O
Ameglian cow
OP Offline
Ameglian cow
O
Joined: Jan 2011
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

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
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 ****
    }
  }
}

Joined: Jan 2011
Posts: 34
O
Ameglian cow
OP Offline
Ameglian cow
O
Joined: Jan 2011
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)
}



Last edited by ohaithar; 18/02/11 12:08 AM.
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
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)
      }
    }
  }
}

Joined: Jan 2011
Posts: 34
O
Ameglian cow
OP Offline
Ameglian cow
O
Joined: Jan 2011
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.

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
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 ****
  }
}


Joined: Jan 2011
Posts: 34
O
Ameglian cow
OP Offline
Ameglian cow
O
Joined: Jan 2011
Posts: 34
I just tried that one too and it still refuses to respond. I'm not sure whats going on. frown

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
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

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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
Joined: Jan 2011
Posts: 34
O
Ameglian cow
OP Offline
Ameglian cow
O
Joined: Jan 2011
Posts: 34
Oh, sorry i need it to activate if the person is a voice, hop or op.

Joined: Jan 2011
Posts: 34
O
Ameglian cow
OP Offline
Ameglian cow
O
Joined: Jan 2011
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.

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
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 ****
  }
}

Last edited by Tomao; 18/02/11 01:30 AM.
Joined: Jan 2011
Posts: 34
O
Ameglian cow
OP Offline
Ameglian cow
O
Joined: Jan 2011
Posts: 34
yeah, that will help a lot, thank you. smile

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
ohaithar, I made a mistake. Please copy it again.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.

Last edited by Riamus2; 18/02/11 03:54 AM.

Invision Support
#Invision on irc.irchighway.net
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
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.


Link Copied to Clipboard