Help with scripting

avbferry

New member
Hello,

May I know why the following would not work in my .ash file?

cli_execute("adv * giant's castle");
cli_execute("uneffect carlweather's cantata of confrontation");

I get the error message Unable to invoke cli_execute("adv

Thanks!
 

Bale

Minion
This really is an .ash file, right? You didn't accidentally make it a .txt file, right?

If it really does have an .ash extension, then I think we might need to know what you had on the line before that.
 

Theraze

Active member
Also, if all of your lines just consist of:
Code:
cli_execute("<stuff>");
cli_execute("<more stuff>");
cli_execute("<some other stuff>");
just simplify... just write all the stuff you want it to do, and save it as a text. In your example above:
Code:
adv * giant's castle
uneffect carlweather's cantata of confrontation
 

Winterbay

Active member
Also, if all of your lines just consist of:
Code:
cli_execute("<stuff>");
cli_execute("<more stuff>");
cli_execute("<some other stuff>");
just simplify... just write all the stuff you want it to do, and save it as a text. In your example above:
Code:
adv * giant's castle
uneffect carlweather's cantata of confrontation

But in that case, do not save it as a .ash-file... :)
("save it as a text" is somewhat unspecific...)
 

Theraze

Active member
I was actually posting that as a counter to this...
This really is an .ash file, right? You didn't accidentally make it a .txt file, right?

I thought it was clear in context, maybe not. Anyways, the point is that .ash file are great if you actually write in ASH. If you're just using CLI for everything, use .txt or... do other extensions work and just run as CLI? Thought that was the case... Not sure though.
 

avbferry

New member
This really is an .ash file, right? You didn't accidentally make it a .txt file, right?

If it really does have an .ash extension, then I think we might need to know what you had on the line before that.

Hi Bale,

Yes, it is an .ash file.

This is my script currently:

==============================================
import "zlib.ash"
cli_execute("dailyfood.txt");

if (have_effect ($effect[carlweather's cantata of confrontation]) < 300)
kmail ("kolabuff", "x", 22);
kmail ("kolabuff", "x", 422);

if (have_effect ($effect[carlweather's cantata of confrontation]) < 300)
repeat { wait (30); refresh_status ();
} until (have_effect ($effect[carlweather's cantata of confrontation]) > 300);

cli_execute("adventure.txt");
cli_execute("callclose.txt");
==============================================

dailyfood.txt would be:
acquire 3 pr0n chow mein
acquire 1 long pork lasagna
acquire 4 rockin' wagon
acquire 1 Supernova Champagne
acquire 3 not-a-pipe
acquire 3 twinkly wad
acquire 2 milk of magnesium
acquire 30 Knob Goblin nasal spray
acquire 40 gauze garter
drink 4 rockin' wagon
drink 1 Supernova Champagne
uneffect ode
use 2 milk of magnesium
eat 3 pr0n chow mein
eat 1 long pork lasagna
use 3 not-a-pipe
use 3 twinkly wad
use 30 Knob Goblin nasal spray
outfit farm with this

adventure.txt would be:
adv * giant's castle
uneffect carlweather's cantata of confrontation

callclose.txt would be:
call close.ash

close.ash would be:
import "zlib.ash"
if (have_effect ($effect[ode]) < 29)
kmail ("iocainebot", "ode", 913);

if (have_effect ($effect[ode]) < 29)
repeat { wait (30); refresh_status ();
} until (have_effect ($effect[ode]) > 29);

equip($item[tuxedo shirt]);
drink(1, $item[rockin wagon]);
outfit("rest with this");


Also, how do I insert that Code field like what Theraze or Winterbay did?

Thanks!
 
Last edited:

Winterbay

Active member
In order to include code-blocks like that you use code-tags (i.e. the word code with [] surrounding it).

If you click on the quote-button on one of those posts you will see it in effect as well.
 

fronobulax

Developer
Staff member
In order to include code-blocks like that you use code-tags (i.e. the word code with [] surrounding it).

If you click on the quote-button on one of those posts you will see it in effect as well.

Or use the sharp sign (#) to insert the code tags after you have done "Go Advanced" while composing your reply.
 

lostcalpolydude

Developer
Staff member
I don't have any ideas for why you're running into that issue, but you could use ash for running your turns.
Code:
adventure( my_adventures(), $location[Giant's Castle] );
would do.

cli_execute("callclose.txt");

callclose.txt would be:
call close.ash

I'm sure this works just fine, but you could cut out a step with just
Code:
cli_execute("close.ash");
I believe you could just
Code:
<import close.ash>
as well, but I'm not sure about that.
 

Theraze

Active member
Importing close won't run it, just make it available... it would need to have functions internally to run with that. :) And then you'd have to call the functions when their time comes...
 

avbferry

New member
Hi guys, running the same script, I now encounter a problem. It runs until it says "does not exist in the adventure database." May I know whats wrong?

> call scripts\Start.ash

Searching for "knob goblin nasal spray"...
Search complete.
Purchasing Knob Goblin nasal spray (30 @ 150)...
You acquire Knob Goblin nasal spray (30)
Purchases complete.
(usable quantity of rockin' wagon (4) is limited to 1 by inebriety)
(usable quantity of milk of magnesium (2) is limited to 0 by remaining fullness)
(usable quantity of pr0n chow mein (3) is limited to 0 by fullness)
(usable quantity of long pork lasagna is limited to 0 by fullness)
(usable quantity of not-a-pipe (3) is limited to 0 by spleen)
(usable quantity of twinkly wad (3) is limited to 0 by spleen)
Using 30 Knob Goblin nasal spray...
You acquire an effect: Wasabi Sinuses (duration: 300 Adventures)
Finished using 30 Knob Goblin nasal spray.
Putting on outfit: farm with this
You are already wearing "farm with this."
does not exist in the adventure database.

I suspect it maybe due to:
cli_execute("adventure.txt");
Because when I run this line as a script by itself, I get the error message "Unable to invoke cli_execute("adventure.txt")"
 
Last edited:

Theraze

Active member
Isn't adventure.txt an internal mafia datafile name? Change that to something else and you should be fine...

Edit: Actually, it's adventures.txt, but it's still close. If adventure.txt has problems though, that's the one we'd need to see the contents of.
 

avbferry

New member
Isn't adventure.txt an internal mafia datafile name? Change that to something else and you should be fine...

Edit: Actually, it's adventures.txt, but it's still close. If adventure.txt has problems though, that's the one we'd need to see the contents of.

Thanks for your help Theraze. I modified it differently to avoid using adventure.txt and it works fine.
 
Top