ID:158975
 
I'm trying to get the main window to close once you logout using a button I made. del(src) not always causes the skin to close so is there any way to close the skin at runtime?

This verb is called by the button.
LogMeOut()
set hidden=1
// bla bla etc
sleep(2)
del(src&&usr) // delete everything! I added both usr and src, now it's closing with 100% success rate, but it could just be luck?


Edit: Still not closing every time.
Delete the client, not the mob ^-^
In response to Spunky_Girl
Still not working with 100% success rate :(
Takoma wrote:
is there any way to close the skin at runtime?

I don't think there's any good/specific way, no. Though you always could set is-visible=false on everything, I guess.

del(src&&usr) // [...]


Naturally, that syntax in there wouldn't do what you'd think. Doing this:
del(A && B)

Provided A is true, is equivalent to just
del(A)


Because that's how programming, and &&, work. src is always true, so your line always deletes only src (which also stops the proc...). In short, to have 2 deletions, you need to have 2 dels (unless you use a loop).

All in all, chances are that that code is in a /mob/verb, where src and usr are entirely equivalent anyway, because normally (and commonly) that's the case. This also means there's no point to experiment deleting one or the other.
LogMeOut()
set hidden=1
// bla bla etc
sleep(2)
winset(src,null,"command=\".quit\"") // close dream seeker
del src // i guess you want to delete src
In response to Jemai1
Ah, right. I guess he was talking about actually closing Dream Seeker, not exactly the skin, oops. Should've worded that better. >_>
In response to Spunky_Girl
Spunky_Girl wrote:
Delete the client, not the mob ^-^

I think you should stop giving advise and take some time studying programming languages, he was clearly talking about the interface not just the connection.
In response to Underworld Kid
As she says, *facepalm*
In response to Jemai1
Thanks guys.