Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, 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
➜ Tips and tricks
➜ Mush client, want to do a variable that toggles some things.
Mush client, want to do a variable that toggles some things.
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Neritla
(5 posts) Bio
|
Date
| Tue 12 Dec 2023 04:49 PM (UTC) Amended on Tue 12 Dec 2023 04:54 PM (UTC) by Fiendish
|
Message
| Morning, want to do something for a game, friend and I am using the same soundpack, which I am working on, thing is our aliases are diferent, want to have the ability to toggle while in game.
I am thinking something like this. At least for the variables.
if not GetVariable("RHC") == "false" then
LHC=true
enable alias group="LHC"
SetVariable("LHC", "true")
elseif GetVariable("LHC") == "false" then
RHC=true
enable alias group=RHC""
SetVariable("RHC", "true")
I want to have notes something like this. Note("Commands swapped, you can now use usf usi and usr!") Or You can now use sfi, srs, and sis.
Something like that. Probably would put that in the then thing, but no idea, I just no how to ImportXML playsounds and kind of work with regexp, most of the lua stuff kind of goes over my head, and just figuring out what to do there.
I am thinking for alias.
<alias>
match="MKtog"
enabled="y"
Send_to="12"
sequence="100"
>
</send>if RHC=true then LHC=false SetVariable("LHC", false") elseif LHC=true then RHC=false SetVariable("RHC", "false")
Anyway, hope this isn't to bad to read.
Thanks in advance. | Top |
|
Posted by
| Fiendish
USA (2,533 posts) Bio
Global Moderator |
Date
| Reply #1 on Tue 12 Dec 2023 04:54 PM (UTC) Amended on Tue 12 Dec 2023 05:03 PM (UTC) by Fiendish
|
Message
| I'm having difficulty understanding what you're asking about here. It's not clear what you're trying to accomplish.
Quote: our aliases are diferent
What is the relevance of this statement to your note? Why are you and your friend's aliases different? What do you want to do in relation to that difference?
Quote: want to have the ability to toggle
Toggle what? And why do you want to toggle it?
What are RHC, LHC, usf, usi, usr, sfi, srs, and sis? |
https://github.com/fiendish/aardwolfclientpackage | Top |
|
Posted by
| Neritla
(5 posts) Bio
|
Date
| Reply #2 on Tue 12 Dec 2023 06:04 PM (UTC) |
Message
| RHC is for right handed commands, commands that lead with the right hand, LHC is commands that lead with the left hand, friend and I had diferent aliases and could agree on some but not all.
I wanted usi, use spellblade icesword at %1
They wanted sis use spellblade icesword at %1
I wanted usr use spellblade runestrike at %1, they wanted srs use spellblade runestrike at %1
I wanted usf use spellblade firesword at %1, they wanted sfi use spellblade firesword at %1
Which is the reason for the alias toggler I wanted a way to let us toggle between them without going to the lua files and having to do enabled="y and enabled="n" every time.
I hope this makes sense, and if it doesn't, I guess I can just scrap the idea and just split it off into different lua files and just say your on your own with your own stuff. | Top |
|
Posted by
| Fiendish
USA (2,533 posts) Bio
Global Moderator |
Date
| Reply #3 on Tue 12 Dec 2023 07:27 PM (UTC) |
Message
|
Quote:
I wanted usi, use spellblade icesword at %1
They wanted sis use spellblade icesword at %1
I wanted usr use spellblade runestrike at %1, they wanted srs use spellblade runestrike at %1
I wanted usf use spellblade firesword at %1, they wanted sfi use spellblade firesword at %1
🤦♂️ |
https://github.com/fiendish/aardwolfclientpackage | Top |
|
Posted by
| Neritla
(5 posts) Bio
|
Date
| Reply #4 on Tue 12 Dec 2023 07:41 PM (UTC) |
Message
| NVDA doesn't capture your symbols accept for the male one... but Yeah, that is the thing. Anyway, guess I will have to split off.
Looks like variables like what I am thinking can never happen, toggling timestamps? sure. Making something true and then false and then enabling an alias group at the same time as making something else true and false and then enabling another alias group at the same time Yeah. No. Thanks for your time.
Though thought there was a way to do this via functions, guess the thing is dead. | Top |
|
Posted by
| Fiendish
USA (2,533 posts) Bio
Global Moderator |
Date
| Reply #5 on Tue 12 Dec 2023 09:37 PM (UTC) Amended on Tue 12 Dec 2023 09:38 PM (UTC) by Fiendish
|
Message
| It is possible. I just think that it will be easier for you to maintain doing it the old-fashioned way. Can you not just make a single set of aliases and tell your friend that they can make whatever changes they want? Or make both simultaneously and you use one set and your friend uses the other set without modifying anything? This toggling business seems like a bunch of complexity for kind of no good reason. |
https://github.com/fiendish/aardwolfclientpackage | Top |
|
Posted by
| Neritla
(5 posts) Bio
|
Date
| Reply #6 on Tue 12 Dec 2023 11:41 PM (UTC) Amended on Wed 13 Dec 2023 06:49 AM (UTC) by Nick Gammon
|
Message
| Yeah, about that it is actually 4 aliases, or more if you look more closely.
It is kind of bad and I would like everything in 1 at least for each spell. Right now this is what I have for say flamestrike, but everything more or less functions like this. Also would have liked to make the variable thing work so we both got what we wanted, friend has no coding knowledge accept for being able to search for sounds over the web, they cannot do any of this stuff. playsound, what's that. require name.name, haha, nope.
Tried to explain triggers and they looked at all of it and got a head ache. And they are good at math where as I suck at it, go figure.
Anyway, for say, firesword, we have something like this.
<alias
match="sfi *"
send_to="12"
enabled="y"
group="mysticknight"
sequence="100"
>
<send>Send("use spellblade firesword at %1")</send>
</alias>
<alias
match="sfi"
send_to="12"
enabled="y"
group="mysticknight"
sequence="100"
>
<send>Execute("sfi *")</send>
</alias>
| Top |
|
Posted by
| Nick Gammon
Australia (23,046 posts) Bio
Forum Administrator |
Date
| Reply #7 on Wed 13 Dec 2023 07:02 AM (UTC) |
Message
|
Quote:
I wanted usi, use spellblade icesword at %1
They wanted sis use spellblade icesword at %1
Can't you give them your aliases, and make some bridging aliases? eg. for your example, give them the "usi" alias, but make another one called "sis" that sends to Execute "usi %1".
Or, just give then your aliases, and tell them that if they want to use different words, edit the alias in the alias editor and change "usi" to "sis". It's not rocket surgery, and someone good at maths should be able to do that.
Yet another alternative is to make your aliases do both.
Change "usi *" to be "^(?:usi|sis) (.*)$" and check the "regular expression" box. Now that one alias will match both words. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Neritla
(5 posts) Bio
|
Date
| Reply #8 on Wed 13 Dec 2023 11:30 AM (UTC) |
Message
| Didn't consider you could do something like that, I knew about regexp, but couldn't make these work like that. Or just didn't think of it. I had only considered the percent1 once, though I have been tooling regexp to triggers a bunch. Going to do a little bit of both.
Actually tried coding this by hand in a lua file. The send_to="12" had 2 less than signs on the thing for lines 15 and 24 and the quotes were missing for 2 of the alias match strings. Yeah, I got nothing. Tracked it down and just fixed the sucker.
If I have anymore problems, going to come back here. Currently thinking about next working on the mysticknight auras, enfire, enfrost, enthunder, enstone, enwater, enaero, endark, and enholy, should be fun.
Thanks everyone. More then happy to close this thing down. | 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.
4,201 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top