mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2007
Posts: 24
T
Tzar469 Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Dec 2007
Posts: 24
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.
  }
}


Joined: Dec 2008
Posts: 1,513
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,513
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

Last edited by westor; 22/02/09 10:14 PM.

Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Echoing to $lactive ought to solve that.

Joined: Dec 2007
Posts: 24
T
Tzar469 Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Dec 2007
Posts: 24
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

Last edited by Tzar469; 22/02/09 10:26 PM.
Joined: Dec 2008
Posts: 1,513
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,513
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

Last edited by westor; 22/02/09 10:38 PM.

Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Nothing in the code you gave is going to give a "no such nick/channel" error.

Joined: Dec 2007
Posts: 24
T
Tzar469 Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Dec 2007
Posts: 24
Hmm, you are right. It's another one of my scripts causing the trouble.

Thank you both for your help!


Link Copied to Clipboard