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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  JScript + world.sound + timer problem

JScript + world.sound + timer problem

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


Posted by Feantur   (70 posts)  [Biography] bio
Date Sat 16 Oct 2004 12:31 PM (UTC)

Amended on Sat 16 Oct 2004 12:32 PM (UTC) by Feantur

Message
I have a timer that runs at intervals. It is set to send to script and it has one line which is also the line it reports to be having an error in:

Expected hexadecimal digit
Line in error:
world.Sound("c:\windows\media\x.wav");

What hexadecimal digit?
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #1 on Sat 16 Oct 2004 01:38 PM (UTC)
Message
It probably tries to interpret \x as a hex sequence, like in \x31. Try escaping the backslashes.

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

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Sat 16 Oct 2004 09:28 PM (UTC)
Message
It *will* do that. Each backslash needs to be two backslashes.

- Nick Gammon

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

Posted by Feantur   (70 posts)  [Biography] bio
Date Reply #3 on Sun 17 Oct 2004 06:25 AM (UTC)
Message
Great, this works now. Thanks!

The next thing I'd like to tackle would be resetting the timer whenever I send something to the world. How could I do that?
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #4 on Sun 17 Oct 2004 10:04 AM (UTC)
Message
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=1692
Use a plugin callback (which either means moving the whole thing to a plugin, or just this callback with a way to reset a main world thing (such as world.execute).

Use OnPluginCommand, or OnPluginSend, depending on which you want.

I... think thats the only way. There might be a way that escapes me at the moment to do it without a plugin.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Feantur   (70 posts)  [Biography] bio
Date Reply #5 on Sun 17 Oct 2004 05:34 PM (UTC)
Message
Uhoh. I don't have any experience with writing plugins for the client... :-(
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #6 on Sun 17 Oct 2004 06:32 PM (UTC)
Message
Its easy. Its just like writing triggers and such.

Only you have a different script "space", think of it as just a different environment. It cant talk directly with the script space for your main world, or any other plugin.

And that callback, just make it a subroutine in your plugin file.

Its the exact same stuff youve been doing with triggers/et al for the world file. Only you have to edit it in a text editor (or the plugin wizard).

Search the forums (browse the plugin forum) there are some nice simple examples that you can use to build on (like having to use <[CDATA] to enclose your script stuffs.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Feantur   (70 posts)  [Biography] bio
Date Reply #7 on Sat 18 Dec 2004 03:54 AM (UTC)

Amended on Sat 18 Dec 2004 03:55 AM (UTC) by Feantur

Message
Right, I lost track of this a bit. I've looked at a few plugins since the last post on this thread - don't manage to get it to work.

Is there some tutorial on how to write plugins?

I assume what you suggested is writing a plugin that calls on the timer and resets it. What I don't understand is, how does the plugin know when to do the call at the timer?
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #8 on Sat 18 Dec 2004 04:27 AM (UTC)
Message
The bottom of this page covers it briefly:

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

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[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.


22,268 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

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

[Best viewed with any browser - 2K]    [Hosted at HostDash]