Noob Quest ASHed

gxc

New member
I'm having two problems with a script.

1. trade_hermit isn't recognized. CLI returns "Undefined reference 'trade_hermit' (initial_quest.ash, line 119)". I replaced it with the specific URL required to buy the item, but want to know how to properly use "trade_hermit".

2. Creating meat paste with "create(1, $item[meat paste])" followed by "create(1, $item[Mighty Bjorn action figure])" results in "Verifying ingredients for Mighty Bjorn action figure (1)... /Searching for items... /Searching for items... /You need 1 more meat paste to continue." The meat paste is in the inventory, but even using the item manager to create the item results in the same error. I had to manually combine for it to work.

The script works perfectly up until the action figure. I'm pretty satisfied.

--Edit--
2 is fixed by removing the meat paste creation. However, I'm still curious why this one won't work.

--Edit 2--
Latest version here.
 

Attachments

  • initial_quest.ash
    3.6 KB · Views: 81

hippymon

Member
Well, a few changes:
Code:
## For URLs you may want to use:
	visit_url("URL");

	## For the adventuring for an item portions, it may be easier to do the "conditions"
	if (item_amount($item[XXX]) == 0){
		cli_execute("conditions clear");
		add_item_condition(1, $item[XXX]);
		adventure(my_adventures(), $location[DDD]);
	}

	## For the checking of the classes it is easier to do:
	if(my_class() == $class[PPP]){ }

	## And the hermit portion:
	hermit(1, $item[golden twig]);
 

gxc

New member
The reason I have the script visit the Toot Oriole so much is because I wrote the script literally as the the first script a new character would use. Granted, I haven't ascended yet, so I have no idea if it has any practically past that, but I was just testing ASH knowledge. As a new character, if you don't visit Toot that often, the script would error pretty fast.

Hermit problem - you might want to fix the manual/have whoever wrote it fix it, because I wrote that script directly out of the manual at http://kolmafia.us/index.php/topic,298.0.html.

Classes - I wasn't sure about that because I couldn't find it, and I guessed as much with $item[item name] and $skill[skill name], but I wasn't sure.
 

hippymon

Member
I understand, true, true... But personally I like to stray from gCLI use as much as possible.... Plus it may have some benefit to the server.. :-\
 

gxc

New member
Newest version, is this better?

I started to incoporate "add_item_condition", but realized it wastes time in terms of scripting. Does it really affect the server? I can possibly see how it would, as while would ping the server each loop.

Also, does ASH have code for "and" and "or"? There's one part of the script I could cut down to three lines instead of multiple if...else lines if I knew those.
 

Attachments

  • initial_quest.ash
    3.7 KB · Views: 43

hippymon

Member
Well, here are a couple sites:
This one will help with the boolean operator's and such.... For your "and or" ash coding.
http://www.wiki.kolmafia.us/index.php/if

And due to extreme spamming of the KoLwiki site I have put together all of the information into one master site that is kind of my "secret page" :p It should help with other general scripting questions or because the site isn't all that up-to-date you can open KoLmafia and in the gCLI and do an "ashref" so for your hermit problem, you could do simply "ashref hermit" and it would return all of the accepted ash coding that has "hermit" in it... If that makes sense. :-\
http://www.wiki.kolmafia.us/index.php/User:ZammyWarrior


Oh, and one little problem:
Code:
if (item_amount($item[chewing gum on a string])==0){

	##This should be "conditions clear"
	cli_execute("commands clear");

	##This will cause some problems... It should be
	##cli_execute("conditions add 30 meat");
	##The add_item_condition function is for item conditions..
	##Meat is not registered as an item..
	add_item_condition(1, my_meat()>30);

	adventure(my_adventures(), $location[Dire Warren]);
	buy(1, $item[chewing gum on a string]);
}
 

gxc

New member
I think this works now, the only thing it doesn't consider is death by rabbits. I'll probably code that later, but for now, I'm a bit too lazy.

This script successfully takes you through all the Toot Oriole quests. No idea if that really matters or anything, but it was fun.
 

Attachments

  • initial_quest.ash
    3.6 KB · Views: 82

hippymon

Member
One minor change:

if((item_amount($item[worthless gewgaw])>0) || (item_amount($item[worthless knick-knack])>0) || (item_amount($item[worthless trinket])>0)){
no_trinket = false;
}
 
Top