mIRC Homepage
Posted By: dominic_eddy Halting text - 09/08/12 01:26 PM
I've made a script which makes my channel look different, it'll halt default text such as the normal quit messages, join messages, part messages and nick changes. The script works good, it halts the text and i use /echo to change the look, and i've made it only affect my channel, althoguh, i have a problem. I have no problem with the part and join codes because part and joins only affect one channel, whereas quits and nicks affect all messages. There for it halts the text on ALL channels, which is not what i wanted, i only wanted to change the appearance of MY channel. I think i know how to fix this, i just need the text to halt if its on my channel, but since quit messages go on all channels, i don't know how i'd specify it so that it would only halt the message on my channel. I added a code if ($nick ison (#my channel)) { but it still halted the text on all channels, for people in my channels. If someone wasn't on my channel and they quit, the normal message would pop up, but if someone quits, and their on my channel, it'll halt the text on all channels, and i'd only know they;d quit because the echo'd message on my channel. I need the text to ONLY halt on my channel, liek the join and part scripts.

Please help me <3

P.S. Also... is their any way of modifying the look of a nicklist? My channel has a bot and it uses ID's, if i could add their ID's in front of their name in the nicklist that would be awesome.
Posted By: Loki12583 Re: Halting text - 09/08/12 03:13 PM
You can't stop it for only one channel. You'll need to halt all of it, and then recreate it in every channel you want. You can use $comchan to determine which channels to display the text in.
Posted By: dominic_eddy Re: Halting text - 10/08/12 10:37 AM
How would i add this into my script? I'm not very good when it comes to stuff like $comchan, could you add it for me?
http://pastebin.com/pR0sZLmP

P.S. I hear that $comchan is for getting the channels that $me and $nick is on? This script is not made for a channel bot, it's a script which all users will individualy be given and maybe $comchan isn't the correct thing? dunno smile
Posted By: Loki12583 Re: Halting text - 10/08/12 03:06 PM
Code:
on ^*:quit:{
  var %addr = ( $+ $address $+ ), %msg = ( $+ $1- $+ )

  var %i = 1, %n = $comchan($nick,0)
  while (%i <= %n) {
    if ($comchan($nick,%i) != #test) {
      echo -i2tc quit $v1 * $nick($v1,$nick).pnick %addr Quit %msg
    }
    inc %i
  }
  haltdef
}


My formatting mimics the default text, you can change it back to what you want. Note that you can use /echo -c quit to use the quit event color. This does not account for the display setting of the event (default,status,channel,hide); as I don't know of an identifier to return these, implementing this functionality would be wasted if you're not using it anyway.
Posted By: dominic_eddy Re: Halting text - 14/08/12 10:03 AM
thanks, but this script echo's ALL Quit messages, when i added the 'if ($nick ison $chan) {' statement it only halted the text if someone was on my channel, hense reducing the ammount of CPU usage (or whatever its called) and i'd like it to stay that way laugh? I'm not really good at knowing where to add it in to this new script though. Also, how would i go about making the quit message echo'd different for my channel (#test) because at the moment, its making all the quit messages look normal on all other channels, but doesn't appear with anything in #test, i want it too look normal in all channels (like you've done) but echo something different in my channel laugh please help, Thanks! smile
Posted By: Loki12583 Re: Halting text - 14/08/12 12:20 PM
Code:
on ^*:quit:{
  var %chan = #test
  if ($nick !ison %chan) { return }

  var %addr = ( $+ $address $+ ), %msg = ( $+ $1- $+ )

  var %i = 1, %n = $comchan($nick,0)
  while (%i <= %n) {
    if ($comchan($nick,%i) != %chan) {
      echo -i2tc quit $v1 * $nick($v1,$nick).pnick %addr Quit %msg
    }
    else {
      ;echo -i2tc quit $v1 * custom message line
    }
    inc %i
  }
  haltdef
}
Posted By: dominic_eddy Re: Halting text - 15/08/12 10:21 AM
you musta accidently added that ; infront of echo, because it didn't work at first smile but no problem, removed, and it works great! thanks!
Posted By: Wims Re: Halting text - 15/08/12 12:17 PM
The ; was there on purpose, a ; at the beginning of a line makes that line a comment
Posted By: dominic_eddy Re: Halting text - 16/08/12 11:55 AM
im sorry to be a pain but i have one last thing to request, how would i convert this script so that it also works for on NICK events? the same problem occurs when people change nicknames as with my previous QUIT problem. =]
Posted By: Loki12583 Re: Halting text - 16/08/12 12:40 PM
You should be able to accomplish this without coming here for help. See "/help on nick" in mirc.
Posted By: Tomao Re: Halting text - 19/08/12 07:16 PM
You can combine them and share one alias like so:
Code:
on ^*:quit: qn $nick $1-
on ^*:nick: qn $newnick
alias -l qn {
  var %chan = #test
  if ($1 !ison %chan) { return }
  var %addr = ( $+ $address $+ ), %msg = ( $+ $2- $+ )
  var %i = 1, %n = $comchan($1,0)
  while (%i <= %n) {
    if ($comchan($1,%i) != %chan) {
      var %v1 = $v1
      echo -i2tc %v1 * $nick(%v1,$1).pnick %addr $iif($event == quit,Quit %msg,Nick is now known as $newnick)
    }
    else {
      echo -i2tc %v1 * $iif($event == quit,custom message line for quit,custom message line for Nick)
    }
    inc %i
  }
  haltdef
}
I haven't tested this but should work as per your wish.
Posted By: Wims Re: Halting text - 19/08/12 07:36 PM
I'd use $wildsite instead of $address, and you're using %v1 instead of %chan in the else part wink
Posted By: Tomao Re: Halting text - 02/09/12 12:48 PM
Thanks for your advice, Wims.
© mIRC Discussion Forums