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 ➜ Bug reports ➜ Scripts and reconnecting.

Scripts and reconnecting.

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


Posted by Shadowfyr   USA  (1,791 posts)  Bio
Date Sun 04 Nov 2001 01:08 AM (UTC)
Message
This started in a different forum, but I took your advice about creating an auto reconnect script, instead of relying on the one in the menu. Ran into a problem though.

I have a start script which on connecting sets 2 variables. One to turn off my quit script (so I don't accidently disconnect). And one to turn on the auto-reconnect.

The problem is that when the mud reboots, the client pops up an alert. If you do not click on it immediately, the client tries to run the start script, then when you do click OK, crashes with a scripting error that terminates the program. It only happens when the alert is shown. I haven't looked to see if this alert can simply be turned off or not yet, but will as soon as I finish posting this.
Top

Posted by Shadowfyr   USA  (1,791 posts)  Bio
Date Reply #1 on Sun 04 Nov 2001 04:35 AM (UTC)

Amended on Sun 04 Nov 2001 06:47 AM (UTC) by Shadowfyr

Message
Ok. Here are the actually scripts and associated aliases, etc. As well as the sequence of events leading to the error.

>On World.Connect: Start

sub Start
  world.setvariable "QuitSW", "OFF"
  world.setvariable "AReconnect", "ON"
end sub

>On World.Disconnect: Terminate

sub Terminate
  if world.getvariable ("AReconnect") = "ON" then
    world.connect
  end if
end sub

>Alias: quit
> Script: Quitit

sub Quitit (AliasName, Output, Wildcards)
  if world.getvariable ("QuitSW") = "ON" then
    world.setvariable "AReconnect", "OFF"
    world.send "xyzzq"

      ^----- NOTE: Aliased mud side as quit. Since I have had aliases execute a different alias. I.E. Aliasing xyzzy = quit tends to cause the quit = " " to execute after the client is shut down and restarted, but not the first time using the new alias, odd...

  else
    world.note "Quit is OFF"
  end if
end sub

>Alias: setquit *
> Script: SetQuit

sub SetQuit (AliasName, Output, Wildcards)
  select case Wildcards(1)
  case "ON"
    world.setvariable "QuitSW","ON"
    world.note "Quit is ON"
  case "on"
    world.setvariable "QuitSW","ON"
    world.note "Quit is ON"
  case "OFF"
    world.setvariable "QuitSW","OFF"
    world.note "Quit is OFF"
  case "off"
    world.setvariable "QuitSW","OFF"
    world.note "Quit is OFF"
  case "status"
    world.note "Quit is currently " & world.getvariable("QuitSW")
  case else
    world.note "Error: - Must be ON or OFF"
  end select
end sub

>Alias: recon *
> Script: SetRecon

sub SetRecon (AliasName, Output, Wildcards)
  select case Wildcards(1)
  case "ON"
    world.setvariable "AReconnect","ON"
    world.note "Client will now Reconnect on Disconnect"
  case "on"
    world.setvariable "AReconnect","ON"
    world.note "Client will now Reconnect on Disconnect"
  case "OFF"
    world.setvariable "AReconnect","OFF"
    world.note "Reconnect on Disconnect OFF"
  case "off"
    world.setvariable "AReconnect","OFF"
    world.note "Reconnect on Disconnect OFF"
  case "status"
    world.note "Reconnect on Disconnect is currently " & world.getvariable("AReconnect")
  case else
    world.note "Error: - Must be ON or OFF"
  end select
end sub


<Sequence>
Connect commands:
  Connect
  Send Name
  Send Password
  Send Y - In case this is to reconnect a dropped link.
  Send motd - Message of the day.
  send lwho - See whos on.

Start script executes.
...
Playing
...
Reboot - Remote server diconnects.
Mushclient Alert displayed.
-Terminate script executes and calls World.Connect
-Connect commands repeated.
-Start script called.
-Page Fault and program shuts down.

or

-Terminate script executes and calls World.Connect
-Hit OK before connect commands repeat.
-Connect commands repeat.
-Start script executes.
-Everthing is fine.


Needless to say the first version of these events (with the alert still active) is not very useful... ;)
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #2 on Sun 04 Nov 2001 09:07 AM (UTC)
Message
I would guess you have hit a bug caused by the sequence of events. Probably what happens when you are disconnected is that scripting is shut down (by the client) and then when it tries to run the disconnect script it crashes. I am guessing right now, but it will be something like that.

I'll take a look at that for the next version.

- Nick Gammon

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

Posted by Shadowfyr   USA  (1,791 posts)  Bio
Date Reply #3 on Sun 04 Nov 2001 06:57 PM (UTC)

Amended on Mon 05 Nov 2001 04:09 AM (UTC) by Shadowfyr

Message
Hmm. Not quite. The termination script (I.E. disconnect script) does execute, since it has to call 'World.Connect' to reconnect to the mud. Otherwise it would crash before the mud reconnected and the client began sending the user name, password and other stuff needed to log in. So the problem may not be with scripting being shut down, it may be that the client is temporarily suspending scripting when alert messages are displayed or something. Of course I am not sure how your code works, the alert dialog may be a sign that the client has 'completed' the disconnect, in which case, since the client hadn't 'disconnected' when the Terminate script executed the scripting would still be active, until just before/after the dialog displays... Definitely an interesting glitch in any case. ;)
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #4 on Sun 04 Nov 2001 10:06 PM (UTC)
Message
The alert you mentioned in the first message of this thread ... is that this one?


The connection to (mud) is not open. Attempt to reconnect?


- Nick Gammon

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

Posted by Shadowfyr   USA  (1,791 posts)  Bio
Date Reply #5 on Mon 05 Nov 2001 04:12 AM (UTC)

Amended on Mon 05 Nov 2001 06:22 AM (UTC) by Shadowfyr

Message
No. It is something like, 'Remote host (Ages of Despair) has severed the connection'.... Not sure exactly, but it is the one that comes up whenever I log off instead of simply dropping link, etc.

Also, as I said, login occures normally, user name, password, etc. are entered. All other commands execute and everything looks ok, until you try to click on OK. If you do so before all the commands execute and you are left with just a prompt (I.E. when the initial game screen comes up and asks for the password, to the moment the lwho command is executed) everything works. If you wait too long and all the commands are processed by the mud before hitting OK, it causes a page fault. Since this only happens when using World.connect from the termination script I assume it means that your client is sending all the commands in 'General - Connecting - Connect Text', then tries to call the script 'Start', once that happens clicking on OK will cause a crash.
Top

Posted by Shadowfyr   USA  (1,791 posts)  Bio
Date Reply #6 on Tue 06 Nov 2001 09:25 AM (UTC)
Message
Almost had it right. The actual alert message is>

The 'Ages of Despair" server has closed the connection.

or at least real close to that. I hit OK before remembering I needed to write it down. lol
Top

Posted by Shadowfyr   USA  (1,791 posts)  Bio
Date Reply #7 on Wed 14 Nov 2001 05:39 AM (UTC)
Message
Also just noticed today. When that particular dialog is shown, the task bar icon that you click to connect/disconnect remains down until you close the dialog. Is it possible that the client is shuting down the specific world and does not complete the task till the dialog is closed. Since a normal auto-reconnect bypasses the dialog, an error would never occure. However, if the dialog displays prior to finishing all the tasks to complete a disconnect it is possible that one of those tasks frees memory or something needed by the script.

I assume that vbscript acts like a COM object in this case, using the clients namespace/memory to execute. So releasing this memory when the dialog closes would leave one or more processes without the objects they intended to link/call.
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #8 on Sat 04 May 2002 12:07 AM (UTC)
Message
Go to the Global Configuration, and uncheck "Notify me when connection broken".

- Nick Gammon

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

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #9 on Sun 05 May 2002 03:10 AM (UTC)
Message
Also, version 3.19 allows you to eliminated the "unable to connect" message, fixes a problem with auto-reconnected, and allows you to have timers that fire when disconnected.

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


22,842 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.