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 ➜ VBscript ➜ Auto-reconnect script.

Auto-reconnect script.

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


Posted by Teepo   USA  (7 posts)  Bio
Date Tue 11 Nov 2008 10:31 AM (UTC)
Message
sub OnWorldClose

dim otherworld

set otherworld = world.open ("myWorld.mcl")

if not (otherworld is nothing) then
otherworld.send "say hello everyone"
end if

end sub
====================================================

Just to show what I've gotten from exampscript.vbs and a post reference to world.open My first question is to ask what lines 7 - 9 mean. Specifically (otherworld is nothing)

The idea is that if I am disconnected from myWorld.mcl, I'll attempt to reconnect and login. My thought was this.

=================================
sub OnWorldClose

dim otherworld

set otherworld = world.open ("myWorld.mcl")

otherworld.send "name"
otherworld.send "password"
otherworld.send "bypassMOTD"

end sub
=================================

Also, I'd like to know how I would go about turning this into a script that not only will reconnect, but upon a failed reconnect attempt (through the use of a timer, something like a timeout check to stop the attempted connection) will keep trying to connect until successful. This would keep checking until my ISP came back up. My thought is to use /const eActiveWhenClosed = 32 ' timer fires even when world is disconnected/ which I also found in exampscript.vbs, to get this accomplished. Any advice and snips would be greatly appreciated in my growth to scripting.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Tue 11 Nov 2008 06:04 PM (UTC)
Message
My VBscript is rusty, but I believe that "otherworld is nothing" is basically testing if the world.open command failed, in other words, did it return "nothing". Adding a "not" in front means checking for success, i.e. "otherworld is not nothing", or, "otherworld is something".

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #2 on Tue 11 Nov 2008 07:15 PM (UTC)
Message
There is a reconnector plugin on this page:

http://www.gammon.com.au/plugins/

- 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.


16,382 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.