Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on *:text:*:#:linkpost $1-
- on *:action:*:#:linkpost $1-
- on *:notice:*:#:linkpost $1-
- ON !*:PART:#: { if ($hfind(permit,$nick)) { hdel permit $nick } }
- alias -l linkpost {
- var %purge = /^!(link\so(n|ff)|(permit)|(permitoff)|(permitclear)|(permitlist))\b/iS
- if (($regex($1-,%purge)) && ($regml(1) = permit) && ($nick isop #) && ($$2 ison #)) {
- if ($hfind(permit,$2)) { msg # ( $+ $nick $+ ): The $qt($2) is already into the permitted list. | return }
- hadd -m permit $2
- notice $2 You can now post a link into the # channel. Starting now.
- msg # ( $+ $2 $+ ): You can now post a link.
- }
- if (($regex($1-,%purge)) && ($regml(1) = permitoff) && ($nick isop #) && ($$2 ison #)) {
- if (!$hfind(permit,$2)) { msg # ( $+ $nick $+ ): The $qt($2) is NOT into the permitted list. | return }
- hdel permit $2
- notice $2 You can NOT post anymore a link into the # channel. Stop now!
- msg # ( $+ $2 $+ ): You can NOT anymore post a link!
- }
- if (($regex($1-,%purge)) && ($regml(1) = permitclear) && ($nick isop #)) {
- if (!$hget(permit)) { msg # ( $+ $nick $+ ): The permitted list is empty! | return }
- var %tot = $hget(permit,0).item
- hfree permit
- msg # ( $+ $nick $+ ): The permitted list have been cleared! - (Total: %tot $+ )
- }
- if (($regex($1-,%purge)) && ($regml(1) = permitlist) && ($nick isop #)) {
- if (!$hget(permit)) { msg # ( $+ $nick $+ ): The permitted list is empty! | return }
- var %tot = $hget(permit,0).item
- msg # ( $+ $nick $+ ): The permitted list are %tot nicknames.
- }
- if (($regml(1) = link on) && ($nick isop #)) {
- if (!$istok(%chanon1,#,32)) {
- set %chanon1 $addtok(%chanon1,#,32)
- msg # ( $+ $nick $+ ): Link Protection Is Now on in: #
- }
- else { msg # ( $+ $nick $+ ): Link protection is already on in # ! }
- }
- if (($regml(1) = link off) && ($nick isop #)) {
- if ($istok(%chanon1,#,32)) {
- set %chanon1 $remtok(%chanon1,#,1,32)
- msg # ( $+ $nick $+ ): Link Protection Is Now off in: #
- }
- else { msg # ( $+ $nick $+ ): Link protection is already off in # ! }
- }
- if ($hfind(permit,$nick)) {
- var %domain com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk
- var %exception /https?:\/\/(?:w{3})?\.(youtube|imgur|ima|test)\.(ninja|eu|com)/
- var %link /(?<=^|\s)((?>\S{3,5}:\/\/|w{3}\56)\S+)|\56( $+ %domain $+ )\b/iS
- if ($findtok(%chanon1,#,1,32)) && ($nick !isop #) && ($regex($1-,%link)) && (!$regex($1-,%exception)) {
- msg # ( $+ $nick $+ ): Ok you have post your permit link.
- hdel permit $nick
- }
- }
- elseif (!$hfind(permit,$nick)) {
- var %domain com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk
- var %exception /https?:\/\/(?:w{3})?\.(youtube|imgur|ima|test)\.(ninja|eu|com)/
- var %link /(?<=^|\s)((?>\S{3,5}:\/\/|w{3}\56)\S+)|\56( $+ %domain $+ )\b/iS
- if ($findtok(%chanon1,#,1,32)) && ($nick !isop #) && ($regex($1-,%link)) && (!$regex($1-,%exception)) {
- msg # ( $+ $nick $+ ): You did not have permission to post a link ask a mod to !permit you
- msg # /timeout $nick 1
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement