mudgangster

Log | Files | Refs

commit 30a2ec6524a6a4e8d597516dc7248a4f0e17c872
parent 9843803b151a673e80802de6ff93e8b3ca84ba72
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Thu, 25 Oct 2012 18:16:24 +0100

Made shorthand actions work with multiple commands

Diffstat:
action.lua | 2+-
handlers.lua | 8++++----
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/action.lua b/action.lua @@ -28,7 +28,7 @@ local function genericActions( actions ) local command = callback callback = function() - mud.send( command .. "\n" ) + mud.input( command, false ) end end diff --git a/handlers.lua b/handlers.lua @@ -196,7 +196,7 @@ local function handleData( data ) end end -local function handleCommand( input ) +local function handleCommand( input, display ) if not alias.doAlias( input ) then if not mud.connected then mud.print( "\n#s> You're not connected..." ) @@ -204,7 +204,7 @@ local function handleCommand( input ) return end - if input ~= "" then + if display and input ~= "" then local toShow = ( showInput and input or ( "*" ):rep( input:len() ) ) .. "\n" if receiving then @@ -225,9 +225,9 @@ local function handleCommand( input ) end end -local function handleInput( input ) +local function handleInput( input, display ) for command in ( input .. ";" ):gmatch( "([^;]*);" ) do - handleCommand( command ) + handleCommand( command, display ) end end