First time poster long time user of MC, just started scripting for it... heres my problem, when a skill of 1 word increases everything works fine, but when a 2 or 3 word skill is set, it doesnt work.. i need somehow to create %1 to nospaces.
ps i have none to limited knowledge of jscript, so this is just to learn...
these are the two triggers.
<triggers>
<trigger
enabled="y"
keep_evaluating="y"
match="Your knowledge of * increases!"
send_to="12"
sequence="100"
variable="lastinc"
other_text_colour="black"
other_back_colour="black"
>
<send>var sInc, sInc1, sInc2, sInc3;
sInc = world.GetVariable("%1");
sInc1 = world.GetVariable("%1");
if (sInc == null)
{
world.note("Skill not found adding %1 increase 1/5");
world.SetVariable("%1", 1);
}
else
{
sInc1 = sInc * 1 + 1;
world.note("Increase: " + sInc1 + "/5");
world.SetVariable("%1", sInc1);
}
sInc2 = world.GetVariable("%1");
sInc3 = sInc2 + "/5";
world.SetVariable("lastinc", "%1 " + sInc3)</send>
</trigger>
</triggers>
<triggers>
<trigger
enabled="y"
keep_evaluating="y"
match="You need to visit a master to learn more about *!"
send_to="12"
sequence="100"
other_text_colour="black"
other_back_colour="black"
>
<send>var sInc, sInc1, sInc2;
sInc = world.GetVariable("%1");
if (sInc == null)
{
world.note("Skill not found adding %1 increase 0/5");
world.SetVariable("%1", 0);
}
else
{
sInc1 = sInc1 * 1 + 1;
world.note("Gain: " + sInc1 + "/5 Please Visit Master");
world.SetVariable("%1", 0);
}
sInc2 = world.GetVariable("%1");
world.SetVariable("lastinc", "%1 5/5")</send>
</trigger>
</triggers>
ps i have none to limited knowledge of jscript, so this is just to learn...
these are the two triggers.
<triggers>
<trigger
enabled="y"
keep_evaluating="y"
match="Your knowledge of * increases!"
send_to="12"
sequence="100"
variable="lastinc"
other_text_colour="black"
other_back_colour="black"
>
<send>var sInc, sInc1, sInc2, sInc3;
sInc = world.GetVariable("%1");
sInc1 = world.GetVariable("%1");
if (sInc == null)
{
world.note("Skill not found adding %1 increase 1/5");
world.SetVariable("%1", 1);
}
else
{
sInc1 = sInc * 1 + 1;
world.note("Increase: " + sInc1 + "/5");
world.SetVariable("%1", sInc1);
}
sInc2 = world.GetVariable("%1");
sInc3 = sInc2 + "/5";
world.SetVariable("lastinc", "%1 " + sInc3)</send>
</trigger>
</triggers>
<triggers>
<trigger
enabled="y"
keep_evaluating="y"
match="You need to visit a master to learn more about *!"
send_to="12"
sequence="100"
other_text_colour="black"
other_back_colour="black"
>
<send>var sInc, sInc1, sInc2;
sInc = world.GetVariable("%1");
if (sInc == null)
{
world.note("Skill not found adding %1 increase 0/5");
world.SetVariable("%1", 0);
}
else
{
sInc1 = sInc1 * 1 + 1;
world.note("Gain: " + sInc1 + "/5 Please Visit Master");
world.SetVariable("%1", 0);
}
sInc2 = world.GetVariable("%1");
world.SetVariable("lastinc", "%1 5/5")</send>
</trigger>
</triggers>