mIRC Home    About    Download    Register    News    Help

Print Thread
!permit #244982 08/04/14 12:54 AM
Joined: Mar 2014
Posts: 215
J
judge2020 Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
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


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Re: !permit [Re: judge2020] #244993 08/04/14 12:21 PM
Joined: Mar 2014
Posts: 215
J
judge2020 Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
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
  }
}


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Re: !permit [Re: judge2020] #244995 08/04/14 01:10 PM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
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))

Last edited by Nillen; 08/04/14 01:23 PM.

Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: !permit [Re: judge2020] #244996 08/04/14 03:44 PM
Joined: Apr 2014
Posts: 191
B
blessing Offline
Vogon poet
Offline
Vogon poet
B
Joined: Apr 2014
Posts: 191
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
}

Last edited by blessing; 08/04/14 03:46 PM.
Re: !permit [Re: judge2020] #244998 08/04/14 03:59 PM
Joined: Mar 2014
Posts: 215
J
judge2020 Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
Thanks smile


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball