I got started down this path of creating a plugin to duplicate Wintin functionality I'm used to with your help in pointing me in the right direction of the OnPluginCommandEntered() callback. However, I'm trying to use an alias to AddAlias and it doesn't seem to create an alias in my MCL file. Is the plugin scope independent of the .MCL scope? Can an AddAlias call in the plugin add an alias in the .MCL?
<script>
<![CDATA[
function OnPluginCommandEntered(sText)
if (string.sub(sText,1,1) == "n"
or string.sub(sText,1,1) == "e"
or string.sub(sText,1,1) == "s"
or string.sub(sText,1,1) == "w"
or string.sub(sText,1,1) == "u"
or string.sub(sText,1,1) == "d") then
if (#GetVariable("speedwalk_path_current") > 0) then
SetVariable("speedwalk_path_current",GetVariable("speedwalk_path_current")..";"..sText)
else
SetVariable("speedwalk_path_current",sText)
end
end
end
]]>
</script>
The main world script space, and each plugin script space, are separate. This was done by design so plugins could be written in different languages (eg. VBscript, JScript, Lua).
Is there a method where I don't need to use a plugin and can still access the command entered much like the plugin callback OnPluginCommandEntered()?
Or what do you recommend is the best solution if I want to have aliases saved to my .MCL file programatically and the contents of the aliases are based upon input commands captured?