Auto-reconnect script.

Posted by Teepo on Tue 11 Nov 2008 10:31 AM — 3 posts, 17,246 views.

USA #0
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.
USA #1
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".
Australia Forum Administrator #2
There is a reconnector plugin on this page:

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