Hi to all. I have an alias in Lua, and i couldn't figure this out.
<aliases>
<alias
match="^-arma -(.*)"
enabled="y"
expand_variables="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>new_1 = "%1";
wield = GetVariable("wield");
container = GetVariable("container");
if (new_1 == "nada") then
print("Changing to nothing")
else (wield ~= "nada")
Print("Removing: ", wield)
Send("remove " .. wield);
Send("put " .. wield .. " " .. container);
SetVariable("wield", "nada");
return;
end
if (wield != new_1) then
Print("Changing to: ", new_1)
else (wield != "nada")
Send("rem " .. wield);
Send("put " .. wield .. " " .. container);
Send("get " .. new_1 .. " " .. container);
Send("wield " .. new_1);
SetVariable("wield",new_1);
end
if (new_1 == wield) then
Print("Already using that!")
return;
end </send>
</alias>
</aliases>
It states:
Error number: 0
Event: Compile error
Description: [string "Alias: "]:9: syntax error near 'Print'
Called by: Immediate execution
I have one MushClient variable, wield, that is the variable egarding the weapon i'm wielding. When i type the alias, it goes to the can and graves the %1 that i typed in.
<aliases>
<alias
match="^-arma -(.*)"
enabled="y"
expand_variables="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>new_1 = "%1";
wield = GetVariable("wield");
container = GetVariable("container");
if (new_1 == "nada") then
print("Changing to nothing")
else (wield ~= "nada")
Print("Removing: ", wield)
Send("remove " .. wield);
Send("put " .. wield .. " " .. container);
SetVariable("wield", "nada");
return;
end
if (wield != new_1) then
Print("Changing to: ", new_1)
else (wield != "nada")
Send("rem " .. wield);
Send("put " .. wield .. " " .. container);
Send("get " .. new_1 .. " " .. container);
Send("wield " .. new_1);
SetVariable("wield",new_1);
end
if (new_1 == wield) then
Print("Already using that!")
return;
end </send>
</alias>
</aliases>
It states:
Error number: 0
Event: Compile error
Description: [string "Alias: "]:9: syntax error near 'Print'
Called by: Immediate execution
I have one MushClient variable, wield, that is the variable egarding the weapon i'm wielding. When i type the alias, it goes to the can and graves the %1 that i typed in.