[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  MXP and Pueblo
. . -> [Subject]  Vbasic Scripting, creating entities and loading them elsewhere in plugin

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Vbasic Scripting, creating entities and loading them elsewhere in plugin
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Nick Gammon   Australia  (18,769 posts)  [Biography] bio   Forum Administrator
Date Fri 28 Jan 2005 11:10 PM (UTC)  quote  ]
Message
See:


http://www.gammon.com.au/scripts/doc.php?function=GetEntity


However the answers above are correct, this is a server entity. For entities you yourself define you need to leave the CDATA block.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Tsunami   USA  (204 posts)  [Biography] bio
Date Thu 27 Jan 2005 06:58 PM (UTC)  quote  ]
Message
Heh, the part about not needing to use world.'' was news to me!
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Thu 27 Jan 2005 05:18 PM (UTC)  quote  ]
Message
No, GetEntity is not a VB function (at least not according to the script docs).

Mushclient doesn't need 'world.' for everything, only execute (because that IS a VBScript command), everything else it just assumes (as of... well, whatever version).

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Tsunami   USA  (204 posts)  [Biography] bio
Date Thu 27 Jan 2005 12:51 PM (UTC)  quote  ]
Message
Yes, you have to exit the CDATA block. Just wondering, GetEntity is VB, neh? Not MC, because I don't see world.GetEntity. Is that a valid VB call then, and if so, what does it do?
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Thu 27 Jan 2005 10:24 AM (UTC)  quote  ]
Message
I don't think &path works inside the CDATA block though...

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Thu 27 Jan 2005 04:52 AM (UTC)  quote  ]

Amended on Thu 27 Jan 2005 04:55 AM (UTC) by Flannel

Message
Why dont you just note &path; and skip the variable all together?

GetEntity is designed for server entities (as in MXP), not plugin entities.
So it returns the empty string (since no entity by that name is found) and thus a blank line is noted.

As of next version (3.66) you'll be able to set server entities using SetEntity, but that still isn't relevant here.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Tsunami   USA  (204 posts)  [Biography] bio
Date Thu 27 Jan 2005 12:42 AM (UTC)  quote  ]
Message
There's a much easier way to do it by simply exiting the CDATA block briefly instead of using GetEntity. Excuse any errors in the code, this is quick and dirty.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient [
<!ENTITY path "C:\Program Files\folder\program.exe" >
]>

...

<script>
<![CDATA[
sub ShowPath (a,b,c)
dim path
]]>

path = &path;

<![CDATA[
world.note path
end sub
...

Hope that helps.
[Go to top] top

Posted by MattMc   USA  (54 posts)  [Biography] bio
Date Wed 26 Jan 2005 09:50 PM (UTC)  quote  ]
Message
Howdy, here's an example of some code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient [
<!ENTITY path "C:\Program Files\folder\program.exe" >
]>
[skipping standard stuff, alias, triggers, and timers..]

<script>
<![CDATA[
sub ShowPath (a,b,c)
dim path
path = GetEntity("path")
world.note path
end sub

This is a cut-dry version of the code I'm using, so ignore the simplicity. The problem is that the world.note sends a blank line - Why doesn't GetEntity respect the definition above?


Matt
[Go to top] 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.


3,916 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]