If command in the CLI

mjd1066

New member
Can any one supply an example of using the if command within the CLI (not via an ASH script).
I have tried various combinations but as yet I have been unsucessful. I know this is probably simple request, but I can't find any relevant example to help me out.

Once I see how the command is laid out I can pretty much do the rest

Example of what I am trying to acheive

if wasabi sinusus < 240 turns then wear outfit and buy 24 buffs

if you can work an else statement (for info purposes) in as well that would be great.
 

matt.chugg

Moderator
ok, i've had a little play, whilst if is available in the cli, I don't think there is a specific cli command to determine the number of turns left of an effect.

any particular reason you don't want to use ash ?
 

mjd1066

New member
All my scripts have been written for the CLI command line, I will eventually turn them into ASH (when more proficient) but was trying to keep things simple to start off, as not had a lot of experience scripting.

condref command shows uses, but no actual examples
 
Last edited:

kain

Member
I've always done CLI if statements like this:
Code:
if S.O.C.K. < 1
  conditions add S.O.C.K.
if S.O.C.K < 1
	adventure * airship
 

matt.chugg

Moderator
this works for me, as a cli SCRIPT i'm not sure its possibly to put multi line commands directly into the cli

Code:
if one very clear eye < 5
	use 1 cyclops eyedrops
else 
	echo "your eye is already clear enough"
 

jasonharper

Developer
Well, you could do this via:

if Wasabi Sinuses < 240; use 24 nasal spray

But that's doing things the hard way: add Wasabi Sinuses to the mood you're using, and it will be extended automatically when needed. It will default to using one nasal spray at a time, but you can change that to use a larger number.
 

mjd1066

New member
Thanks for all the suggestions. I will try each method to see which works the best.
I was looking for method to purchase automatically rather than having the stuff in storage to avoid running out, but I suppose I could add a section to buy x amount at the end of the script to resupply storage.

Will let you know how I get on and thanks again.
 

mjd1066

New member
after a quick test found that:

if wasabi sinuses < 230; buy 23 knob goblin nasal spray; use 23 knob goblin nasal spray

did exactly what I wanted. Cheers
 
Top