mIRC Homepage
Posted By: powerade661 ON JOIN on a timer? - 14/08/15 08:36 PM
Is it possible to put ON JOIN and ON PART commands on a timer?
As we all know Twitch is notorious for claiming that viewers have left when they haven't. So I had an idea of putting each user on a timer before they are called out in the stream.

Under the ON JOIN and ON PART I tried adding a timer with ".timer.lurker 1 7 {" but I keep getting insufficient parameters. I am trying to bind the timer to a username also. Any help with this would be awesome.


Thanks,
Powerade661

Code:

on *:text:!lurker on:#: {
  if ($nick isop #) { 
    set %lurker. [ $+ [ $chan ] ] 1 
    msg $chan /me Lurker mode enabled.
  }
}
on *:TEXT:!lurker off:#: {
  if ($nick isop #) {
    if ( %lurker. [ $+ [ $chan ] ] == 1 ) {
      set %lurker. [ $+ [ $chan ] ] 0
      msg $chan /me Lurker mode disabled.
    }
  }
}

on 1:JOIN:#: {
  if ($nick == $remove(#,$chr(35))) { return }
  if ($nick == Nightbot) { return }
  if ($nick == Wizebot) { return }
  if ($nick == Moobot) { return }
  if ( %lurker. [ $+ [ $chan ] ] == 1 ) {
    if ((%floodlurker_*) || ($($+(%,floodlurker_*.,$nick),2))) { return }
    set -u30 %floodlurker_* On
    set -u100 %floodlurker_*. $+ $nick
    msg $chan /me Welcome to the stream $nick $+ . :)
  }
}

on 1:PART:#: {
  if ($nick == $remove(#,$chr(35))) { return }
  if ($nick == Nightbot) { return }
  if ($nick == Wizebot) { return }
  if ($nick == Moobot) { return }
  if ( %lurker. [ $+ [ $chan ] ] == 1 ) {
    if ((%floodlurker1*) || ($($+(%,floodlurker1*.,$nick),2))) { return }
    set -u30 %floodlurker1* On
    set -u100 %floodlurker1*. $+ $nick
    msg $chan /me $nick has left the stream 
  }
}

Posted By: powerade661 Re: ON JOIN on a timer? - 15/08/15 05:14 AM
Any ideas?
Posted By: Wims Re: ON JOIN on a timer? - 16/08/15 09:11 AM
You can, but the timer command basically execute a simple line of code, and by design, the timer command double evaluate the content of that new line of code. To play safe, just call an alias and work in that alias, however, if you must use values which are local to the event, such as $chan or $nick, the alias called by the timer won't be able to access them, therefore you must pass them to the alias, read carefully the link and use $safe accordingly if the value is unknown :


Code:
on *:join:#channel:{
;associate the nick to the timer
;$nick cannot be used to exploit you unless the irc server allows character such as '$' or '%'
.timer $+ $nick 1 7 dosomstuff $nick
}

alias dosomestuff {
;$1 is $nick
echo -a $1
}
© mIRC Discussion Forums