mIRC Home    About    Download    Register    News    Help

Print Thread
#203069 06/08/08 12:52 AM
Joined: Jan 2008
Posts: 44
J
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Jan 2008
Posts: 44
Code:
on 150:text:!startspam:?: {
  startspams
  msg $nick Spamstarted
}

on 150:text:!stopspam:?: {
  stopspams
  msg $nick Spamstopped
}

alias stopspams {

  	timers off
}

alias startspams {

  timera 0 1200 msg #theSGL theSGL Gaming Supierority CS CZ : CZ Impact #7 tonight! : http://www.thesgl.com/cz/news/332/ #demon-uk
  timerb 0 2100 msg #theSGL theSGL Gaming Supierority CS 1.6 : SteelSeries : King of the Hill VII : http://www.thesgl.com/cs/news/329/
  timerc 0 6233 msg #theSGL theSGL Gaming Supierority CS Source : SteelSeries CCC : Group Stage : http://www.thesgl.com/css/news/328/

}

It worked fine the other day,
Things that dont work

- It doesnt spam the last one
- and it doesnt actually !stopspam

if anyone could help would be great thankyou.


#Plesh on QuaKenet
Jake Randall
Need help?
#Plesh - QuakeNet
Private Message Me Here!
Joined: Jul 2008
Posts: 12
M
mOX Offline
Pikka bird
Offline
Pikka bird
M
Joined: Jul 2008
Posts: 12
delete

Code:
alias stopspams { timers off }


change
Code:
on 150:text:!stopspam:?: { timers off |  msg $nick Spamstopped }


A variant
Code:
on 150:TEXT:*:?: {
  if ($1 == !startspam) {
    timer 0 1200 msg #theSGL theSGL Gaming Supierority CS CZ : CZ Impact #7 tonight! : http://www.thesgl.com/cz/news/332/ #demon-uk
    timer 0 2100 msg #theSGL theSGL Gaming Supierority CS 1.6 : SteelSeries : King of the Hill VII : http://www.thesgl.com/cs/news/329/
    timer 0 6233 msg #theSGL theSGL Gaming Supierority CS Source : SteelSeries CCC : Group Stage : http://www.thesgl.com/css/news/328/
    msg $nick Spamstarted
  }
  if ($1 == !stopspam) { timers off | msg $nick Spamstopped }
}




Last edited by mOX; 06/08/08 01:44 AM.
Joined: Jan 2008
Posts: 44
J
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Jan 2008
Posts: 44
Still fails,
It spams the middle one first, and then the first one twice at the same time and not the third smirk


#Plesh on QuaKenet
Jake Randall
Need help?
#Plesh - QuakeNet
Private Message Me Here!
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
First off, I suggest using named timers.
Note that your timers don't stay "in order" because you're setting a different delay (interval) for each of the three infinite timers.

If this is intended you can use something like:
Code:
on 150:TEXT:*:?: {
  if ($1 == !startspam) {
    .timerannounce1 0 1200 if ( $!me ison #somechan ) msg #somechan <your message 1>
    .timerannounce2 0 2100 if ( $!me ison #somechan ) msg #somechan <your message 2>
    .timerannounce3 0 3000 if ( $!me ison #somechan ) msg #somechan <your message 3>
    msg $nick Spam started
  }
  elseif ($1 == !stopspam) {
    .timerannounce* off
    msg $nick Spam stopped
  }
}
That's close to the code you use already. And with this method, the first timer will trigger after 1200s and trigger again each 1200s. The third timer will trigger after 3000s and trigger again each 3000s. Therefore the first timer has triggered a second time (1200s + 1200s) before the third timer triggered the first time etc... It's like three planets having a different time of circulation. They lap each other.


If you want to keep the three messages "in order" instead, you have to use the samy delay (interval) for all three timers. To start them with some "offset" none the less, use timers again smile
Code:
on 150:TEXT:*:?: {
  if ($1 == !startspam) {
    .timerannounce.init1 1 0 .timerannounce1 0 1200 if ( $!me ison #somechan ) msg #somechan <your message 1>
    .timerannounce.init2 1 30 .timerannounce2 0 1200 if ( $!me ison #somechan ) msg #somechan <your message 2>
    .timerannounce.init3 1 60 .timerannounce3 0 1200 if ( $!me ison #somechan ) msg #somechan <your message 3>
    msg $nick Spam started
  }
  elseif ($1 == !stopspam) {
    .timerannounce* off
    msg $nick Spam stopped
  }
}
This code will start the first infinite timer immediately, the second after 30 seconds and the third after 60 seconds (this is your offset for the timers).
The infinite timers themself all use the same delay/interval (1200s) and therefore keep their relative order.

Maybe you need to restart mIRC to get rid of timers already started/still running.

Last edited by Horstl; 06/08/08 01:04 PM.

Link Copied to Clipboard