mIRC Home    About    Download    Register    News    Help

Print Thread
Command Trigger After Certain Amount of Lines #253295 07/06/15 11:54 PM
Joined: Jun 2015
Posts: 84
F
Fonic_Artes Offline OP
Babel fish
OP Offline
Babel fish
F
Joined: Jun 2015
Posts: 84
So the goal is to make a "timed" click-to-tweet, but instead of it being an actual timer running and outputting every hour (can become spammy on Twitch channels with few/no viewers) it would instead output after a certain number of lines defined (hard coded to 35, but may change to an adjustable variable).

Code:
on *:text:*:#fonic_artes: {
  if (%cttlines < 35) {
    inc %cttlines
  }
  if (%cttlines = 35) {
    msg # (CTT_MESSAGE) %tweeturl
    set var %cttlines = 0
  }
}

alias cttlines {
  var %cttlines = 0
}


I was thinking setting an alias would work, but I may be thinking backwards on it.

Re: Command Trigger After Certain Amount of Lines [Re: Fonic_Artes] #253296 08/06/15 12:33 AM
Joined: Jun 2014
Posts: 248
B
Belhifet Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
Was that a question?

Re: Command Trigger After Certain Amount of Lines [Re: Belhifet] #253297 08/06/15 12:43 AM
Joined: Jun 2015
Posts: 84
F
Fonic_Artes Offline OP
Babel fish
OP Offline
Babel fish
F
Joined: Jun 2015
Posts: 84
Yes, I was unable to actually get it trigger, and I was hoping if there was an actual issue with the code if it could be pointed out or help point me in the right direction.

Re: Command Trigger After Certain Amount of Lines [Re: Fonic_Artes] #253298 08/06/15 05:13 AM
Joined: May 2015
Posts: 249
splinny Offline
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
You need double "=" in if-condition to make it work. Alias can be deleted, no use for it. "set var %blabla = 0" should be "set %blabla 0".
p.s. when you create %x in alias with /var command - it will be unseted when alias is over, thats another reason to delete your alias.

Last edited by splinny; 08/06/15 05:15 AM.

Dont give a fish - teach to fish!
Re: Command Trigger After Certain Amount of Lines [Re: splinny] #253300 08/06/15 12:31 PM
Joined: Jun 2015
Posts: 84
F
Fonic_Artes Offline OP
Babel fish
OP Offline
Babel fish
F
Joined: Jun 2015
Posts: 84
Thanks, I appreciate the help in fixing the code. I ended up making some simple mistakes with missing the "==" part.

With this, I can use this in a nice thing later on.

Cheers.