taltamir
Member
when retrieve_item fails it both returns true and also throws an abort.
would be great if there was an option for it to not do that.
currently available:
boolean retrieve_item( item )
boolean retrieve_item( item, int )
boolean retrieve_item( int, item )
add
boolean retrieve_item( item, boolean )
boolean retrieve_item( item, int, boolean )
boolean retrieve_item( int, item, boolean )
where the boolean value determines if it aborts or not
Here you can see the abort
print("TEST SCRIPT DID NOT ABORT", "blue");
not running
oddly enough having a print command wrap it gets around this
TEST SCRIPT DID NOT ABORT
and I can also use a try finally
	
	
	
		
but I think it would be better if you could control this via boolean.
				
			would be great if there was an option for it to not do that.
currently available:
boolean retrieve_item( item )
boolean retrieve_item( item, int )
boolean retrieve_item( int, item )
add
boolean retrieve_item( item, boolean )
boolean retrieve_item( item, int, boolean )
boolean retrieve_item( int, item, boolean )
where the boolean value determines if it aborts or not
Here you can see the abort
it failed to buy the charter. so it aborted. this results in> ash retrieve_item($item[Airplane charter: Dinseylandfill]); print("TEST SCRIPT DID NOT ABORT", "blue");
Searching for "airplane charter: Dinseylandfill"...
Search complete.
Searching for "airplane charter: Dinseylandfill"...
Search complete.
You need 1 more airplane charter: Dinseylandfill to continue.
Returned: false
print("TEST SCRIPT DID NOT ABORT", "blue");
not running
oddly enough having a print command wrap it gets around this
in this case it does print:> ash print(retrieve_item($item[Airplane charter: Dinseylandfill])); print("TEST SCRIPT DID NOT ABORT", "blue");
Searching for "airplane charter: Dinseylandfill"...
Search complete.
Searching for "airplane charter: Dinseylandfill"...
Search complete.
You need 1 more airplane charter: Dinseylandfill to continue.
false
TEST SCRIPT DID NOT ABORT
Returned: void
TEST SCRIPT DID NOT ABORT
and I can also use a try finally
		Code:
	
	boolean try_retrieve(int amt, item it)
{
    //a failed retrieve command throws an abort instead of merely returning false.
    try retrieve_item(amt,it);
    finally return item_amount(it) >= amt;
}but I think it would be better if you could control this via boolean.
			
				Last edited by a moderator: 
			
		
	
								
								
									
	
								
							
							 
	 
 
		 
 
		
