Issues with popup's and expandalias

Post Reply
solao
Posts: 5
Joined: Wed Oct 19, 2016 4:27 am

Issues with popup's and expandalias

Post by solao »

I have tried all of the below methods to get an expandalias to work on a popup. Is there any reason why this isn't working? When I use Send " it works fine across the board. But I really want it to trigger my alias.


If I could set a variable based on the selected option, that would work for what i'm doing also. All my alias is doing is

Match: ^\b(fanrax|araghomi|norris|poe|butilin|azemar|phineas|ulanda)\b
Action: charname = matches[1]
send(charname)

setPopup
Code: [show] | [select all] lua
selectString("Name", 1)
setPopup("main", {[[expandalias("fanrax")]], [[expandalias("araghomi")]], [[expandalias("norris")]], [[expandalias("poe")]], [[expandalias("butilin")]], [[expandalias("azemar")]], [[expandalias("phineas")]], [[expandalias("ulanda"}]]}, {"Fanrax - Vamp Wa/Ma/Ps", "Araghomi - Dwa Wa", "Norris - Lycan Ma/Cl/Sh/Mo", "Poe - Merf Pa/Ba", "Butilin - Hob Th/Ba", "Azemar - Lycan Cl/Pa/Ps/Sh", "Phineas - Lycan Ps/Sh/Bl", "Ulanda - Merf Cl/Ps/Ba"})
insertPopup
Code: [show] | [select all] lua
insertPopup("What Character to Login as?", {[[expandalias "fanrax"]], [[expandalias "araghomi"]], [[expandalias "norris"]], [[expandalias "poe"]], [[expandalias "butilin"]], [[expandalias "azemar"]], [[expandalias "phineas"]], 
[[expandalias "ulanda"]]}, {"Fanrax - Vamp Wa/Ma/Ps", "Araghomi - Dwa Wa", "Norris - Lycan Ma/Cl/Sh/Mo", "Poe - Merf Pa/Ba", "Butilin - Hob Th/Ba", "Azemar - Lycan Cl/Pa/Ps/Sh", "Phineas - Lycan Ps/Sh/Bl", "Ulanda - Merf Cl/Ps/Ba"})
echoPopup
Code: [show] | [select all] lua
echoPopup("Character to Login", {[[send "fanrax"]], [[send "araghomi"]], [[send "norris"]], [[send "poe"]], [[send "butilin"]], [[send "azemar"]], [[send "phineas"]], [[send "ulanda"]]}, {"Fanrax - Vamp Wa/Ma/Ps", "Araghomi - Dwa Wa", "Norris - Lycan Ma/Cl/Sh/Mo", "Poe - Merf Pa/Ba", "Butilin - Hob Th/Ba", "Azemar - Lycan Cl/Pa/Ps/Sh", "Phineas - Lycan Ps/Sh/Bl", "Ulanda - Merf Cl/Ps/Ba"})

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Issues with popup's and expandalias

Post by Jor'Mox »

That is because the function name is case sensitive. You need to use expandAlias, not expandalias.

solao
Posts: 5
Joined: Wed Oct 19, 2016 4:27 am

Re: Issues with popup's and expandalias

Post by solao »

well crap.. I feel dumb as grass.


Thanks!

User avatar
SlySven
Posts: 1019
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Issues with popup's and expandalias

Post by SlySven »

Note that for the particular use you are using - selecting a login-in name - we do currently think that users will set the name and password on the screen that is used to choose a "profile" and to copy the profile and rename it for each separate character. However, unless you use the module system to share your scripts and other code between those profiles (and if the MUD uses a map, you use the facility - now updated in release 3.0 previews to share a map between profiles but to retain the information about where each profile's player is in all separate copies of the map - to share a map) each profile will exist in isolation so that code edited in one will not be reproduced in others...

Obviously if you leave the "Character name" and "Password" field empty on the profile selection page you will be in the situation you have here where you will need to send those details to the MUD server at the start of a session manually - this is also the case you may have if you have to go through a menu or other interactive process before you actually commence playing on the MUD with a particular identity...

As for the exact smelling for each command - yeah - you do have to use the precise casing - nowadays we tend to use "camelCasing" but there are some notable exceptions e.g. "centerview" - you really need to RTFM (Read The Fine Manual 8-) ) check out the "Wiki" link at the top right of this page...!

Post Reply