Suppress output from ash-functions?

ereinion

Member
When setting properties with ash-functions the result is printed to the cli. Likewise, some functions like retrieve_item will print its results to the cli. Is there any way to avoid this?

More specifically, part of a function I have looks like this (a modified version of what I was working on in this thread):
Code:
    satisfy_with_mall = get_property("autoSatisfyWithMall");
    set_property("autoSatisfyWithMall", "false");
    for i from 0 to 11 {
        if (have_equipped(priority_of_fam_eq[i])) {
            chosen_item = priority_of_fam_eq[i];
            break;
        } else if (retrieve_item(1, priority_of_fam_eq[i])) {
            chosen_item = priority_of_fam_eq[i];
            break;
        } else if (get_price(priority_of_fam_eq[i], 0.5) < to_int(get_property("autoBuyPriceLimit"))) {
            if (buy (1, priority_of_fam_eq[i], get_price(priority_of_fam_eq[i], 0.5)*1.2) > 0) {
                chosen_item = priority_of_fam_eq[i];
                break;
            }
        }
    }
    set_property("autoSatisfyWithMall", satisfy_with_mall);
Is there any way to prevent it from writing something like
Code:
autoSatisfyWithMall => false
[COLOR=red]You need 1 more      Mayflower bouquet to continue.[/COLOR]
[COLOR=red]You need 1 more      lucky Tam O'Shanter to continue.[/COLOR]
[COLOR=red]You need 1      more lucky Tam O'Shatner to continue.[/COLOR]
autoSatisfyWithMall => true
to the cli every time that code is invoked?

From some searching of the forums, it seems that the reason that it is not generally possible to suppress the output of ash-functions is to prevent malicious scripts from doing bad stuff without notifying the user of it. However, for functions as the ones I'm calling, is it really necessary to display the results? While I can see how changing a user's autoBuyPriceLimit could open up for some shenanigans, but then again, you could achieve the same results using e.g. buy(int, item, int). Really, if a user isn't reading through the scripts he's using he has to be really quick to understand what is printed to the cli and abort if he is to avoid any malicious actions a script may attempt.

Hmm, reading through that last part, should I rather have put this as a feature-request, as I am fairly confident there is no way to do what I want at the moment?
 

roippi

Developer
Do we expose "sim" mode of retrieve_item to ash? I'd favor that over some sort of output_buffer_start sort of thing. The verbosity on set_property is intentional, as we only log if you change a property that's in defaults.txt; user-defined ones can be modified silently.
 
Top