mIRC Homepage
Hey,
i have a little game script and want that the game is automatically active (when i have written !on) every 10min WITHOUT a user have to type anything, everything in the game script works great when i do it with the "on *:text:!test:#:" command but that isnt what i want.

So i tried to make timers and a game alias:

Code:
on *:text:!on:#: {
  .timer.game 0 600 %gamealias
}
on *:text:!off:#: {
  .timer.game off
}

alias %gamealias {
  set -n %word $read(wordlist.txt,n)
  msg # Game: %word
}



That is just a example, but it dont work, mirc dont even setting up the timer! When i remove the "%" at the alias mirc loads the timer but dont give any message!

Its just really odd - someone can explain me what i do wrong?


Tldr:
Timers dont working for me when i use "%" in the script / alias title.

timer.game 0 600 /msg #channel %gamealias
Hey,
that is not working for me:

Code:
on *:text:!on:#: {
  .timer.game 0 5 /msg # %gamealias
}
on *:text:!off:#: {
  .timer.game off
}

alias %gamealias {
  set -n %word $read(wordlist.txt,n)
  msg # Game: %word
}



Not even the timer is created when i check it on the bot with /timers
Code:
on *:text:!on:#: {
  .timer.game 0 5 gamealias $chan
}
on *:text:!off:#: {
  .timer.game off
}

alias gamealias {
  set -n %word $read(wordlist.txt,n)
  msg $1 Game: %word
}


How about a simple solution.
Thank you Belhifet, that helps me alot!
I was able to fix my script smile
Okay perhaps someone can help me again, i have now 2 Games - i want them to choosen random.

When i change the 10min timer to this:
Code:
.timer.game 0 5 $+(game,$rand(1,2)) $chan


It is chooseing the game random the first time, but stay then on that game. The timer isnt changeing!



So i thought about another alias and tried it this way:

Code:
on *:text:!on:#: {
  .timer.gameselecter 0 5 selected $chan
}

alias selected {
  .timer.random 1 0 $+(game,$rand(1,2)) $chan
}

alias game1 {
  set -n %word $read(wordlist.txt,n)
  /echo -a GAME1
  msg $1 Game: GAME1: %word
}

alias game2 {
  set -n %word $read(wordlist.txt,n)
  /echo -a GAME2  
  msg $1 Game: GAME2 %word
}



The strange thing is now:
The "echo" is working but there is NO message - when i execute game1 or game2 with the first timer without the random thing - its working perfect.

Please someone? laugh
in
Code:
alias selected {
  .timer.random 1 0 $+(game,$rand(1,2)) $chan
}

The alias is not on a channel. You've passed $chan on to the alias via the on text !on. That value($chan) is $1 for that alias.
Code:
alias selected {
  .timer.random 1 0 $+(game,$rand(1,2)) $1
}
Wuh... its working like charme lol!
Thank you much.
Using unknown content inside /timer is dangerous, you should sanitize the unknown parameters passed to /timer as part of its command (here, $1) with $safe()
Thats a fair point, I only use mirc for twitch so this doesnt come up for me frown
© mIRC Discussion Forums