loading a script from inside a script

PazSox

New member
I have a simple script that I use for farming the castle. I found a script that gets clovers, but the clover script is pretty complex compared to my castle script. Is there a way that I can "call" the clover script from my farming script?

Any help with this would be appreciated.

-PazSox
 

kain

Member
Sure ... what you'd do is:

cli commands
cli commands
cli commands
get_clovers.ash
cli commands
cli commands

etc :)
 
I think the same "bug?" which is being discussed here would come to light using that method. It may not, but if you experience it try this:

Code:
call scripts\get_clovers.ash
or
Code:
scripts\get_clovers.ash
 

PazSox

New member
[quote author=efilnikufecin link=topic=835.msg4050#msg4050 date=1175670642]
I think the same "bug?" which is being discussed here would come to light using that method. It may not, but if you experience it try this:

Code:
call scripts\get_clovers.ash
or
Code:
scripts\get_clovers.ash
[/quote]

I tried this first:
Code:
call scripts\clovers.ash
and got this: Uknown variable 'call' (test.ash, line 6)

so I tried this next:
Code:
 scripts\clovers.ash
and got this: Expected }, found scripts\clovers.ash (test.ash, line 6)

I tried this next:
Code:
clovers.ash
and got this: Unknown variable 'clovers' (test.ash, line 6)


I don't know what else to try...
-Paz
 

kain

Member
I'm sorry ... let me explain what I meant. I thought you were trying to call an ash script from a CLI script

Pretend you have the following code saved as a normal cli script:
Code:
echo 1
echo 4
wibble.ash
that would print 1, then print 4, then execute "wibble.ash"

Pretend, in the same directory, you have a file named wibble.ash with the following code:
Code:
void main()
{
	print("My muscle: "+ my_basestat($stat[muscle]));
}

Is that more what you meant? If not, could you post some code examples so I can try and help further?
 

holatuwol

Developer
Looks like you're trying to call an ASH script from inside another ASH script.

cli_execute( "call clovers.ash" );
 

PazSox

New member
[quote author=holatuwol link=topic=835.msg4064#msg4064 date=1175805999]
Looks like you're trying to call an ASH script from inside another ASH script.

cli_execute( "call clovers.ash" );
[/quote]

this just seems way to easy to really work. :) i put it in my script, and i will test it tommorow after rollover.

Thanks Holatuwol! I hope this works.

-PazSox
 

mmmk

New member
i want to load an ash script from an ash script.

it says in the daily builds that the scripts are validated before making sure they work.

I'm getting the error that (filename) could not be validated.

what does this validation actually check?

thanks ;D

er ... nvm ... apparently i had dingy plank instead of dingy planks ... =P
 
[quote author=mmmk link=topic=835.msg4153#msg4153 date=1176445843]
i want to load an ash script from an ash script.

it says in the daily builds that the scripts are validated before making sure they work.

I'm getting the error that (filename) could not be validated.

what does this validation actually check?

thanks ;D
[/quote]

Simple, it checks to see if the script contains any obvious errors like missing flow control characters or extra ones. It also checks for invalid function calls, and many other potential errors.

To check a script without running it (like the situation where it is called from another and you don't want it ran outside the other) use the verify command. type "verify scriptname" into the CLI


er ... nvm ... apparently i had dingy plank instead of dingy planks ... =P

Gotta love them little typos! They can sometimes keep you up all night hunting!
 
Top