mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Joined: Apr 2014
Posts: 33
B
Ameglian cow
Offline
Ameglian cow
B
Joined: Apr 2014
Posts: 33
in the bot type
/set %banlength 30 for 30 seconds
/set %banlength 300 for 5 minutes
etc

In the remotes click file/new to get a new file. Then file/save as to give it a name to make it easier to track in the future than script6.mrc

Joined: Apr 2014
Posts: 7
R
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
R
Joined: Apr 2014
Posts: 7
Most of this script works right but instead of not allowing normal users it is not allowing anyone to post even mods. Also the !permit command does not seem to be working. Is my script wrong or am i missing something else?

Code:
on 1:TEXT:!permit*:#:{
  if $hget(ops,$nick) == $null /halt
  /set %Linkers %Linkers $chr(124) $+ $$2 $+ $chr(124)) 
  /msg $chan $$2 you have %linkdelay seconds to post a link
  /timer $+ $$2 1 %linkdelay /set %Linkers $remove(%Linkers, $chr(124) $+ $$2 $+ $chr(124) )
}

on 1:TEXT:!regular*:#:{
  if $hget(ops,$nick) == $null /halt
  if $hget(regulars,$$2) {
    /hdel regulars $$2 
    /msg $chan $$2 removed from the list of users permitted to always post links
    /halt
  }
  if !$hget(regulars,$$2) {
    /hadd -m regulars $$2 $ctime
    /msg $chan $$2 added to list of users permitted to always post links
    /halt
  }
}

on 1:TEXT:*:#:{
  /set %linker $chr(124) $+ $nick $+ $chr(124)

  if $hget(subscribers,$nick) { 
    /halt 
  } 
  if $hget(regulars,$nick) { 
    /halt 
  } 
  if $hget(ops, $nick) { 
    /halt
  } 
  if %linker isin %Linkers { 
    /halt 
  }

  if $regex(url, $1-, \b[a-zA-Z0-9._%+-]+\.(?:[a-zA-Z]{2}|aero|asia|biz|cat|com|coop|eus|gal|info|int|jobs|mobi|museum|name|net|org|post|pro|tel|travel|xxx|edu|gov|mil)\b) { 
    /msg $chan You are not permitted to post links $nick $+ ! Either subscribe (Subscribers can always post links), or ask a moderator for permission to post a link first. 
    /msg $chan .timeout $nick %banlength
    /halt
  }
  if http: isin $1- {
    /msg $chan You are not permitted to post links $nick $+ ! Ask a moderator for permission first.
    /msg $chan .timeout $nick %banlength
    /halt
  } 
  /set %Linkers $remove( %Linkers, $chr(124) $+ $$2 $+ $chr(124) )
}

on 1:action:*:#:{
  /set %linker $chr(124) $+ $nick $+ $chr(124)

  if $hget(subscribers,$nick) { 
    /halt 
  } 
  if $hget(regulars,$nick) { 
    /halt 
  } 
  if $hget(ops, $nick) { 
    /halt
  } 
  if %linker isin %Linkers { 
    /halt 
  }

  if $regex(url, $1-, \b[a-zA-Z0-9._%+-]+\.(?:[a-zA-Z]{2}|aero|asia|biz|cat|com|coop|eus|gal|info|int|jobs|mobi|museum|name|net|org|post|pro|tel|travel|xxx|edu|gov|mil)\b) { 
    /msg $chan You are not permitted to post links $nick $+ ! Either subscribe (Subscribers can always post links), or ask a moderator for permission to post a link first. (Banned from posting for %bandelay seconds)
    /msg $chan .timeout $nick %banlength
    /halt
  }
  if http: isin $1- {
    /msg $chan You are not permitted to post links $nick $+ ! Ask a moderator for permission first. 
    /msg $chan .timeout $nick %banlength
    /halt
  } 
  /set %Linkers $remove( %Linkers, $chr(124) $+ $$2 $+ $chr(124) )
}

Joined: Apr 2014
Posts: 191
B
Vogon poet
Offline
Vogon poet
B
Joined: Apr 2014
Posts: 191
Because it uses ops hashtable to check op.

You need to change this line in entire script
Code:
if $hget(ops,$nick) == $null /halt

with
Code:
if $nick !isop # { halt }

Joined: Apr 2014
Posts: 7
R
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
R
Joined: Apr 2014
Posts: 7
ok i changed
Code:
if $hget(ops,$nick) == $null /halt

with
Code:
if $nick !isop # { halt }


now normal users linking without permission get their links removed, get warning msg, and get timed out.

mods do NOT get their links removed but still get the warning and get timed out. Here is the new script.

Code:
on 1:TEXT:!permit*:#:{
  if $nick !isop # { halt }
  /set %Linkers %Linkers $chr(124) $+ $$2 $+ $chr(124)) 
  /msg $chan $$2 you have %linkdelay seconds to post a link
  /timer $+ $$2 1 %linkdelay /set %Linkers $remove(%Linkers, $chr(124) $+ $$2 $+ $chr(124) )
}

on 1:TEXT:!regular*:#:{
  if $nick !isop # { halt }
  if $hget(regulars,$$2) {
    /hdel regulars $$2 
    /msg $chan $$2 removed from the list of users permitted to always post links
    /halt
  }
  if !$hget(regulars,$$2) {
    /hadd -m regulars $$2 $ctime
    /msg $chan $$2 added to list of users permitted to always post links
    /halt
  }
}

on 1:TEXT:*:#:{
  /set %linker $chr(124) $+ $nick $+ $chr(124)

  if $hget(subscribers,$nick) { 
    /halt 
  } 
  if $hget(regulars,$nick) { 
    /halt 
  } 
  if $hget(ops, $nick) { 
    /halt
  } 
  if %linker isin %Linkers { 
    /halt 
  }

  if $regex(url, $1-, \b[a-zA-Z0-9._%+-]+\.(?:[a-zA-Z]{2}|aero|asia|biz|cat|com|coop|eus|gal|info|int|jobs|mobi|museum|name|net|org|post|pro|tel|travel|xxx|edu|gov|mil)\b) { 
    /msg $chan You are not permitted to post links $nick $+ ! Either subscribe (Subscribers can always post links), or ask a moderator for permission to post a link first. 
    /msg $chan .timeout $nick %banlength
    /halt
  }
  if http: isin $1- {
    /msg $chan You are not permitted to post links $nick $+ ! Ask a moderator for permission first.
    /msg $chan .timeout $nick %banlength
    /halt
  } 
  /set %Linkers $remove( %Linkers, $chr(124) $+ $$2 $+ $chr(124) )
}

on 1:action:*:#:{
  /set %linker $chr(124) $+ $nick $+ $chr(124)

  if $hget(subscribers,$nick) { 
    /halt 
  } 
  if $hget(regulars,$nick) { 
    /halt 
  } 
  if $hget(ops, $nick) { 
    /halt
  } 
  if %linker isin %Linkers { 
    /halt 
  }

  if $regex(url, $1-, \b[a-zA-Z0-9._%+-]+\.(?:[a-zA-Z]{2}|aero|asia|biz|cat|com|coop|eus|gal|info|int|jobs|mobi|museum|name|net|org|post|pro|tel|travel|xxx|edu|gov|mil)\b) { 
    /msg $chan You are not permitted to post links $nick $+ ! Either subscribe (Subscribers can always post links), or ask a moderator for permission to post a link first. (Banned from posting for %bandelay seconds)
    /msg $chan .timeout $nick %banlength
    /halt
  }
  if http: isin $1- {
    /msg $chan You are not permitted to post links $nick $+ ! Ask a moderator for permission first. 
    /msg $chan .timeout $nick %banlength
    /halt
  } 
  /set %Linkers $remove( %Linkers, $chr(124) $+ $$2 $+ $chr(124) )
}

Joined: Apr 2014
Posts: 191
B
Vogon poet
Offline
Vogon poet
B
Joined: Apr 2014
Posts: 191
change this line in entire script
Code:
  if $hget(ops, $nick) { 
    /halt
  } 

with
Code:
if $nick isop # { halt }


Joined: Apr 2014
Posts: 170
Vogon poet
Offline
Vogon poet
Joined: Apr 2014
Posts: 170
is it possible to set this up so that the person you permit is only able to post one link? Rather than have 30 seconds? To prevent them from posting multiple links and/or spamming them?

Joined: Apr 2014
Posts: 33
B
Ameglian cow
Offline
Ameglian cow
B
Joined: Apr 2014
Posts: 33
If you use my code it automatically removes the permit once a link is posted.

/set %Linkers $remove( %Linkers, $chr(124) $+ $$2 $+ $chr(124) )

Last edited by bl968; 23/04/14 05:08 AM.
Page 2 of 2 1 2

Link Copied to Clipboard