mIRC Home    About    Download    Register    News    Help

Print Thread
#243673 11/12/13 10:39 PM
Joined: Dec 2013
Posts: 11
G
Pikka bird
OP Offline
Pikka bird
G
Joined: Dec 2013
Posts: 11
So I'm having an issue with my bot executing the command given from the timer.

Code:
on *:TEXT:`timer*:#: { 
  /timerPoints 0 30 /givePoints
}

alias givePoints {
  msg $chan I MADE IT TO THE THING
  var %status = 0
  var %i  = 1
  var %curr_nick = $null

  while ( %status == 0 ) {
    %curr_nick = $nick(#,%i)

    if ( %curr_nick == $null ) {
      %status = 1
    }
    else {
      set %points $calc($readini(viewers.ini, n, points, %curr_nick) + 1)
      writeini viewers.ini points %curr_nick %points
    }

    inc %i
  }
}


I can use mIRC to do the command manually, but you can see that it's supposed to shout "I MADE IT TO THE THING" and it doesn't do that with the timer. I've tried all variations of trying to make the command work with the timer, but the timer itself works since if I tell the timer to simply say a message, it'll repeat it every 30 seconds.

tl;dr: My timer won't call the command.

Last edited by Gotex007; 11/12/13 10:56 PM.
Joined: Jan 2004
Posts: 1,359
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,359
$chan and $nick are not valid in the context of a timer.

Code:
on *:text:`timer*:#: { 
  timerPoints 0 30 givePoints $nick $chan
}

alias givePoints {
  var %nick = $1, %chan = $2
  msg %chan I MADE IT TO THE THING
  ...

Joined: Dec 2013
Posts: 11
G
Pikka bird
OP Offline
Pikka bird
G
Joined: Dec 2013
Posts: 11
Well I don't need the %nick variable for it, but I toyed with it to make it work with the info you gave me. It never crossed my mind for some reason that the function wouldn't have access to those variables though. Thank you very much.


Link Copied to Clipboard