From 3eab0cfee3e2c676d43b7b5a86aa35299288f2a9 Mon Sep 17 00:00:00 2001 From: Durel Date: Tue, 31 Oct 2017 11:26:53 -0400 Subject: [PATCH] 1) Fixed a bug that could allow internal fence echo commands to be visible to the user if the user went to sleep or went AFK at the wrong time 2) Fixed an "off-by-one" level check that bought the wrong consumable item if your level exactly matched the level of the item to buy --- aard_inventory.xml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/aard_inventory.xml b/aard_inventory.xml index 4fb02af..5e1ee86 100644 --- a/aard_inventory.xml +++ b/aard_inventory.xml @@ -3895,12 +3895,12 @@ function inv.cli.tags.examples() dbot.print( [[@W This plugin supports optional end tags for all operations. An end tag has the -form "@G{/the command line:return value:return value string}@W". This gives users -an easy way to use the plugin in other scripts because those scripts can trigger on -the end tag to know an operation is done and what result the operation had. +form "@G{/the command line:execution time in seconds:return value:return value string}@W". +This gives users an easy way to use the plugin in other scripts because those scripts can +trigger on the end tag to know an operation is done and what result the operation had. For example, if you type "@Gdinv refresh@W", you could trigger on an end tag that has -this output "@G{/dinv refresh:0:success}@W" to know when the refresh completed. Of +an output like "@G{/dinv refresh:0:0:success}@W" to know when the refresh completed. Of course, you would want to double check the return value in the end tag to ensure that everything happened the way you want. @@ -16638,7 +16638,7 @@ function inv.consume.buy(typeName, numItems, containerName) local curLevel = dbot.gmcp.getLevel() local bestEntry = nil for _, entry in ipairs(inv.consume.table[typeName]) do - if (entry.level < curLevel) then + if (entry.level <= curLevel) then bestEntry = entry end -- if end -- for @@ -20457,11 +20457,12 @@ function dbot.execute.queue.fence() wait.time(drlSpinnerPeriodDefault) totTime = totTime + drlSpinnerPeriodDefault end -- while - - -- Remove the trigger if an error occurred and the one-shot trigger is still pending - if (retval ~= DRL_RET_SUCCESS) then - DeleteTrigger(dbot.execute.trigger.fenceName) - end -- if + + -- Note: You might think that we'd want to delete the fence trigger if there was an error + -- and the trigger is still pending. However, there is a chance that the fence echo + -- is still pending on the server side so we'd like to keep the trigger around as long + -- as possible to suppress the fence echo -- just in case. It won't hurt anything + -- because the next fence will overwrite the previous fence trigger. dbot.execute.queue.fenceCounter = dbot.execute.queue.fenceCounter + 1