Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Globally Open Once....

Globally Open Once....

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by MattMc   USA  (54 posts)  Bio
Date Sun 25 Jul 2004 03:55 AM (UTC)
Message
Hmm, got a peculiar question for you guys.

I have a bot open on a mud. It runs 24/7. I have it set to run on the startup of Mush, and my computer starts mush in the startup list for windows. Even though I have a bot in the game I play, I still play with a normal character.

The bot though uses a perl socket plugin I made (some of you might have seen my horrible attempts at figuring this out at first) and the script works great, but it will sometimes lag the entire mushclient program 2 or 3 seconds... sometimes 5 or 6 seconds. That's alot of lag.

So what I'm asking here is - is there any way to restrict a autostart world from starting if it is already open somewhere else on that computer. I know mushclient won't let it open in the same parent window - but if you open a nother parent window it will still load it.

I want to use a second instance of Mushclient to run my normal character, but don't want the two instances of Mushclient fighting over the character with both of their autologin scripts.

If there is a function already existant to handle this, how would I do it that if that world is already open somewhere, open World B instead. That would rock.


Thanks,
Matt
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #1 on Sun 25 Jul 2004 03:59 AM (UTC)
Message
Hold the ctrl (maybe its shift) key down when you open the 2nd instance of MC, MC will completely skip loading worlds at startup.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by MattMc   USA  (54 posts)  Bio
Date Reply #2 on Sun 25 Jul 2004 04:10 AM (UTC)
Message
Hmm, a good point. I'll do that for now. Does anyone know of any coding functions I can do though?
Top

Posted by Ked   Russia  (524 posts)  Bio
Date Reply #3 on Sun 25 Jul 2004 06:48 AM (UTC)
Message
If you mean that Mushclient is lagged because your plugin is waiting for the net to respond, then why not make it a separate app and load into Mushclient through COM? It's a whole other can of worms, but at least you could code your socket thing the way it's supposed to be coded - in a separate thread.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #4 on Sun 25 Jul 2004 09:59 PM (UTC)
Message
What would probably work fairly well is to make a small plugin that creates a file when it opens (eg. my_world_is_open.txt). This could be in the OnPluginConnect
routine. Then in OnPluginDisconnect you would delete the file. This file effectively becomes the "world is open" flag.

Then you have an additional check, that (before you create this file) you check if it is already there. That means the world must be open already. In that case you don't create the file, and do a:

world.DoCommand "Close"


Or, don't have this world in the startup list, but have another dummy world that checks for this file, and if the world isn't open already, opens it. Something like that.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


18,445 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.