mIRC Homepage
Posted By: Tzar469 Echo to active window after parting - 22/02/09 10:04 PM
I have a script that will unset a variable once I leave a channel. It should then echo that the variable was unset into my active window. The problem I'm having is that I can't get the echo to work. It keeps on trying to echo to the channel that I've left, and of course it can't find it. Please help.

Code:
on *:PART:#mychan:{ 
  if ($nick == $me) {
    unset %thisvar
    echo -a Variable unset.
  }
}

Posted By: westor Re: Echo to active window after parting - 22/02/09 10:13 PM
you want a code when you leave from your channel (#mychan) to unset a variable and inform you?

if yes > after leaving a channel the window closed so you can't see the unsetting variable into the channel left window only in the active or in the status window or in an other window except the channel left window.

if no > please reply again clearly to help you
Posted By: Collective Re: Echo to active window after parting - 22/02/09 10:20 PM
Echoing to $lactive ought to solve that.
Posted By: Tzar469 Re: Echo to active window after parting - 22/02/09 10:23 PM
Yeah, that's exactly what I want. I want it to echo into my active window after #mychan closes.

@Collective: That make the echo work, but my status window still displays an error: mychan No such nick/channel
Posted By: westor Re: Echo to active window after parting - 22/02/09 10:37 PM
ok then if you want to work in your active window try this code:

Code:
on *:PART:#mychan:{ 
  if ($nick == $me) {
    unset %thisvar
    .timer[var_unset] 1 0 .echo -a Variable unset.
  }
}


this will inform's you to any window that the variable unseted
Posted By: Collective Re: Echo to active window after parting - 22/02/09 10:46 PM
Nothing in the code you gave is going to give a "no such nick/channel" error.
Posted By: Tzar469 Re: Echo to active window after parting - 22/02/09 11:12 PM
Hmm, you are right. It's another one of my scripts causing the trouble.

Thank you both for your help!
© mIRC Discussion Forums