mIRC Homepage
Posted By: judge2020 !permit - 08/04/14 12:54 AM
i have a [pretty bad] link block for my twitch tv channel (shouldn't matter] and i am trying to do a !permit command for moderators.
What i have tried to do is get it to write to my allowed list then a timer set for 30 seconds which will delete that user from the list.
I have the adding to the list set up but i cannot seem to get my remove command working with a timer.
Code:
on *:TEXT:!permit*:#: {
  if ($nick isop #) {
    write reglist.txt $$2
    msg # $$2 has been permited to post a link for 30 seconds
    .timerPermit 1 30 $read(reglist.txt,nw,$2) write -dl $+ $readn reglist.txt 
    .timerPermit 1 31 msg $chan $$2 is no longer allowed to post a link
  }
}

I probably set up the timer command wrong, any help would be appreciated smile
Posted By: judge2020 Re: !permit - 08/04/14 12:21 PM
Originally Posted By: judge2020
i have a [pretty bad] link block for my twitch tv channel (shouldn't matter] and i am trying to do a !permit command for moderators.
What i have tried to do is get it to write to my allowed list then a timer set for 30 seconds which will delete that user from the list.
I have the adding to the list set up but i cannot seem to get my remove command working with a timer.
Code:
on *:TEXT:!permit*:#: {
  if ($nick isop #) {
    write reglist.txt $$2
    msg # $$2 has been permited to post a link for 30 seconds
    .timerPermit 1 30 $read(reglist.txt,nw,$2) write -dl $+ $readn reglist.txt 
    .timerPermit 1 31 msg $chan $$2 is no longer allowed to post a link
  }
}

I probably set up the timer command wrong, any help would be appreciated smile

fixed duplicate timers:
Code:
on *:TEXT:!permit*:#: {
  if ($nick isop #) {
    write reglist.txt $$2
    msg # $$2 has been permited to post a link for 30 seconds
    .timerPermit1 1 30 $read(reglist.txt,nw,$2) write -dl $+ $readn reglist.txt 
    .timerPermit2 1 31 msg $chan $$2 is no longer allowed to post a link
  }
}
Posted By: Nillen Re: !permit - 08/04/14 01:10 PM
I'd recommend using a simple variable for this. Read up on $addtok, $istok and $remtok in the help files.
Type "/help $addtok" in your mIRC appliaction.

EDIT: Nvm, I took a look at it myself and it was really confusing.
How to set a permission.
Code:
set -u30 %permit $addtok(%permit,$2,32)

How to see if permitted.
Code:
if ($istok(%permit,$nick,32))
Posted By: blessing Re: !permit - 08/04/14 03:44 PM
Hope this works.
Code:
on *:TEXT:!permit*:#: {
  if ($nick isop #) && ($2) {
    write reglist.txt $2
    msg # $2 has been permited to post a link for 30 seconds
    .timerRemovePermit 1 30 RemovePermit # $2
  }
}

alias -l RemovePermit {
  write $+(-ds,$2) reglist.txt
  msg $1 $2 is no longer allowed to post a link
}
Posted By: judge2020 Re: !permit - 08/04/14 03:59 PM
Thanks smile
© mIRC Discussion Forums