mIRC Home    About    Download    Register    News    Help

Print Thread
#248693 19/10/14 02:16 AM
Joined: Sep 2014
Posts: 83
H
Babel fish
OP Offline
Babel fish
H
Joined: Sep 2014
Posts: 83
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

Joined: Jun 2014
Posts: 248
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
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.
Joined: Sep 2014
Posts: 83
H
Babel fish
OP Offline
Babel fish
H
Joined: Sep 2014
Posts: 83
i changed it to 5 to test it and nothing happens

Joined: Jun 2014
Posts: 248
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
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.
Joined: Sep 2014
Posts: 83
H
Babel fish
OP Offline
Babel fish
H
Joined: Sep 2014
Posts: 83
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.
Joined: Jun 2014
Posts: 248
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
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.

Joined: Sep 2014
Posts: 83
H
Babel fish
OP Offline
Babel fish
H
Joined: Sep 2014
Posts: 83
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