Window Close Action

Posted by Eos on Fri 29 Mar 2002 02:48 PM — 3 posts, 15,784 views.

USA #0
It would be nice to have the client send a quit message to the server automatically, if a person closes the window while still connected.

Making this 'quit' string user definable with 'quit' or 'logout' as the default text, in the same manner as the terminal-type is settable, would make it perfect.

(Reasons for this being:
to properly close yourself out of things if you've accidentally clicked the stupid X somehow, or if you do it without thinking to quit, or for the amazing number of people who are too stupid to understand closing the little box doesn't necessarily make you no longer there, not to mention makes it easy to truly quit every mud with a single click, heh)
Amended on Fri 29 Mar 2002 02:50 PM by Eos
USA #1
Hmm... Assuming that MUSHclient closes the world -*after*- processing a world.close event you could easielly do this by using a script. However considering the number of thing that I have run into that don't work the way I expected... lol

Basically you would need a script like this (assuming you use vbscript):


sub Closing
  world.send "quit"
end sub


And then adding 'Closing' to world.close under the script settings. If however it breaks the connection, then processes the event you are out of luck. In any case this is a better way than providing a setting that may inadvertantly get cloned in a new world, where quiting by accident could prove costly. ;) Like the mud I play, where you lose all equipment, including weapons and armor if you log off instead of storing it or going linkdead. Very bad news. :p
Amended on Fri 29 Mar 2002 10:17 PM by Shadowfyr
Australia Forum Administrator #2
Surprisingly, perhaps, your suggestion worked. :)

I added a script to the script file


sub onclose
 world.send "say Nick is leaving now"
end sub


I then added "onclose" to the script dialog box, to the event "world close".

Then I clicked on the close box (the X) and (watching with another character), saw this:


Nick says, "Nick is leaving now"
Nick has disconnected.


So, just change the world.send to:


world.send "quit"


... and your job is done!