From c6cc1b241686d5f2d1a584c8d9e6a7ba45edbfdf Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sat, 22 Jul 2023 14:22:39 +0200 Subject: [PATCH] fix the loadfile command and more colors --- client/luascripts/hf_legic.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/client/luascripts/hf_legic.lua b/client/luascripts/hf_legic.lua index 6dcb9d8ca..fb98b777e 100644 --- a/client/luascripts/hf_legic.lua +++ b/client/luascripts/hf_legic.lua @@ -269,7 +269,6 @@ local function padString(str) if (#str == 1) then return '0'..str end - return str end @@ -336,6 +335,7 @@ end --- -- check availability of file function file_check(file_name) + if not file_name then return false, "" end local arr = split(file_name, ".") local path = core.search_file(arr[1], "."..arr[2]) @@ -2424,8 +2424,7 @@ function modifyMode() --- -- load file into mainTAG ["lf"] = function(x) - - if (type(x)=='string' and file_check(x)) then + if (x and not x=="" and type(x)=='string' and file_check(x)) then filename = x else filename = input("enter filename: ", "legic.temp") @@ -2782,7 +2781,7 @@ function modifyMode() } repeat -- default message / prompt - ic=input("Legic command? ('h' for help - 'q' for quit)", "h") + ic=input("Legic command? ('"..acy.."h"..acr.."' for help - '"..acy.."q"..acr.."' for quit)", acy.."h"..acr) -- command actions decisions (first match, longer commands before shorter) if (type(actions[string.lower(string.sub(ic,0,3))])=='function') then actions[string.lower(string.sub(ic,0,3))](string.sub(ic,5))