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
➜ General
➜ Additional Variable
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Assassin
(73 posts) Bio
|
Date
| Mon 01 Mar 2004 07:50 PM (UTC) Amended on Tue 02 Mar 2004 09:21 PM (UTC) by Assassin
|
Message
| Need a bit of advice about changing my setup, at moment
thanks to Nick, i use the following:-
Keypad 1-9 are my different weapon types
Variable w1 is used to hold different weapon types
depending on which Keypad is used.
However i need to make an additonal variable ideally w2
would be good, as im going higher in levels i have the
ability of using dual and triple weapons, i need something
like when w1 has a weapon in, the next keypad pressed
would put that weapon in w2
Am i making sense?
Please help, thanks..
PLEASE PLEASE HELP | Top |
|
Posted by
| Assassin
(73 posts) Bio
|
Date
| Reply #1 on Wed 03 Mar 2004 08:52 PM (UTC) |
Message
| Anyone any ideas about a 2nd variable???
Please help
| Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #2 on Wed 03 Mar 2004 08:59 PM (UTC) |
Message
| It is a bit hard to follow what you are doing. The keypad calls an alias, right? And that assigns a weapon? Can you copy and paste on of the aliases so I can see what you are doing? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Assassin
(73 posts) Bio
|
Date
| Reply #3 on Wed 03 Mar 2004 09:16 PM (UTC) |
Message
| <aliases>
<alias
match="keypad-1"
enabled="y"
variable="w1"
send_to="9"
sequence="100"
>
<send>axe</send>
</alias>
</aliases>
Ok at moment when i press one of the keypads 1-9
it will assign the weapon i have assigned to that keypad
to w1.
Now i need to have another variable possibly w2.
As an example if i were to press 1 on the keypad this
would put axe in w1 variable, i need another variable
to assign one of the other keypad numbers to w2, i dont
know whether an alteration of the original alias would
help, something on the lines of if theirs a variable
already in w1 then automatically put in w2.
Does that make sense?
| Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #4 on Wed 03 Mar 2004 10:57 PM (UTC) |
Message
|
Quote:
Need a bit of advice about changing my setup, at moment
thanks to Nick ...
OK, Assassin, here's my problem.
According to the forum (next to your name here) you have made 31 posts, however when I click on your bio I see that there is only one thread attributed to you, which is this one.
Where are all the other posts, I ask myself?
I bit of research shows that on the 2nd of March (two days ago) you deleted a whole heap of posts made by you, the ones in fact about the keypad, the alias, the variables, pasting aliases and so on.
The whole point of this forum is to keep the postings so that other people can get help from it, if you delete your posts after I have answered the question, then only you have benefited from the answer, and you have taken away the chance for others to be helped as well.
I know you can't delete my answers, only your questions, but the answers don't make much sense unless you see what they are answering.
Why did you do that?
I don't feel like going to a lot of effort writing aliases, answering questions, and so on, when you turn around and try to delete everything when I have finished.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Assassin
(73 posts) Bio
|
Date
| Reply #5 on Thu 04 Mar 2004 12:02 AM (UTC) |
Message
| Nick, it was an honest mistake and not an attempt to
deceive other forum users, i will be glad to share
any of the help you have given to anyone who is in need.
| Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #6 on Thu 04 Mar 2004 12:06 AM (UTC) |
Message
| OK, well with your keypad, I understand that if you press (say) "1" then if you already have an axe in W1 you might want to put it into W2, but then what? How does W1 ever get changed, as it will always have something in it?
The quick answer would be to do this (with "send to script" rather than "send to variable") ...
if GetVariable ("w1") = "" then
SetVariable "w1", "axe"
else
SetVariable "w2", "axe"
end if
However it seems to me that once you have pressed this keypad twice, w1 will contain "axe" and then so will "w2".
Maybe you need a key that clears both variables (eg. the "-" key) and then it will work better.
eg.
SetVariable "w1", ""
SetVariable "w2", ""
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Assassin
(73 posts) Bio
|
Date
| Reply #7 on Thu 04 Mar 2004 12:32 AM (UTC) |
Message
| <aliases>
<alias
match="steal_macro"
enabled="y"
expand_variables="y"
sequence="100"
>
<send>steal @w1</send>
</alias>
</aliases>
Ok i see your point, i'll try and explain in a bit more
detail, if im attacked at the moment i can only steal
with above alias one weapon, and this is used in conjunction with:-
<aliases>
<alias
match="keypad-1"
enabled="y"
variable="w1"
send_to="9"
sequence="100"
>
<send>axe</send>
</alias>
</aliases>
So what ever weapon my attacker or who im attacking is
using i can change in seconds with the keypad, as each
key number has a different weapon type assigned.
However if im attacked with two weapons this is where
im getting stuck, if i find the axe and mace, then
i need either axe into w1 and mace into w2 it doesnt matter
which variable is used, then i can alter my alias
steal_macro to send steal @w1 and @w2.
| Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #8 on Thu 04 Mar 2004 12:44 AM (UTC) |
Message
| Have you tried Ctrl+keypad?
In keypad editing click on the checkbox "show contents if ctrl held down".
This could be a useful way of setting the other variable.
Just make another batch of aliases this time setting W2 rather than W1. Then set the keypad to call the second batch of aliases.
Then if you are attacked with an axe and a mace, you might type:
Keypad-1 (axe into W1)
Ctrl + Keypad-2 (mace into W2)
That would set up both weapons quickly.
Alternatively, my other idea would still work. Make the alias test to see if the variable is already set, and if so, set the W2 variable. I already gave the code to do that above.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Assassin
(73 posts) Bio
|
Date
| Reply #9 on Thu 04 Mar 2004 07:46 AM (UTC) |
Message
| Cheers Nick, i'll give it a bash.
I was thinking about using a trigger to capture the weapon
and then storing that in the variable.
| Top |
|
Posted by
| Assassin
(73 posts) Bio
|
Date
| Reply #10 on Thu 04 Mar 2004 07:54 PM (UTC) |
Message
| match="keypad-1"
enabled="y"
send_to="12"
sequence="100"
SetVariable "w1", ""
SetVariable "w2", ""
If GetVariable ("w1") = "" then
SetVariable "w1", "axe"
else
SetVariable "w2", "axe"
end if
Ok, i have this entered on keypad-1 alias. Its not
moving my alias to w2 if w1 has something already
in it, ie: its just changing w1 every time and leaving
w2 blank. | Top |
|
Posted by
| Magnum
Canada (580 posts) Bio
|
Date
| Reply #11 on Thu 04 Mar 2004 09:55 PM (UTC) |
Message
|
match="keypad-1"
enabled="y"
send_to="12"
sequence="100"
SetVariable "w1", "" <-------- !!!!!!!!!
SetVariable "w2", ""
If GetVariable ("w1") = "" then
SetVariable "w1", "axe"
else
SetVariable "w2", "axe"
end if
You clear w1, so it is always blank, so w2 never gets used. |
Get my plugins here: http://www.magnumsworld.com/muds/
Constantly proving I don't know what I am doing...
Magnum. | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #12 on Thu 04 Mar 2004 10:51 PM (UTC) |
Message
| Assassin, you have combined my two suggestions into a single alias, which will not work.
I suggested a second alias (eg. keypad - ) to clear both variables, and then use the other ones to set the first and then the second. You can hardly do both in a single alias, as Magnum points out. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Assassin
(73 posts) Bio
|
Date
| Reply #13 on Fri 05 Mar 2004 12:54 AM (UTC) |
Message
| <aliases>
<alias
match="keypad-1"
enabled="y"
variable="w1"
send_to="12"
sequence="100"
if GetVariable ("w1") = "" then
SetVariable "w1", "axe"
else
SetVariable "w2", "axe"
end if
>
</alias>
</aliases>
Line 8: Attribute name 'if' not followed by '=' (problem in this file)
| Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #14 on Fri 05 Mar 2004 02:08 AM (UTC) |
Message
|
Quote:
match="keypad-1"
enabled="y"
send_to="12"
sequence="100"
SetVariable "w1", ""
SetVariable "w2", ""
If GetVariable ("w1") = "" then
SetVariable "w1", "axe"
else
SetVariable "w2", "axe"
end if
What are you doing here? This is a mixture of the XML from copying the alias, with some hand-adjustments.
Just edit the alias in the GUI dialog box, don't try doing it here. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | 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.
38,297 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top