i've got a trigger
You follow @target (?P<where>.*).
That runs (sent to script)-
x = GetTriggerWildcard ("follow", "where");
if (x == "north")
{
y = "n";
}
else if (x == "south")
{
y = "s";
}
else if (x == "east")
{
y = "e";
}
else if (x == "west")
{
y = "w";
}
else if (x == "northeast")
{
y = "ne";
}
else if (x == "northwest")
{
y = "sw";
}
else if (x == "southeast")
{
y = "se";
}
else if (x == "southwest")
{
y = "sw";
}
route = world.GetVariable("direction");
world.SetVariable("direction", route + "," + y);
So i end up with ,n,n,e,e,e etc after the trigger fires a few times (first , gets ignored by the MUD anyway)
then i wanted and alias
return -
route = world.GetVariable("direction");
world.Execute(world.ReverseSpeedwalk (route));
Now the problem here is it errors in reverse speedwalk as i have ,'s in the variable and if i try
world.SetVariable("direction", route + "\n" + y);
so everything is on it's own line (the mud will recognise n etc on it's own but won't recognise n<space>s)
it splits the code up instead of sending the next command to a newline in the variable.
So my question is either how do i send to a newline in a variable or how do i get the ReverseSpeedwalk to ignore commas but still send them?
You follow @target (?P<where>.*).
That runs (sent to script)-
x = GetTriggerWildcard ("follow", "where");
if (x == "north")
{
y = "n";
}
else if (x == "south")
{
y = "s";
}
else if (x == "east")
{
y = "e";
}
else if (x == "west")
{
y = "w";
}
else if (x == "northeast")
{
y = "ne";
}
else if (x == "northwest")
{
y = "sw";
}
else if (x == "southeast")
{
y = "se";
}
else if (x == "southwest")
{
y = "sw";
}
route = world.GetVariable("direction");
world.SetVariable("direction", route + "," + y);
So i end up with ,n,n,e,e,e etc after the trigger fires a few times (first , gets ignored by the MUD anyway)
then i wanted and alias
return -
route = world.GetVariable("direction");
world.Execute(world.ReverseSpeedwalk (route));
Now the problem here is it errors in reverse speedwalk as i have ,'s in the variable and if i try
world.SetVariable("direction", route + "\n" + y);
so everything is on it's own line (the mud will recognise n etc on it's own but won't recognise n<space>s)
it splits the code up instead of sending the next command to a newline in the variable.
So my question is either how do i send to a newline in a variable or how do i get the ReverseSpeedwalk to ignore commas but still send them?