mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2022
Posts: 8
C
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
C
Joined: Jun 2022
Posts: 8
Hello everybody..
Little question maybe?

I've been helping a radiostation named #radio-toppertje for a long time.
But the real problem is the command called !tel
We want if the DJ sends the command then send a private message to 2 participants at the time, thus the person who executed this command and the next DJ or Lady

How can we fix it...
Code
on *:text:!tel*:#radio-toppertje: {  
.timertel 1 1 /msg $nick nog 3O sec. voor einde uitzending | .timertel 1 1 /msg $2 nog 3o sec. voor uitzending | return }
.timertel1 1 2 /msg $nick nog 29 sec voor einde uitzending | .timertel1 1 2 /msg $2 nog 29 sec. voor einde uitzending | return }
.timertel2 1 3 /msg $nick nog 28 sec voor einde uitzending | .timertel2 1 3 /msg $2 nog 28 sec. voor einde uitzending | return }
.timertel3 1 4 /msg $nick nog 27 sec voor einde uitzending | .timertel3 1 4 /msg $2 nog 27 sec voor einde uitzending | return }
.timertel4 1 5 /msg $nick nog 26 sec voor einde uitzending | .timertel4 1 5 /msg $2 nog 26 sec voor einde uitzending | return }
.timertel5 1 5 /msg $nick nog 25 sec voor einde uitzending | .timertel5 1 6 /msg $2 nog 25 sec voor einde uitzending | return }
.timertel6 1 5 /msg $nick nog 24 sec voor einde uitzending | .timertel6 1 5 /msg $2 nog 24 sec voor einde uitzending | return }
.timertel7 1 5 /msg $nick nog 23 sec voor einde uitzending | .timertel7 1 5 /msg $2 nog 23 sec voor einde uitzending | return }
.timertel8 1 5 /msg $nick nog 22 sec voor einde uitzending | .timertel8 1 5 /msg $2 nog 22 sec voor einde uitzending | return }
.timertel9 1 5 /msg $nick nog 21 sec voor einde uitzending | .timertel9 1 5 /msg $2 nog 21 sec voor einde uitzending | return }
.timertel10 1 5 /msg $nick nog 20 sec voor einde uitzending | .timertel10 1 5 /msg $2 nog 20 sec voor einde uitzending | return }
.timertel11 1 5 /msg $nick nog 19 sec voor einde uitzending | .timertel11 1 5 /msg $2 nog 19 sec voor einde uitzending | return }
.timertel12 1 5 /msg $nick nog 18 sec voor einde uitzending | .timertel12 1 5 /msg $2 nog 18 sec voor einde uitzending | return }
.timertel13 1 5 /msg $nick nog 17 sec voor einde uitzending | .timertel13 1 5 /msg $2 nog 17 sec voor einde uitzending | return }
.timertel14 1 5 /msg $nick nog 16 sec voor einde uitzending | .timertel14 1 5 /msg $2 nog 16 sec voor einde uitzending | return }
.timertel15 1 5 /msg $nick nog 15 sec voor einde uitzending | .timertel15 1 5 /msg $2 nog 15 sec voor einde uitzending | return }
.timertel16 1 5 /msg $nick nog 14 sec voor einde uitzending | .timertel16 1 5 /msg $2 nog 14 sec voor einde uitzending | return }
.timertel17 1 5 /msg $nick nog 13 sec voor einde uitzending | .timertel17 1 5 /msg $2 nog 13 sec voor einde uitzending | return }
.timertel18 1 5 /msg $nick nog 12 sec voor einde uitzending | .timertel18 1 5 /msg $2 nog 12 sec voor einde uitzending | return }
.timertel19 1 5 /msg $nick nog 11 sec voor einde uitzending | .timertel19 1 5 /msg $2 nog 11 sec voor einde uitzending | return }
.timertel20 1 5 /msg $nick nog 10 sec voor einde uitzending | .timertel20 1 5 /msg $2 nog 10 sec voor einde uitzending | return }
.timertel21 1 5 /msg $nick nog 9 sec voor einde uitzending | .timertel21 1 5 /msg $2 nog 9 sec voor einde uitzending | return }
.timertel22 1 5 /msg $nick nog 8 sec voor einde uitzending | .timertel22 1 5 /msg $2 nog 8 sec voor einde uitzending | return }
.timertel23 1 5 /msg $nick nog 7 sec voor einde uitzending | .timertel23 1 5 /msg $2 nog 7 sec voor einde uitzending | return }
.timertel24 1 5 /msg $nick nog 6 sec voor einde uitzending | .timertel24 1 5 /msg $2 nog 6 sec voor einde uitzending | return }
.timertel25 1 5 /msg $nick nog 5 sec u kan de stream verlaten | .timerte25 1 5 /msg $2 nog 5 sec voor einde uitzending | return }
.timertel26 1 5 /msg $nick nog 4 sec u kan de stream verlaten | .timertel26 1 5 /msg $2 nog 4 sec voor einde uitzending | return }
.timertel27 1 5 /msg $nick nog 3 sec u kan de stream verlaten | .timertel27 1 5 /msg $2 nog 3 sec voor einde uitzending | return }
.timertel28 1 5 /msg $nick nog 2 sec u kan de stream verlaten | .timertel28 1 5 /msg $2 nog 2 sec voor einde uitzending | return }
.timertel29 1 5 /msg $nick nog 1 sec u heeft de stream verlaten | .timertel29 1 5 /msg $2 nog 1 sec voor einde uitzending | return }
.timertel30 1 5 /msg $nick einde van je uitzending, bedankt het was weer top | .timertel30 1 5 /msg $2 start van je uitzending, succes met je draai | return }


We should helped if someone knows the clue.

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
You have a /return on each line, which prevents this from triggering all 30 timers. Also, you have 29 extra closing braces, which you will see as a problem when you press ctrl+H to check brackets.

Also, you are using the same timername twice on each row, so the 2nd one overwrites the 1st one. You can either have 2 different timers on each row to send 2 separate messages, or else you can have 1 timer that does both messages. My example uses $chr(124) which causes the delayed evaluation of the pipe symbol

This has the potential to get you kicked from server for violating flooding, so you might want to have the messages at intervals of 5 seconds? You can also enable options/irc/flood/own messages and "enable flood protection", but be aware that this can cause the messages to be delayed to prevent flooding

Code
on *:text:!tel*:#radio-toppertje: {
.timertel 1 1 /msg $nick nog 3O sec. voor einde uitzending $chr(124) /msg $2 nog 3o sec. voor uitzending
.timertel1 1 2 /msg $nick nog 29 sec voor einde uitzending $chr(124) /msg $2 nog 29 sec. voor einde uitzending
.timertel2 1 3 /msg $nick nog 28 sec voor einde uitzending $chr(124) /msg $2 nog 28 sec. voor einde uitzending
.timertel3 1 4 /msg $nick nog 27 sec voor einde uitzending $chr(124) /msg $2 nog 27 sec voor einde uitzending
.timertel4 1 5 /msg $nick nog 26 sec voor einde uitzending $chr(124) /msg $2 nog 26 sec voor einde uitzending
.timertel5 1 5 /msg $nick nog 25 sec voor einde uitzending $chr(124) /msg $2 nog 25 sec voor einde uitzending
.timertel6 1 5 /msg $nick nog 24 sec voor einde uitzending $chr(124) /msg $2 nog 24 sec voor einde uitzending
.timertel7 1 5 /msg $nick nog 23 sec voor einde uitzending $chr(124) /msg $2 nog 23 sec voor einde uitzending
.timertel8 1 5 /msg $nick nog 22 sec voor einde uitzending $chr(124) /msg $2 nog 22 sec voor einde uitzending
.timertel9 1 5 /msg $nick nog 21 sec voor einde uitzending $chr(124) /msg $2 nog 21 sec voor einde uitzending
.timertel10 1 5 /msg $nick nog 20 sec voor einde uitzending $chr(124) /msg $2 nog 20 sec voor einde uitzending
.timertel11 1 5 /msg $nick nog 19 sec voor einde uitzending $chr(124) /msg $2 nog 19 sec voor einde uitzending
.timertel12 1 5 /msg $nick nog 18 sec voor einde uitzending $chr(124) /msg $2 nog 18 sec voor einde uitzending
.timertel13 1 5 /msg $nick nog 17 sec voor einde uitzending $chr(124) /msg $2 nog 17 sec voor einde uitzending
.timertel14 1 5 /msg $nick nog 16 sec voor einde uitzending $chr(124) /msg $2 nog 16 sec voor einde uitzending
.timertel15 1 5 /msg $nick nog 15 sec voor einde uitzending $chr(124) /msg $2 nog 15 sec voor einde uitzending
.timertel16 1 5 /msg $nick nog 14 sec voor einde uitzending $chr(124) /msg $2 nog 14 sec voor einde uitzending
.timertel17 1 5 /msg $nick nog 13 sec voor einde uitzending $chr(124) /msg $2 nog 13 sec voor einde uitzending
.timertel18 1 5 /msg $nick nog 12 sec voor einde uitzending $chr(124) /msg $2 nog 12 sec voor einde uitzending
.timertel19 1 5 /msg $nick nog 11 sec voor einde uitzending $chr(124) /msg $2 nog 11 sec voor einde uitzending
.timertel20 1 5 /msg $nick nog 10 sec voor einde uitzending $chr(124) /msg $2 nog 10 sec voor einde uitzending
.timertel21 1 5 /msg $nick nog 9 sec voor einde uitzending $chr(124) /msg $2 nog 9 sec voor einde uitzending
.timertel22 1 5 /msg $nick nog 8 sec voor einde uitzending $chr(124) /msg $2 nog 8 sec voor einde uitzending
.timertel23 1 5 /msg $nick nog 7 sec voor einde uitzending $chr(124) /msg $2 nog 7 sec voor einde uitzending
.timertel24 1 5 /msg $nick nog 6 sec voor einde uitzending $chr(124) /msg $2 nog 6 sec voor einde uitzending
.timertel25 1 5 /msg $nick nog 5 sec u kan de stream verlaten $chr(124) /msg $2 nog 5 sec voor einde uitzending
.timertel26 1 5 /msg $nick nog 4 sec u kan de stream verlaten $chr(124) /msg $2 nog 4 sec voor einde uitzending
.timertel27 1 5 /msg $nick nog 3 sec u kan de stream verlaten $chr(124) /msg $2 nog 3 sec voor einde uitzending
.timertel28 1 5 /msg $nick nog 2 sec u kan de stream verlaten $chr(124) /msg $2 nog 2 sec voor einde uitzending
.timertel29 1 5 /msg $nick nog 1 sec u heeft de stream verlaten $chr(124) /msg $2 nog 1 sec voor einde uitzending
.timertel30 1 5 /msg $nick einde van je uitzending, bedankt het was weer top $chr(124) /msg $2 start van je uitzending, succes met je draai
}

Joined: Jan 2012
Posts: 301
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 301
Try used this version of the script:
Code
on *:TEXT:!tel*:#radio-toppertje: if (!$timer(TELMSG) && $2) { tel_set | tel_msg $nick $2 }
--------------------------------------------------
alias -l tel_set {
  %tel_sec = 30
}
alias -l tel_msg {
  if (%tel_sec isnum 6-30) {
    .msg $1 nog %tel_sec sec - voor einde uitzending...
    if ($2) .msg $2 nog %tel_sec sec - voor uitzending...
  }
  if (%tel_sec isnum 1-5) {
    .msg $1 nog %tel_sec sec - u kan de stream verlaten.
    if ($2) .msg $2 nog %tel_sec sec - 04voor uitzending!!!
  }
  if (%tel_sec <= 0) {
    .msg $1 03einde van je uitzending, bedankt het was weer top!
    if ($2) .msg $2 12start van je uitzending, succes met je draai!
    return
  }
  dec %tel_sec | .timerTELMSG 1 1 tel_msg $1 $2
}


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Joined: Jun 2022
Posts: 8
C
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
C
Joined: Jun 2022
Posts: 8
Thank you sir...

Joined: Jun 2022
Posts: 8
C
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
C
Joined: Jun 2022
Posts: 8
But which piece... describes that the person who used !tel also get a countdown-dm?

Joined: Jan 2012
Posts: 301
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 301
Originally Posted by ChatSmurf
But which piece... describes that the person who used !tel also get a countdown-dm?

The alias "tel_msg" receives 2 parameters through the string with the command "tel_msg $nick $2".

    "tel_msg $nick $2" - the first parameter passed to the alias is the nickname of the user who typed the command "!tel nick".
    "tel_msg $nick $2" - the second parameter passed to the alias is the nickname that was specified in the command "!tel nick".

Thus, inside the alias "tel_msg" we have 2 parameters under identifiers: "$nick$1" and "$2$2".

    ".msg $1" - this line is responsible for the message to the user who typed the command "!tel nick".
    ".msg $2" - this line is responsible for the message to the user whose nickname was specified in the command "!tel nick".


I also slightly corrected the code and removed unnecessary conditions from it:
Code
on *:TEXT:!tel*:#radio-toppertje: if (!$timer(TELMSG) && $2) { tel_set | tel_msg $nick $2 }
--------------------------------------------------
alias -l tel_set {
  %tel_sec = 30
}
alias -l tel_msg {
  if (%tel_sec isnum 6-30) {
    .msg $1 nog %tel_sec sec - voor einde uitzending...
    .msg $2 nog %tel_sec sec - voor uitzending...
  }
  if (%tel_sec isnum 1-5) {
    .msg $1 nog %tel_sec sec - u kan de stream verlaten.
    .msg $2 nog %tel_sec sec - 04voor uitzending!!!
  }
  if (%tel_sec <= 0) {
    .msg $1 03einde van je uitzending, bedankt het was weer top!
    .msg $2 12start van je uitzending, succes met je draai!
    return
  }
  dec %tel_sec | .timerTELMSG 1 1 tel_msg $1 $2
}



🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Joined: Jun 2022
Posts: 8
C
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
C
Joined: Jun 2022
Posts: 8
Did you have tested it for yourself, and does it work?

Joined: Jun 2022
Posts: 8
C
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
C
Joined: Jun 2022
Posts: 8
I can really say nothing else then - Thank you very much <3


Link Copied to Clipboard