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.
Entire forum
➜ MUSHclient
➜ General
➜ 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 page
Posted by
| Feantur
(70 posts) 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? | Top |
|
Posted by
| Poromenos
Greece (1,037 posts) 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! | Top |
|
Posted by
| Nick Gammon
Australia (23,120 posts) 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 | Top |
|
Posted by
| Feantur
(70 posts) 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? | Top |
|
Posted by
| Flannel
USA (1,230 posts) 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. | Top |
|
Posted by
| Feantur
(70 posts) 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... :-( | Top |
|
Posted by
| Flannel
USA (1,230 posts) 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. | Top |
|
Posted by
| Feantur
(70 posts) 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? | Top |
|
Posted by
| Nick Gammon
Australia (23,120 posts) Bio
Forum Administrator |
Date
| Reply #8 on Sat 18 Dec 2004 04:27 AM (UTC) |
Message
| |
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.
24,828 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top