Linking ash files...

Killer B

New member
First of all - Mafia is a great tool! ;D

I have been writing various scripts for myself (and a friend) and been having a blast.

I can't seem to get a "master" script to work though

My plan was for the master script to call other scripts in a certain order and the command seems to be call but I can't seem to get it to work and I can't find an example of a working call to figure out what I'm doing wrong.

Thanks in advance for the help in using this fabulous tool
 
In ash you can import a script:

Code:
import <ashscript.ash>;

which makes all functions contained in ashscript.ash available in the current script.

Sometimes we don't really want access to the functions though, we just want to run a separate script.

Code:
cli_execute("call ashscript.ash");
or if you want to run a cli script
Code:
cli_execute("call cliscript.txt");

Edit: replaced pascal style strings with ash style strings
 

Nightmist

Member
[quote author=efilnikufecin link=topic=732.msg3474#msg3474 date=1169932355]
Sometimes we don't really want access to the functions though, we just want to run a separate script.

Code:
cli_execute("call ashscript.ash");
[/quote]
Thread-jack but the above... I read in the manual somewhere (Can't remember where exactly, I checked "call" in the basic scripting section but it wasn't there) that calling a ASH script while within a ASH script could result in unpredictable results. So I'm just wondering if you have ever encountered unpredictable results?

Edit: Ohhh found the section, last line in this section: http://kolmafia.sourceforge.net/advanced.html#files
File Name Convention said:
You should not, however, "call" other ASH scripts from within an ASH script, as this yields unpredictable results.
 
I haven't encountered any unpredictable results yet, but that doesn't mean there are none. I also haven't called an ash script from an ash script for a long time now. I use a cli script as a wrapper, I execute it, then it runs 1 script after another.
 
Top