Between battle: any reason this shouldent work

mottsy

Member
cli_execute("if spooky putty monster > 1; use 1 spooky putty monster");

From my (very limited) understanding of ash scripting, i believe that this sort of thing should work for automaticly using putty'd monsters. (my best guess is possibly a return to fight command)

Is there a more complicated thing required to make this work properly

(and yes, i did set it as between battle script by using the cli command)
 

Attachments

  • betweenBattle.ash
    71 bytes · Views: 45
Last edited:

Winterbay

Active member
I think it would be better if you wrote it as

PHP:
item x = $item[Spooky Putty monster];
if(item_amount(x) > 1) {
   cli_execute("use 1 Spooky Putty monster");
}

This, since I don't think you can use "if" as a CLI-command.
 

Veracity

Developer
Staff member
I don't think you can use "if" as a CLI-command.

You can use if in the CLI exactly as he posted. Which is to say, if you put the following into "betweenBattle.txt" ...

Code:
if spooky putty monster > 1; use 1 spooky putty monster

...it should work just fine. However, if you want ASH, why call out to the CLI to do things that are built-in?

PHP:
item x = $item[Spooky Putty monster];
if ( item_amount( x ) > 1 ) {
   use( 1, x );
}
 
Last edited:

xKiv

Active member
Are you all sure it's "> 1" and not ">= 1"?
That is, should this only work with *two or more* puttied monsters (is that even possible?)?
 

slyz

Developer
You can use if in CLI commands, but I don't know if comparison operators work. In any case, since it's already an ASH script, it's better to follow winterbay's advice and use ASH.

EDIT: I should have refreshed before posting... and yeah, the problem is using > 1 instead of using > 0 or >= 1 (in ASH too).
 

Winterbay

Active member
You can use if in the CLI exactly as he posted. Which is to say, if you put the following into "betweenBattle.txt" ...

Code:
if spooky putty monster > 1; use 1 spooky putty monster

...it should work just fine. However, if you want ASH, why call out to the CLI to do things that are built-in?

PHP:
item x = $item[Spooky Putty monster];
if ( item_amount( x ) > 1 ) {
   use( 1, x );
}

Because I'm still new to ash-scripts and did not know that/forgot to check if use was also an ash-command :)

And yes, >= looks much better, it was mainly copied from the original.
 

mottsy

Member
Are you all sure it's "> 1" and not ">= 1"?
That is, should this only work with *two or more* puttied monsters (is that even possible?)?

.... *FACEPALM*
Stupid math....

Thanks for your help guys, im really surprised that it wasn't something overly complicated that i was doing wrong
 
Top