Rewrite C&C shellmap script in lua.