mIRC Home    About    Download    Register    News    Help

Print Thread
#248693 19/10/14 02:16 AM
H
HappyFappy
HappyFappy
H
im looking to make a script but I have no idea how to add the counter...

I want it to count everytime a word is said...and on a certian time saying it, the script says a message

like:
Code:
ON *:TEXT:*blah*:#:{ 
(add counter here)
if ( counter = 1000 ) (msg # THATS THE 1000TH TIME "BLAH" HAS BEEN SAID }
}



im not sure exactly how it would work, im not genious with this XD

#248694 19/10/14 02:49 AM
B
Belhifet
Belhifet
B
Maybe?
Code:
ON *:TEXT:*blah*:#:{ 
  var %i $0
  while %i > 0 {
    if ($($+($,%i),2) == blah)
    inc %blahcounter
    dec %i
if (%blahcounter == 1000) { msg # THATS THE 1000TH TIME "BLAH" HAS BEEN SAID }  
}
}

Last edited by Belhifet; 19/10/14 02:52 AM.
#248701 19/10/14 04:35 AM
H
HappyFappy
HappyFappy
H
i changed it to 5 to test it and nothing happens

#248702 19/10/14 04:59 AM
B
Belhifet
Belhifet
B
Code:
ON *:TEXT:*blah*:#:{ 
  var %i $0
  while %i > 0 {
     if ($($+($,%i),3) == blah) { inc %blahcounter }
    dec %i
    if (%blahcounter == 1000) { msg # THATS THE 1000TH TIME "BLAH" HAS BEEN SAID }  
  }
}


this happens everytime I write something in the response box.

Last edited by Belhifet; 19/10/14 05:00 AM.
#248703 19/10/14 05:15 AM
H
HappyFappy
HappyFappy
H
Originally Posted By: Belhifet
Code:
ON *:TEXT:*blah*:#:{ 
  var %i $0
  while %i > 0 {
     if ($($+($,%i),3) == blah) { inc %blahcounter }
    dec %i
    if (%blahcounter == 1000) { msg # THATS THE 1000TH TIME "BLAH" HAS BEEN SAID }  
  }
}


this happens everytime I write something in the response box.


IT WORKS!!! thank you so much laugh

How do i get to reset after the 1000?

Last edited by HappyFappy; 19/10/14 05:25 AM.
#248704 19/10/14 05:36 AM
B
Belhifet
Belhifet
B
Code:
ON *:TEXT:*blah*:#belhifet:{ 
  var %i $0
  while %i > 0 {
    .msg # $($+($,%i),3) and %i  
    if ($($+($,%i),3) == blah) { inc %blahcounter }
    dec %i
    if (%blahcounter == 1000) { 
    msg # THATS THE 1000TH TIME "BLAH" HAS BEEN SAID 
    set %blahcounter 0
    }  
  }
}

Resets it. or
Code:
ON *:TEXT:*blah*:#belhifet:{ 
  var %i $0
  while %i > 0 {
    .msg # $($+($,%i),3) and %i  
    if ($($+($,%i),3) == blah) { inc %blahcounter }
    dec %i
    if (%blahcounter // 1000) { msg # THATS THE %blahcounter $+ TH TIME "BLAH" HAS BEEN SAID }  
  }
}


This would fire on multiples of 1000.

#248705 19/10/14 05:49 AM
H
HappyFappy
HappyFappy
H
Originally Posted By: Belhifet
Code:
ON *:TEXT:*blah*:#belhifet:{ 
  var %i $0
  while %i > 0 {
    .msg # $($+($,%i),3) and %i  
    if ($($+($,%i),3) == blah) { inc %blahcounter }
    dec %i
    if (%blahcounter == 1000) { 
    msg # THATS THE 1000TH TIME "BLAH" HAS BEEN SAID 
    set %blahcounter 0
    }  
  }
}

Resets it. or
Code:
ON *:TEXT:*blah*:#belhifet:{ 
  var %i $0
  while %i > 0 {
    .msg # $($+($,%i),3) and %i  
    if ($($+($,%i),3) == blah) { inc %blahcounter }
    dec %i
    if (%blahcounter // 1000) { msg # THATS THE %blahcounter $+ TH TIME "BLAH" HAS BEEN SAID }  
  }
}


This would fire on multiples of 1000.



again thank you so much smile


Link Copied to Clipboard