mIRC Home    About    Download    Register    News    Help

Print Thread
on *:Text: help please #255878
29/11/15 04:17 AM
29/11/15 04:17 AM
Joined: Jul 2013
Posts: 24
Canada
E
EasyObserver Offline OP
Ameglian cow
EasyObserver  Offline OP
Ameglian cow
E

Joined: Jul 2013
Posts: 24
Canada
Hi..I'm attempting to do a little Christmas script that posts lyrics of 39 different Christmas songs to the channel from a file depending on what lyric number is selected. What I want it to do is set the channel to +m (moderated) and +v (voice) the nick, post the lyrics and then set the channel back to -m and devoice the nick. This is what I have so far but I keep getting an error in my status window of "0 No such channel". It basically does what I want it to do, but sometimes it repeats itself and posts the lyric again. That error continues every 2 seconds in my status window and the command cannot be typed again until the errors stop. The lyric selected below is lyrics26, the lyrics range from lyrics1 - lyrics39

on *:Text:!lyrics26:#: {
set %chan_ $chan
set %nick_ $nick
/mode $chan +m
/mode $chan +v $nick
/play $chan C:\mIRC\xmaslyrics\lyrics26.txt
}
on *:PLAYEND: {
/mode %chan_ -m
/mode %chan_ -v %nick_
set %chan_ 0
set %nick_ 0
}

Nevermind...it actually does work without errors. It turns out I had a similar script running with copy/paste errors that clashed with these ones. Works fine now. smile

Last edited by EasyObserver; 29/11/15 07:21 AM. Reason: Problem solved
Re: on *:Text: help please [Re: EasyObserver] #255884
29/11/15 02:50 PM
29/11/15 02:50 PM
Joined: Dec 2008
Posts: 1,511
Greece
westor Offline
Hoopy frood
westor  Offline
Hoopy frood

Joined: Dec 2008
Posts: 1,511
Greece
Try use this code:

Code:
ON *:TEXT:!lyrics26:#: {
  if (%chan_) { .msg $chan ( $+ $nick $+ ): The lyrics26 are already in use, please wait.. | return }
  var %f = C:\mIRC\xmaslyrics\lyrics26.txt
  if (!$isfile(%f)) { .msg $chan ( $+ $nick $+ ): Error, The $qt(%f) file does not exists! | return }
  if (!$lines(%f)) { .msg $chan ( $+ $nick $+ ): Error, The $qt(%f) file is empty! | return }
  set -e %chan_ $chan
  set -e %nick_ $nick
  mode $chan +m
  mode $chan +v $nick
  play $chan $qt(%f)
}

ON *:PLAYEND: {
  if ($me !ison %chan_) { return }
  if ($me isreg %chan_) { return }
  if (%nick_ !ison %chan_) { return }
  if (m isincs $chan(%chan_).mode) { mode %chan_ -m }
  if (%nick_ isvoice %chan_) { mode %chan_ -v %nick_ }
  unset %chan_ %nick_
}


Need Online mIRC help or an mIRC Scripting Freelancer? -> http://westor.ucoz.com/contact <-