Newcomer help with script conversion

Post Reply
coprolaliays
Posts: 1
Joined: Tue Dec 04, 2012 11:27 pm

Newcomer help with script conversion

Post by coprolaliays »

Hi all,

First I'd like to say I'm a newcomer to mudlet. I've been mudding on Mac OS for a few years, but have never heard of it before now. It seems to have some great features, and I'm both impressed by and appreciative of the work that has been put into it!

I mainly mud on Imperian, from Iron Realms, and up until recently I was using an old version of IMTS. I didn't cure with it, but I used the 'iScript' feature to make utility scripts and combat aliases etc (many longwinded workarounds for things that I couldn't do with my old client.) I upgraded to Snow Leopard recently and found that '32bit architecture' was 'no longer supported' (I hope I'm getting it right) and simply, IMTS is now dead to me, :( and here I am trying to convert things to LUA.

I've read the manual for mudlet, and it has been very helpful. With a bit of extra assistance I'm getting used to how things work, but I'm still very much a 'coding' novice.

I was hoping someone could help me translate this script, or at least some of the functions within it. This is one of the scripts that I dissected and re-assembled to make most of my utilities in iScripts, and if I had a lua version to work from I'd find it extremely helpful.

Thanks in advance for any help or advice given!


A couple of things I'd like to know more about:
*Would this kind of script be best made as an alias or in the scripts section of mudlet?
*A person who has been helping me a little mentioned something about 'temp's in lua. Would these be related to the 'local cmd' seen here? And if they do exist, how are they used?
*is there an equivalent of !cmd, signifying that cmd doesn't exist? In iScript this also can be used like:
if ( !target1 )
with variables
*show_prompt( ); is there an equivalent of this, or would I need to make a trigger recognizing what a 'prompt' is?
trigger regex "^\"[a-zA-Z]+(\\d+)\" +a purple mask$" { purplemask_nr = arg "1"; }

alias mask
{
local cmd = arg 1;

if ( !cmd )
{
send "ii mask";
}
if ( cmd == "list" )
{
echo "Current masks: ";
echo "PURPLE: " + purplemask_nr;
}
else if ( cmd == "c" or cmd == "carve" or cmd == "make" )
{
send "outr 2 wood"; send "outr leather"; send "carve mask"; send "outr " + arg(2) + "ink"; send "paint mask with " + arg(2);
return;
}
else if ( cmd == "paint" )
{
send "paint mask with " + arg(2);
}
else if ( cmd == "purple" or cmd == "p" )
{
send "remove mask"; send "wear " + purplemask_nr;
}
else if ( cmd == "colours" )
{
echo "Possible commands/colours:";
echo " purple: level 1 endurance";
}

show_prompt( );
}

Post Reply