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 ➜ Suggestions ➜ Quick Connect, this world's data

Quick Connect, this world's data

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


Posted by Zeno   USA  (2,871 posts)  Bio
Date Tue 15 Jun 2004 03:10 PM (UTC)
Message
I'm always opening a Quick Connect, and entering the same address and port as my current world, as of I need to test things with another character. What about in the Quick Connect dialog box, you add a drop down box, that has all the open worlds listed, and a button that if clicked, will fill in the address, port, world name of the selected open world?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 15 Jun 2004 11:36 PM (UTC)
Message
How about this? This is an alias that will do that if you type "newworld".


<aliases>
  <alias
   match="newworld"
   enabled="y"
   echo_alias="y"
   send_to="12"
   sequence="100"
  >
  <send>filename = "c:\\newworld.mcl"
Set fs = CreateObject("Scripting.FileSystemObject")
Set file = fs.CreateTextFile(filename, vbTrue )
file.Write "&lt;?xml version=""1.0"" encoding=""iso-8859-1""?&gt;" &amp; vbCrLf
file.Write "&lt;!DOCTYPE muclient&gt;" &amp; vbCrLf
file.Write "&lt;muclient&gt;" &amp; vbCrLf
file.Write "&lt;world defaults=""y"" " &amp; vbCrLf 
file.Write " name=""" &amp; WorldName &amp; " (copy)"" " &amp; vbCrLf
file.Write " site=""" &amp; WorldAddress &amp; """ " &amp; vbCrLf
file.Write " port=""" &amp; WorldPort &amp; """ " &amp; vbCrLf
file.Write "/&gt;" &amp; vbCrLf
file.Write "&lt;/muclient&gt;" &amp; vbCrLf
file.Close
Set fs = Nothing
world.Open filename</send>
  </alias>
</aliases>



You may like to change the first line in the "send" text (the filename) to be something better (eg. add a number to it or something).

What this does is write a small text file like this:


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<muclient>
<world defaults="y" 
 name="Your current world name (copy)" 
 site="your.current.world.address" 
 port="4000" 
/>
</muclient>


It then uses the world.Open command to open it, thus effectively creating a new world with the same settings as the world from which you execute it.

In a couple of minutes' work you could bang the whole thing into a plugin, make it a global plugin, and then the "newworld" alias will work in whatever world you have currently open.

- Nick Gammon

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

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #2 on Wed 16 Jun 2004 01:25 AM (UTC)
Message
Is that alias suppose to work without changing it?


Error number: -2146827284
Event:        Execution of line 2 column 5
Description:  Expected ';'
Line in error: 
Set fs = CreateObject("Scripting.FileSystemObject")
Called by:    Immediate execution

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #3 on Wed 16 Jun 2004 06:07 AM (UTC)
Message
That particular alias was written to use VBscript - is that the language you have the scripting set to?

If not, I can turn it into a plugin that will use VBscript (or, change the script language yourself).

- Nick Gammon

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

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #4 on Wed 16 Jun 2004 11:15 AM (UTC)

Amended on Wed 16 Jun 2004 06:56 PM (UTC) by Zeno

Message
Ah, it was set to Jscript. Not sure why. Alright it works, I'll make a plugin of it sometime soon, thanks.

Made the plugin. Thanks.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #5 on Thu 01 May 2008 06:55 AM (UTC)

Amended on Thu 01 May 2008 06:57 AM (UTC) by Nick Gammon

Message
Here is a Lua version of the same thing:


<aliases>
  <alias
   match="newworld"
   enabled="y"
   echo_alias="y"
   send_to="12"
   sequence="100"
  >
  <send>

do  -- keep variables local
  local filename = GetInfo (67) .. "newworld.mcl"
  local f = io.output (filename)  -- create world file
  assert (f:write [[
&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;
&lt;!DOCTYPE muclient&gt;
&lt;muclient&gt;
&lt;world defaults="y" 
 name="Your current world name (copy)" 
 site="your.current.world.address" 
 port="4000" 
/&gt;
&lt;/muclient&gt; 
  ]])
  f:close ()  -- close world file now
  
  Open (filename)  -- now get MUSHclient to open the world
end  -- of do

</send>
  </alias>
</aliases>



This one uses GetWorld (67) to open the world file in the current MUSHclient worlds directory.

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