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
➜ Lua
➜ if/then wont read variable
|
if/then wont read variable
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Vessarr
(16 posts) Bio
|
| Date
| Sun 27 Jul 2014 09:06 PM (UTC) |
| Message
| Let me start off saying this is the first thing iv tryed scripting in a long time.. What im trying to do is get a trigger to send a tell to myself that then triggers a midi file to play but only when the music is off so it dosent restart the file every time I walk though the room.
Im trying to do it this way so that i can use midi files instead of .wav files.
Iv got this script set on a trigger that goes off whenever I enter a main room.
if mainmusic == off then
Send "tell vessarr playingmainmusic"
end
It goes off every time even though the variable mainmusic is set to on the tell that gets sent to start the music also sets mainmusic to on. Its like its running the Send line sepretly from the if/then. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Sun 27 Jul 2014 09:31 PM (UTC) |
| Message
| How is "mainmusic" changed?
This looks wrong on a number of fronts. Perhaps:
if mainmusic == "off" then
or:
if GetVariable ("mainmusic") == "off" then
See this video about the difference between MUSHclient variables and script variables:
http://www.gammon.com.au/forum/?id=10863 |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Vessarr
(16 posts) Bio
|
| Date
| Reply #2 on Sun 27 Jul 2014 10:18 PM (UTC) |
| Message
| i wish i could watch videos... my internet connection maxs out at 12kbs on a 56k modem.. hence why im playing muds lol
it switchs mainmusic from off to on which makes the if then untrue so that if i enter the room it wont send the tell again.
of corse thats all not an issue anymore as your getvariable suggestion got everything working smoothly and as it should be! so thank you very much | | 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.
14,807 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top