find_demons.ash

This is a simple script to find the names of all the demons, as requested here. It requires zarqon's canadv.ash and zlib.ash to work. This script should be completely working now. :D

Make sure you have the latest versions of canadv and zlib, both have changed recently and it won't work unless you have the latest versions!

***Updates***
09.07.09 - correctly states that the pie demon has been found after finding it (thanks Jason)
09.04.09 - changed the pie demon function a bit, lets see if it gives the correct feedback now. also, zaqon made a change to canadv for me, so update your copy and it should work now.
09.03.09 - now tries multiple times to find the pie demon name instead of just once. added some comments for readability. made the feedback a bit more useful.
 

Attachments

  • find_demons.ash
    3.6 KB · Views: 254
Last edited:

tgetgel

Member
Will have to try this out after rollover - adventured out and falling down drunk as well!

Thanks for the scripting - that was fast!
 

zarqon

Well-known member
I already have my demon names, so I can't really help test this. Does the "summon fail" thing really work for getting the first demon name?
 
Does the "summon fail" thing really work for getting the first demon name?

I already have my pie demon's name, so I can't test that one. But according to the wiki you sometimes get the pie demon's name when you summon an incorrect demon name. So unless anyone has a demon named fail, I think that should work.
 

tgetgel

Member
Got an error the first time I ran this - Line 213 - Nemesis Cave yada yada yada.

This line is in canadv.ash. Once I commented out that line, the script ran. It did not get the pie demon. It properly equipped the ear trumpet.

When I found the pie demon with other characters, I had to try summoning many times in a row. It appears that this tries once. Is that the case? When you get the wires crossed response, you have to use the name in wires crossed again to summon to get the pie demon and have it recognized as the demon name. At least that was my experience.

After getting Hoom Hah, got the message of
Found demon 2
Unknown location: Post-War Sonofa Beach
Please report this missing location here: http://kolmafia.us/showthread.php?t=2027
Can't find demon 3 right now.

So we moved on to Friars Gate and I saw this:
[34413] Friar's Gate
Encounter: Hellion
Strategy: G:\KoL Mafia\ccs\default.ccs [default]
Round 0: e85 wins initiative!
Round 1: e85 attacks!
You gain 5 Strengthliness
You gain 6 Wizardliness
You gain 2 Chutzpah

(spade does not use any parameters)
No spading data has been collected yet. Please try again later.


Don't know what the spading was about.

Would it help to maximize the non-combat adventures while finding demons? Rock salt, sonata of sneakiness, etc?
 
Last edited:

zarqon

Well-known member
I guess my question is, does mafia detect/parse that "Wires Crossed" demon name when summoning? It just seems like kind of a special case compared to the others.

Would it help to maximize the non-combat adventures while finding demons? Rock salt, sonata of sneakiness, etc?

From the Wiki:

Demon name adventures will occur on average once every 150 turns in the four zones in which they can occur.

Doesn't say anything about whether this is affected by +/- combats. I'd assume not, actually. Probably more of a counter type situation.

Also, I don't know if you have the latest CanAdv or not -- there's no version checking in that one yet so I'd recommend making sure. I made a huge update to that recently.
 
Got an error the first time I ran this - Line 213 - Nemesis Cave yada yada yada.

This line is in canadv.ash. Once I commented out that line, the script ran. It did not get the pie demon. It properly equipped the ear trumpet.

When I found the pie demon with other characters, I had to try summoning many times in a row. It appears that this tries once. Is that the case? When you get the wires crossed response, you have to use the name in wires crossed again to summon to get the pie demon and have it recognized as the demon name. At least that was my experience.

After getting Hoom Hah, got the message of
Found demon 2
Unknown location: Post-War Sonofa Beach
Please report this missing location here: http://kolmafia.us/showthread.php?t=2027
Can't find demon 3 right now.

So we moved on to Friars Gate and I saw this:
[34413] Friar's Gate
Encounter: Hellion
Strategy: G:\KoL Mafia\ccs\default.ccs [default]
Round 0: e85 wins initiative!
Round 1: e85 attacks!
You gain 5 Strengthliness
You gain 6 Wizardliness
You gain 2 Chutzpah

(spade does not use any parameters)
No spading data has been collected yet. Please try again later.


Don't know what the spading was about.

Would it help to maximize the non-combat adventures while finding demons? Rock salt, sonata of sneakiness, etc?

Sounds like a lot of these problems are coming from canadv, like zarqon said I would make sure you have the latest version. (The unknown location is from canadv, and the spading problem sounds like it might be too)

As for the pie demon, if what you say is true then I guess maybe I could use visit_url and parse the result each time looking for the wires crossed response and then use that name again so mafia recognizes it (Or even better just manually set the demon name and I could avoid using an extra summon). And it only does it once because i assumed you could only do one summon per day even if it failed. Is that not the case? And if you can do multiple summons per day it could be dangerous to just loop until you get the wires crossed response because there is the possibility of eating through lots of scrolls and candles in the process. I accidentally got drunk again before I could test it >_< so I'll try to remember tomorrow. I really need to make a multi for testing these things... but I'm too lazy.

Like zarqon said, I'm not sure if it's affected by the noncombat % I think it probably has it's own counter.
 

jasonharper

Developer
Mafia should learn the pie demon name from the crossed wires response - no need to actually summon it. You can keep trying for that one for as long as you have scrolls & candles, the limit is one successful summon per day.
 
Mafia should learn the pie demon name from the crossed wires response - no need to actually summon it. You can keep trying for that one for as long as you have scrolls & candles, the limit is one successful summon per day.

Oh ok, thanks for the clarification on that. So I guess that means my code will work if I just throw it in a while loop. Although I think I should put some kind of limit or something, to stop it from wasting all of your meat on scrolls and candles if the RNG decides to screw you.
 

zarqon

Well-known member
I tested this on a multi that didn't have the pie demon name:

Code:
while (get_property("demonName1") == "") 
   cli_execute("summon christopher guest");

and it worked:

Summoning christopher guest...
Summoning christopher guest...
Demon name: Elwaitler
Summoning Chamber
Returned: void
 

Heffed

Member
It found the pie demon name for me on the third try, but it didn't think it did.

Creating scroll of ancient forbidden unspeakable evil (1)...
You acquire an item: scroll of ancient forbidden unspeakable evil
Successfully created scroll of ancient forbidden unspeakable evil (1)
Summoning fail...
Demon name: Ripbargam
Summoning Chamber
Can't find demon 1 right now
Putting on Lord Spookyraven's ear trumpet...
Equipment changed.

Resuming the script says it has located demon 1.

After finding Hoom Hah, I got the same message already mentioned.

Found demon 2
Unknown location: Post-War Sonofa Beach
Please report this missing location here: http://kolmafia.us/showthread.php?t=2027
You can't adventure at the Post-War Sonofa Beach right now.
Can't find demon 3 right now.

I downloaded the latest canadv.ash before running find_demons. (Assuming the download link on the first page of the Canadv thread is the latest) The character I'm testing with is level 31 and can definitely adventure at Sonofa Beach.

In all my time playing, I've never bothered with summoning demons. Now after running this script and finding a couple, I have a question. Is there someplace that lists the names of the demons you've found? I assumed they'd be under "Other Accomplishments" in the quest log, but that doesn't appear to be the case.
 

Spiny

Member
In all my time playing, I've never bothered with summoning demons. Now after running this script and finding a couple, I have a question. Is there someplace that lists the names of the demons you've found? I assumed they'd be under "Other Accomplishments" in the quest log, but that doesn't appear to be the case.

In the CLI you can type "demons" and this will list all known demons for the character in question. They are recorded into your preferences file, but it's always a good idea to make a note of them yourself ;) Also if you have any characters that learned demon names when not using mafia, you can set the respective demon name with "set demonName#=nameofdemon" Obviously you'd replace the # with the appropriate number of the respective demon according to the "demons" output.

-Spiny
 

Heffed

Member
In the CLI you can type "demons" and this will list all known demons for the character in question. They are recorded into your preferences file, but it's always a good idea to make a note of them yourself ;) Also if you have any characters that learned demon names when not using mafia, you can set the respective demon name with "set demonName#=nameofdemon" Obviously you'd replace the # with the appropriate number of the respective demon according to the "demons" output.

Good to know, thanks! :)

And yes, I had added the ones the script found to my "Notes", but was thinking there was probably something I was overlooking.
 

zarqon

Well-known member
Hmmm, odd that an old snarfblat location would be missing from CanAdv, but missing it was. I just added it in and posted the update.
 

Heffed

Member
OK, thanks! I've updated canadv.ash again and I'll give this script another go tomorrow night when I have some more adventures. :)
 

tgetgel

Member
Quote:
Originally Posted by Heffed
It found the pie demon name for me on the third try, but it didn't think it did.


The Pie Demon shows up with the crossed wires adventure. The name is in the text, but does not get registered as being found until you actually use that name in a summoning. You might need to "show in browser" when that response shows up, then have the user copy the name and manually summon the Pie Demon.

At least that is how I had to do it.
 
I was only missing the Post-war Sonofa Beach and the Friar's Gate ones, I ran it with zarqon's latest CanAdv and it found both. I looked at the code for the pie demon and, and I have no idea why it was saying it wasn't found. It looks like it should work... I wonder if it's some problem with mafia not updating the property when i think it does?

Here's the code for that part:

Code:
boolean find_pie_demon() {
	if (get_property("demonName1") == "") {
		if (get_property("demonSummoned") == "false") {
			for i from 1 to max_summon_attempts {
				cli_execute("summon fail");
				if (get_property("demonName1") != "") return true;
			}
			print("I think we've wasted enough time summoning now...", "red");
		} else {
			print("You have already summoned a demon today.", "red");
		}
	}
	return get_property("demonName1") != "";
}

Can anyone think of why that would be returning false after finding the pie demon? (It only happens if you don't have the pie demon when you run the function, and it finds it for you. Because I have already found it and it returns true when I run it.)
 

zarqon

Well-known member
I'd do it with a while loop:

Code:
boolean find_pie_demon() {
   if (get_property("demonSummoned") == "true") return error("You already summoned today.");
   int i = 1;
   while (get_property("demonName1") == "" && i < max_summon_attempts && retrieve_item(1,$item[scroll of ancient forbidden]) && retrieve_item(3,$item[thin black candle]))
      cli_execute("summon Christopher Guest");
   return get_property("demonName1") != "";
}
 
I'd do it with a while loop:

Code:
boolean find_pie_demon() {
   if (get_property("demonSummoned") == "true") return error("You already summoned today.");
   int i = 1;
   while (get_property("demonName1") == "" && i < max_summon_attempts && retrieve_item(1,$item[scroll of ancient forbidden]) && retrieve_item(3,$item[thin black candle]))
      cli_execute("summon Christopher Guest");
   return get_property("demonName1") != "";
}

Well it does look more concise, but i don't see why the result would be any different. Oh well, can't hurt to try it. Also, I guess it's a good idea to make sure you have the scroll and candles first.
 
Top