3 scripts: Crypt, Friars, and PFA

TrickyBeta

New member
Crypt
Code:
adventure * defiled nook
adventure * defiled cranny
adventure * defiled alcove
adventure * defiled niche
adventure 1 haert of the cyrpt

Friars
Code:
conditions clear
if dodecagram < 1
	conditions add 1 dodecagram; adventure * Dark Neck of the Woods
if box of birthday candles < 1
	conditions add 1 box of birthday candles; adventure * Dark Heart of the Woods
if eldritch butterknife < 1
	conditions add 1 eldritch butterknife; adventure * Dark Elbow of the Woods

PFA
Code:
conditions clear
if tissue paper immateria < 1
	conditions add tissue paper immateria
if tin foil immateria < 1
	conditions add tin foil immateria
if gauze immateria < 1
	conditions add gauze immateria
if plastic wrap immateria < 1
	conditions add plastic wrap immateria
if S.O.C.K. < 1
	conditions add S.O.C.K.
adventure * penultimate fantasy airship



There. They all work, and none are written in ASH (albeit ASH is super-sexxy). Tell me if you find any bugs or have any suggestions.
 

macman104

Member
They all look beutiful, and I do agree ASH is super sexy, which is why, while I realize the standard scripting engine is WAY WAY easier for simple task completion like those, I'm just drawn to ASH.
 

Veracity

Developer
Staff member
[quote author=TrickyBeta link=topic=45.msg128#msg128 date=1144107811]PFA
Code:
conditions clear
if tissue paper immateria < 1
	conditions add tissue paper immateria
if tin foil immateria < 1
	conditions add tin foil immateria
if gauze immateria < 1
	conditions add gauze immateria
if plastic wrap immateria < 1
	conditions add plastic wrap immateria
if S.O.C.K. < 1
	conditions add S.O.C.K.
adventure * penultimate fantasy airship
[/quote]
I have several comments. You could reduce this to:

Code:
conditions clear
if S.O.C.K. < 1
  conditions add S.O.C.K.
adventure * penultimate fantasy airship

- You don't care about the immateria. You care about the S.O.C.K. If you set that as your condition, KoL will give you any and all immateria - and then, eventually, trade them in for the S.O.C.K.

- What if you already have the S.O.C.K.? Your script as given will futilely use all of your remaining adventures looking for one.
 

Nightmist

Member
[quote author=Veracity link=topic=45.msg140#msg140 date=1144121840]
- What if you already have the S.O.C.K.? Your script as given will futilely use all of your remaining adventures looking for one.
[/quote]

Code:
conditions clear
if S.O.C.K. < 1
 conditions add S.O.C.K.
if S.O.C.K < 1
 adventure * penultimate fantasy airship

Well that solves the problem of already having a S.O.C.K lack of code blocks are annoying XD...
 
All of them are very good. And do not worry about not being in ASH. Those of us who are used to more robust programming languages will always prefer to use ASH. It revolves around the fact that once we start training ourselves to think in conditional statements (if, while, etc..), it is hard to break that habit.

And for me, I never really was comfortable with the "condition" function of the basic scripting language. And I can not even tell you why.... But on to my point:

[quote author=TrickyBeta link=topic=45.msg128#msg128 date=1144107811]Friars
Code:
conditions clear
if dodecagram < 1
	conditions add 1 dodecagram; adventure * Dark Neck of the Woods
if box of birthday candles < 1
	conditions add 1 box of birthday candles; adventure * Dark Heart of the Woods
if eldritch butterknife < 1
	conditions add 1 eldritch butterknife; adventure * Dark Elbow of the Woods
[/quote]

Just a note to anyone who wishes to use this script: You still have to "finish" the quest. (ie. Take that last adventure.)
 

JBreeze

New member
With version 8.6, the "adventure * defiled nook" command will terminate the script if one you clear it. This is some new code that works with V8.6. It's in ASH, since that's what I prefer to use, but the logic is simple enough to convert to non-ASH if you want.

Code:
if (adventure(my_adventures(), $location[Defiled Nook])){}
else
{
	if (adventure(my_adventures(), $location[Defiled Cranny])){}
	else
	{
		if (adventure(my_adventures(), $location[Defiled Alcove])){}
		else
		{
			if (adventure(my_adventures(), $location[Defiled Niche])){}
			else
			{adventure( 1, $location[Haert of the Cyrpt]);}
		}
	}
}

Thanks to macman104 for improving my scripting.
 

macman104

Member
JBreeze, you could replace those 20's with my_adventures(), and then you won' thave to worry about RNG screwage messing up your script.
 

Metraxis

Member
Here's my answer to the Cyrpt. The import just contains functions for buff maintenence and the like that are not yet dressed up well enough to be allowed out in public.
 

Attachments

  • Cyrpt.ash
    1 KB · Views: 104
[quote author=JBreeze link=topic=45.msg2015#msg2015 date=1156336579]
With version 8.6, the "adventure * defiled nook" command will terminate the script if one you clear it.  This is some new code that works with V8.6.  It's in ASH, since that's what I prefer to use, but the logic is simple enough to convert to non-ASH if you want.

Code:
if (adventure(my_adventures(), $location[Defiled Nook])){}
else
{
	if (adventure(my_adventures(), $location[Defiled Cranny])){}
	else
	{
		if (adventure(my_adventures(), $location[Defiled Alcove])){}
		else
		{
			if (adventure(my_adventures(), $location[Defiled Niche])){}
			else
			{adventure( 1, $location[Haert of the Cyrpt]);}
		}
	}
}

Thanks to macman104 for improving my scripting.
[/quote]

JBreeze, I am trying to implement a similiar method of handling the crypt but there's something else that's up.  Say you don't complete that entire block of code in one day.  The next day if you run the same script and it hits that first part and says "Location is not unlocked" although I guess this would technically happen again if you've finished the quest there too.  I am trying
Code:
 	 	 if ( adventure( my_adventures(), $location[Defiled Nook]) ){
	 	 }

in version 9.2 and it stops completely when it can't find the area to adventure.  Is there a tactful way of trying this adventure without it dieing?

*EDIT* Come to think of it, the adventure is removed from the map completely.  The only option I can think of is to parese the page to see if the area is available.  I would still prefer it if this was handled during the adventure() call but I guess this is an option.  Hmm... I wonder if I use a while loop and adventure 1 at a time and catch it's return value as the while condition, hoping to break on the false.
 

Jaxia

New member
I'm new to this -- do I just paste that code in a txt file? What file extension do I use? The other scripts I am using from this site are .ash

Thanks!
 

Nightmist

Member
[quote author=Jaxia link=topic=45.msg2513#msg2513 date=1160685074]
I'm new to this -- do I just paste that code in a txt file? What file extension do I use? The other scripts I am using from this site are .ash

Thanks!
[/quote]
Uh which one? Theres like heaps of posted code in this thread xD. A pretty basic rule ("rule" meaning I just made it up right now) is that if it has any of these:
"(" or ")" or "{" or "}" or "_" then its a ".ash" script otherwise try using ".txt" (Although you can always just try it in ".txt" first and then if that doesn't work then just change it to ".ash", trial and error until you get a hang of it!)
 
Top