From 1570b1e8afa2c9e857f74c649962aa7e9656403d Mon Sep 17 00:00:00 2001 From: tbone Date: Thu, 15 Nov 2018 22:32:06 -0700 Subject: [PATCH] Added "list load", "load merge" and "list clear" --- itemwatch.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/itemwatch.lua b/itemwatch.lua index 453866a..fb30257 100644 --- a/itemwatch.lua +++ b/itemwatch.lua @@ -308,6 +308,29 @@ ashita.register_event('command', function(cmd, ntype) return true; end + ------------------------------------------------------------------------------------------------ + -- List Related Commands + ------------------------------------------------------------------------------------------------ + if (#args >= 4 and args[2] == 'list' and args[3] == 'load') then + local index = tonumber(table.concat(args, ' ', 4)); + lists.refresh_saved_lists(); + lists.load_list(index); + return true; + end + + if (#args >= 4 and args[2] == 'list' and args[3] == 'merge') then + local index = tonumber(table.concat(args, ' ', 4)); + lists.refresh_saved_lists(); + lists.load_list_merged(index); + return true; + end + + if (#args >= 3 and args[2] == 'list' and args[3] == 'clear') then + lists.clear_watched_keys(); + lists.clear_watched_items(); + return true; + end + return true; end);