Post Prism Script

Lxndr

Member
Okay, so I currently have a post-prism script that has this:

buy( 1, $item[Dramatic range] );
use( 1, $item[Dramatic range] );

What I'd like to do is include a check to find out whether or not the range is in my Kitchen before I buy one.

So far all the item management attempts I've tried only check my inventory, not my kitchen. There must be something that I can do?

Can anyone help?

(Also I'd love to invoke another script, like say OCD Inventory Control.ash from within this one script. How can that happen?)
 

Theraze

Active member
What you want is something like:
Code:
if (get_campground() contains $item[dramatic range])

Regarding using another script, you need to decide if you want to call a CLI command with CLI_EXECUTE() or import it as an ASH script with the import <> command. If you use CLI, you can call any script you want, but can only hand over a single variable. If you use ASH, you either need to customize your imported script or it needs to have been created with importing in mind... OCD has been, but many others have not.
 

Bale

Minion
(Also I'd love to invoke another script, like say OCD Inventory Control.ash from within this one script. How can that happen?)

At the very top of the script you have this line:

Code:
import "OCD Inventory Control.ash";

Then later, where you actually want it to be invoked, you have this line:

Code:
ocd_control(false);
 

Theraze

Active member
There is no 'not' in ASH, that I remember. So... two choices:
Code:
if (get_campground() contains $item[dramatic range]) {} else
or
Code:
if (!(get_campground() contains $item[dramatic range]))
 

Lxndr

Member
There is no 'not' in ASH, that I remember. So... two choices:
Code:
if (get_campground() contains $item[dramatic range]) {} else
or
Code:
if (!(get_campground() contains $item[dramatic range]))

The first would probably work, but feels inelegant.
The second failed to work.
But this worked:

Code:
if ((get_campground() contains $item[dramatic range]) != true)

Of course, what I'd really love is for the OCD script to just buy a damned Range if it's programmed to do fancy cooking and I don't have a Dramatic.
 
Last edited by a moderator:

Theraze

Active member
Hmm... I've used it before. The ! 'nots' the group, you just need to make sure you do that exactly. Works for me:
> ash get_campground()

Returned: aggregate int [item]
Certificate of Participation => 1
E-Z Cook™ oven => 1
My First Shaker™ => 1

> ash (!(get_campground() contains $item[dramatic range]))

Returned: true
 
Top