'!permit command for Twitch, mIRC/mSL
I want to make a !permit command that will let the user post a link for 20 seconds and not get blocked. If they don't ask a mod to permit them, they will get timed out.
Also I was looking for add a !alwayspermit so they will always have permission to post a link.
I suck at this stuff, real bad.
here's what i have..
on *:TEXT:!permit *:#: {
if (($nick isop #chan))
{ msg # I have permitted the user $+ $2 to post a link for 20 seconds }
}
Solution 1:[1]
first, your bot needs to be opped on channel
if someone that is not on permit or alwayspermit list post a link they will get kicked
seconds, press alt+r click "file" then "new" in there paste this code
on $@*:text:*:#:{
if ($regex($1-,/(http\72\/\/|www\.).+\.(com|co|uk)/iS)) && ($nick !isop $chan) {
if (!$istok(%permit,$nick,32)) {
kick $nick $chan You dont have permission to post links in here
}
}
noop $regex($1-,/^!(del|alwayspermit|permit)\s(\S+)/iS) {
if ($regml(1) == alwayspermit) && ($nick isop $chan) {
if ($istok(%permit,$regml(2),32)) {
msg $chan $regml(2) is already on always permit list
}
else {
set %permit $addtok(%permit,$regml(2),32)
msg $chan $regml(2) You are now always permited to post links
}
}
if ($regml(1) == permit) && ($nick isop $chan) {
set %permit $addtok(%permit,$regml(2),32)
.timerunset 1 20 set %permit $remtok(%permit,$regml(2),1,32)
msg $chan $regml(2) You have 20 seconds to post a link in here
}
if ($regml(1) == del) && ($nick isop $chan) {
if ($istok(%permit,$regml(2),32)) {
set %permit $remtok(%permit,$regml(2),1,32)
msg $chan $regml(2) erased suceffully from always permit list
}
else {
msg $chan $regml(2) is not on always permit list
}
}
}
}
commands:
!permit nick will add a permitted nick for 20 seconds
!alwayspermit nick will add a permitted nick permanent
!del nick will delete a nick from permitted list
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Sirius_Black |