|
Darkflame808 Beginner
Joined: 21 Sep 2010 Posts: 22
|
Posted: Tue Sep 21, 2010 3:16 am
Create a table for shortcuts? |
I have a question regarding shortcuts.
I would like to make a script that basically lets me do this.
I can make a list like this
home 341
emporium 598
smith 988
armor 924
goldmine 7166
and from there I can type go home and it'll put #walk 341 or go emporium and it'll put #walk 598.
I know how to make the script and I also know I can set up a bazillion aliases to do that too but something simple and cleaner (a table to reference if you would).
Also the second portion of my script. is it possible to have the script (if it's in map mode temporarily switch to follow mode) while it's running? bebcause some rooms don't recognize in map mode but when in follow it doesn't check names it just assumes the next command was successful. Once I reach my destinatiopn it would return to map mode.
I hope this isn't too complicated. Thank you guys for all of your help!
Regarding the script I meant I know I can do an alias for go home to equal #walk 341 but I wanted to keep it clean.
I was thinking something like a
#if %1 = home then {#walk 341}
#if %1 = emporium then {#walk etc.....
but I am not familliar with how to base the if commands to resemble this type of nest. |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Tue Sep 21, 2010 12:30 pm |
You definitely don't need a bazillion aliases to do the first part. Just make a database variable that matches a name to a number, like so:
Code: |
#addkey locations home 341
#addkey locations emporium 598
#addkey locations smith 988
...
|
Then, in your "go" alias, you do the following:
Code: |
#IF (%ismember(@locations,%1) {#WALK %db(@locations,%1)}
|
For the second, the best solution would be to figure out why the rooms aren't being recognized and solve that problem. We can try to help with that. If all else fails, you can simply mark the Force Entry option on the properties for that specific room. |
|
|
|
Darkflame808 Beginner
Joined: 21 Sep 2010 Posts: 22
|
Posted: Wed Sep 22, 2010 1:40 am |
I tried your suggestion but any goto command results in nothing happening.
I tried to do a #show @locations it does show home=341, emporium=598 etc but it doesn't walk the path?
Perhaps it's not pulling the right value out of the variable?
Thanks for the assistance! I appreciate it!
oh if it helps. i'm using cmud beta the latest one.
Also one note. I get a What? response after it sends the #IF command to the mud. I don't think the cmud is interpreting the command moreso as it's sending it to the mud to have the mud itself respond.
I just made a new alias called go and pasted your string in there. |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Wed Sep 22, 2010 12:52 pm |
Since you are using the Beta version, this should be posted on the Beta forum. In this case, it is definitely important, because the entire mapper is different in the Beta version, and in particular, there are some recent changes that might be affecting you.
Hm. Just checked the documentation. The syntax statement says it uses the Vnum, but the text indicates that you can use the shortname instead. So, the first question is, are you certain that your numbers are the Vnums and not the roomkey? Second question, are you on an IRE mud, and using the new GMCP protocol? If you have, the Vnums of your rooms may have changed. Third question, is the room in a different zone? #WALK has an optional second parameter for zonename, which appears to be necessary if the Vnum is in a different zone. Try doing the go alias from within the same zone as the target room, if you haven't. |
|
|
|
Darkflame808 Beginner
Joined: 21 Sep 2010 Posts: 22
|
Posted: Thu Sep 23, 2010 4:58 am |
honestly I don't know the answers to your questions.....
I can tell you this much.
In cmud 2.37, in the map you could add a shortcut name. and in that case I used to just put #walk smith and it worked.
In the beta it was different, putting in smith for the alias I still could not #walk to it.
I could however #walk 988 and it would dart me there. That's why I wanted to know how to make a table out of it...
The mud I believe is LPMUD. There are no "vnums" that I can see of anyway. it creates a number each time I make a room for example if i'm in room 1, I move west it creates room two. If I erase the original room and move back east (back to room 1) it creates room 3 and room 1 no longer exists. I get my numbers by hovering my mouse over the block or selecting properties and reaching what room each door is referenced to.
I hope this helps :D
Thanks!
In the mean time i've just resorted to favorting all my places and just double clicking them on the list to highlight it on the map and double clicking the map to start the walk.
Thanks! |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Thu Sep 23, 2010 12:28 pm |
Did you report the fact that you couldn't use shortcut names in #WALK as a bug? That is the purpose of beta-testing. Using shortcut names is supposed to still work in version 3.xx, so if it isn't, Zugg needs to know. He's about to release this to the public!
It sounds like you are not on a mud produced by IRE (Iron Realms Entertainment), so you are probably not running into a problem with GMCP.
You haven't said whether the room you are trying to reach is in a different zone. If it is in a different zone, you need to add the zone name to the #WALK command. Are all your rooms in the same zone?
Post the actual code you are using here in this thread. Open the alias in the Package Editor. At the bottom of the window, click the XML tab. Highlight the entire XML code and type CTRL-C to copy it. In a reply to this message, type "[code]" (without the quotation marks). Then type CTRL-V to paste the XML code into your reply. Then type "[/code]" after the XML code (again, without the quotes). |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Thu Sep 23, 2010 9:23 pm |
Quote: |
Did you report the fact that you couldn't use shortcut names in #WALK as a bug?
|
As of 3.29 (I see he's released an a version, but that's not the one I'm referring to), shortnames work quite well. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Darkflame808 Beginner
Joined: 21 Sep 2010 Posts: 22
|
Posted: Sat Sep 25, 2010 6:30 am |
No Rahab i'm sorry I did not think it was a bug because I am not comfortable in my scripting and has assume it was an error on my part or my scripts part rather then cmud itself.
The interface in 2.37 is slightly different. In 2.37 it was a simple "shortcut name" in the room properties. On 3 beta, it's got pages and pages of information you can alter so I assumed UserSTR was the shortcut name.
When it didn't work, that's why I requested if someone could help me write a script to walk around. In 2.37 I never needed a script as I would just #walk shortcut and be done with it.
I'll download the newest beta again and see if it resolves my issue.
If all else fails I can always resort to adding them to favorites :)
Thanks again. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Sep 25, 2010 6:06 pm |
Nope, the shortname is actually a small textbox just to the right of the Room Name box. If you don't know it's there, it can be hard to see when it's empty since there's no text label for it.
At any rate, if you already had shortnames in your 2.37 map and this mapfile was converted into the 3.xx map format then they should still be there and thus still allowing you to speedwalk using them. If they are not, either something is wrong with your map or something's bugged in the conversion process (ie, shortnames going to the wrong field accidentally or intentionally like in the case of old room scripts.) |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
|
|