mIRC Home    About    Download    Register    News    Help

Print Thread
#61819 25/11/03 08:03 PM
Joined: Sep 2003
Posts: 84
T
Babel fish
OP Offline
Babel fish
T
Joined: Sep 2003
Posts: 84
I have a script for on exit but it's not working :S who can help me? the script like this:

on ^*:exit: {
.msg #games A.U.B even wachten, trivia zal nu uitschakelen.
.msg #games mijn pc zal nu uit geschakeld worden, of $me zal herstarten.
.stop
.top100
}

(older version like 6.03 there works it ;-))

grtz

#61820 25/11/03 08:45 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
This script doesn't work because the events "on disconnect" and "on exit" trigger after you have disconnected from the server, so you can't start sending messages to channels as if you're connected.

To get around this define your own /exit alias, with /exit (the built-in command) at the end:
Code:
alias exit {
  msg #chan text
  do stuff
  exit
}

And the next time you want to close mIRC, type /exit, and all the necessary stuff will be done before exiting.

#61821 25/11/03 08:50 PM
Joined: Sep 2003
Posts: 84
T
Babel fish
OP Offline
Babel fish
T
Joined: Sep 2003
Posts: 84
I'm not using the /exit command to close my BOT in older version's i had a script with on *:exit: and before hi exit hi asked for the password (that script) if the password was right than hi exit - other hi restarted and can't be closed

why does that now not worken any more? :S

Ow yeah you had:

alias exit {
.....
.....
....
exit <--- that does not work :P
}

#61822 25/11/03 08:53 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
It will work. If you call a command from an alias of the same name it ignores the alias and uses the default mIRC command or lacking that sends it to the server.

#61823 25/11/03 08:56 PM
Joined: Sep 2003
Posts: 84
T
Babel fish
OP Offline
Babel fish
T
Joined: Sep 2003
Posts: 84
the help file say't this:

Examples

The main purpose of this command is to allow scripts to exit cleanly, unset variables, save settings, etc. when mIRC exits.

so you can do anything before mirc will quit why does i not work than?

#61824 26/11/03 12:17 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
You're missing the point.

On QUIT - Occurs after the user (yourself) disconnects from the server:

example:
on *:QUIT: { /echo -s I quit! }

And you type:
/disconnect

The following would occur in the status window:
* Disconnected
I Quit!

--

on EXIT - Occurs just before mirc window closes

This is generally for cleanup, or any kind of statistics you want to enter. Most scripts take this opportunity to set a variable here, and on startup check for that variable. If it exists, it was a "clean" exit, not a crash. You can also remove variable that were only being used for the active session of mirc, or perhaps variables that change on startup.

Whatever the case may be, if you've reached this point, you are not connected to any servers. Thus /msg won't work, nor will nick, /kick, /ban, /notice, /query, or any other identifier of or relating to a server.


-KingTomato
#61825 26/11/03 08:00 AM
Joined: Sep 2003
Posts: 84
T
Babel fish
OP Offline
Babel fish
T
Joined: Sep 2003
Posts: 84
But on quit does to not work in the bot :S i'm just using a alias command and that does hi don't use the command that it most to do.


Link Copied to Clipboard