Three aliases - en, ren, and showen.
Code: Select all
Alias: addEnemy
Pattern: ^en\s(.*)$
Script:
send( "enemy " .. matches[2] )
listAdd( myEnemies, matches[2] )
echo( "New enemy added: " .. matches[2] .. "\n" )
Result:
en Test
enemy Test
New enemy added: Test
>> You declare Test to be a formal enemy.
Code: Select all
Alias: removeEnemy
Pattern: ^ren\s(.*)$
Script:
send( "unenemy " .. matches[2] )
listRemove( myEnemies, matches[2] )
echo( "Enemy removed: " .. matches[2] .. "\n" )
So, those look like they're working, but then I add a few names. Test, Whee, Blah, then I try invoking this alias:Result:
ren Test
unenemy Test
Enemy removed: Test
>> You declare that Test will no longer be one of your enemies.
Code: Select all
Alias: listEnemies
Pattern: ^showen$
Script:
listPrint( myEnemies )
Under debug:Result:
showen
-------------------------------------------------------
So it's like the table doesn't exist... but why?LUA: ERROR running script listEnemies (Alias3) ERROR:Lua error:C:/Users/joshua.frazer/.config/mudlet/LuaGlobal.lua:115: bad argument #1 to 'ipairs' (table expected, got nil)
Thanks for any help!