Bug - Fixed missing monsters?

I have a wicked crude script that generates a monster->location map that depends on to_monster().
I looked through the most recent changes but nothing stood out as an obvious "that's what broke this".

Current list of failed monsters.
Code:
Creating monster map
1: Fire-Breathing Duck
2: Scorched Duck
3: BL Imp
4: CH Imp
5: Pr Imp
6: Ol' Scratch
7: Cobb's Knob Oven
8: Demoninja
9: G Imp
10: L Imp
11: Fallen Archfiend
12: G Imp
13: P Imp
14: Hellion
15: P Imp
16: W Imp
17: Swarm of Fire Ants
18: brushfire
19: Flame-Broiled Meat Blob
20: Overdone Flame-Broiled Meat Blob
21: Inkubus
22: Serialbus
23: Suckubus
24: Fire-Breathing Duck
25: Scorched Duck
26: Knob Goblin Barbecue Team
27: Demoninja
28: Fallen Archfiend
29: G Imp
30: Hellion
31: L Imp
32: P Imp
33: W Imp
34: The Master of Ceremonies
35: Ten Skeletons
36: 25 Skeletons
37: 100 Skeletons
38: The Sorrowful Hickory
39: The Suffering Juniper
40: The Tormented Baobab
41: The Whimpering Willow
42: The Woeful Magnolia
43: Gorgolok, the Infernal Seal
44: Stella, the Turtle Poacher
45: Spaghetti Elemental
46: Lumpy, the Sinister Sauceblob
47: The Spirit of New Wave
48: Somerset Lopez, Dread Mariachi
Don't remember exactly, but I'm pretty sure the only ones that failed when I last ran the script (around r11565) were the Ten/25/100 Skeletons.
 

Theraze

Active member
Here's a question... does your script know about or handle monsters that appear in multiple zones? Because it appears at least some of those, the imps and ducks at very least, are...
 

ckb

Minion
Staff member
I also have a wicked crude script to do the same thing... It returns the first location it finds for each monster. I do not recall any of these such errors, but I am likely doing something very different than you. There are definitely sone that return "unknown"
Here is my script:
(it accepts and returns strings, but could easily use $monster and $location)

Code:
string monloc(string ms)
{
	monster mm = to_monster(ms);
	foreach ll in $locations[]
	{
		foreach key,mon in get_monsters(ll)
		{
			if (mon==mm)
			{
				return(to_string(ll));
			}
		}
	}
	return("unknown");
}
 
Code:
string[location,int,string,string,string,string,string,string,string,string,string,string,string,string,string,string,string,string,string,string,string,string,string,string,string,string] raw;
location[monster] clean;
int error=0;

void crl(string s,location l){
 if((s=="")||(s=="none"))return;
 string p;
 matcher m=create_matcher("(.+?):",s);
 if(m.find())s=m.group(1);
 m=create_matcher("(.+?) (\\(.+?\\))",s);
 if(m.find())p=m.group(1);
 if(s.to_monster()!=$monster[none]){
  clean[s.to_monster()]=l;
  return;
 }
 if(p.to_monster()!=$monster[none]){
  clean[p.to_monster()]=l;
  return;
 }
 error+=1;
 print(error+": "+s);
}

static{
 print("Creating monster map");
 file_to_map("combats.txt",raw);
 map_to_file(raw,"comnuts.txt");
 foreach l,i,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15,s16,s17,s18,s19,s20,s21,s22,s23,s24,s25 in raw{
  crl(s1,l);
  crl(s2,l);
  crl(s3,l);
  crl(s4,l);
  crl(s5,l);
  crl(s6,l);
  crl(s7,l);
  crl(s8,l);
  crl(s9,l);
  crl(s10,l);
  crl(s11,l);
  crl(s12,l);
  crl(s13,l);
  crl(s14,l);
  crl(s15,l);
  crl(s16,l);
  crl(s17,l);
  crl(s18,l);
  crl(s19,l);
  crl(s20,l);
  crl(s21,l);
  crl(s22,l);
  crl(s23,l);
  crl(s24,l);
  crl(s25,l);
 }
 map_to_file(clean,"monman.txt");
}

void main(){
 file_to_map("monman.txt",clean);
}

Here's a question... does your script know about or handle monsters that appear in multiple zones? Because it appears at least some of those, the imps and ducks at very least, are...
I've considered those, but this is failing to find a monster match for to_monster().
I'll handle location collisions later.


EDIT:
oooh, I didn't know about get_monsters(). I can clean this up a LOT with that. Thanks!

EDIT 2: new code
Code:
static{
 print("creating new map");
 monster[int] mons;
 foreach loc in $locations[]{
  mons=get_monsters(loc);
  foreach i,m in mons clean[m]=loc;
 }
 map_to_file(clean,"monmap2.txt");
}
So much cleaner.

In addition to the monsters from the OP, this method is also missing all the Dr. Seuss bosses.
 
Last edited:

Catch-22

Active member
Current list of failed monsters.
...

At least some of those monsters don't match the actual name of the monster.

ie.

> ash $monster[The Whimpering Willow]

Bad monster value: "The Whimpering Willow" ()
Returned: void

> ash $monster[Whimpering Willow]

Returned: Whimpering Willow

> ash $monster[brushfire]

Bad monster value: "brushfire" ()
Returned: void


I'm guessing this one was never actually added to the monsters database around the time of the event.

> ash $monster[Gorgolok, the Infernal Hellseal]

Bad monster value: "Gorgolok, the Infernal Hellseal" ()
Returned: void

> ash $monster[Gorgolok, the Demonic Hellseal]

Returned: Gorgolok, the Demonic Hellseal


That doesn't explain why things like "W Imp" weren't working, though.
 
Last edited:
I just had a friend try that with P Imp actually, and it worked. I'm going to say that's specific to -my- mafia then, even though I don't have any overrides for ... any data files. I'll have to contact... you actually, as I'm using the Excelsior-powered version of mafia.
 

Catch-22

Active member
I just had a friend try that with P Imp actually, and it worked. I'm going to say that's specific to -my- mafia then, even though I don't have any overrides for ... any data files. I'll have to contact... you actually, as I'm using the Excelsior-powered version of mafia.

I am also using the excelsior-powered verson Mafia, although when I test out patches I tend to revert back to running a JAR.

I'm not experiencing the issues you point out (aside from of course the cases where the monster names are incorrect). Did you update to the latest runtimes? Not doing so can lead to unpredictable behaviour.

I must admit, I don't currently have an easy way of informing people to update these. Fortunately, they rarely ever change.
 

slyz

Developer
m=create_matcher("(.+?) (\\(.+?\\))",s);
if(m.find())p=m.group(1);
I think this was the problem. Any monster with a space in its name would be problematic. "W Imp" would become "W", and to_monster("W") returns none.

EDIT: wait no, that's certainly not it. I shouldn't read regex before my morning coffee.

EDIT2: When I run the script from a .JAR, I get the following list:
Code:
Creating monster map
1: brushfire
2: Ten Skeletons
3: 25 Skeletons
4: 100 Skeletons
5: The Sorrowful Hickory
6: The Suffering Juniper
7: The Tormented Baobab
8: The Whimpering Willow
9: The Woeful Magnolia
10: Gorgolok, the Infernal Seal
11: Stella, the Turtle Poacher
12: Spaghetti Elemental
13: Lumpy, the Sinister Sauceblob
14: The Spirit of New Wave
15: Somerset Lopez, Dread Mariachi

Have you tried on a .JAR ?
 
Last edited:
Catch, yes, I updated the runtimes (the executable wouldn't even launch until I did) so that's not it.
And as for the regex being wrong, that's certainly a possibility, but even testing "ash to_monster("w imp");" from the gCLI returns errors.
Also, probably related, when selecting, say, the Dark Heart and looking at the Location Details, none of the monsters appear there. I haven't yet tried a JAR but I'll do that.

EDIT: Okay, tried the jar, everything works fine (except for the monsters whose names are "wrong", and hey, mafia's data, not mine). Naively hoped that this would somehow fix the executable, so I updated to 11586 (from 11585) and ran it, and noticed this gem at invocation of the gCLI (didn't log in):
Code:
Monster: "BL Imp": unknown option: E:
Monster: "CH Imp": unknown option: E:
Monster: "Cobb's Knob Oven": unknown option: E:
Monster: "Demoninja": unknown option: E:
Monster: "Fallen Archfiend": unknown option: E:
Monster: "Fire-Breathing Duck": unknown option: E:
Monster: "Flame-Broiled Meat Blob": unknown option: E:
Monster: "G Imp": unknown option: E:
Monster: "Hellion": unknown option: E:
Monster: "Hot Hobo": unknown option: E:
Monster: "Inkubus": unknown option: E:
Monster: "Knob Goblin Barbecue Team": unknown option: E:
Monster: "L Imp": unknown option: E:
Monster: "Ol' Scratch": unknown option: E:
Monster: "Overdone Flame-Broiled Meat Blob": unknown option: E:
Monster: "P Imp": unknown option: E:
Monster: "Pr Imp": unknown option: E:
Monster: "Scorched Duck": unknown option: E:
Monster: "Serialbus": unknown option: E:
Monster: "Suckubus": unknown option: E:
Monster: "Swarm of Fire Ants": unknown option: E:
Monster: "The Landscaper": unknown option: EA:
Monster: "W Imp": unknown option: E:
Initializing chat interface...
Requests complete.

Any ideas?
 
Last edited:

lostcalpolydude

Developer
Staff member
Do you have monsters.txt in your data folder? I changed "heat" to "hot" in mafia's files and in mafia's parsing, so that would happen if it's reading an old version.
 

Catch-22

Active member
Okay this is starting to make sense now.

When I migrated my repository to Windows 8 I managed to somehow configure SVN to use commit time as the last modified date instead of sync time. My system timezone is ahead of UTC so this caused the Ant build process to assume the latest built file was more recent than what had been commited.

Long story short, it should be fixed now and for future JET builds. If you download the latest version (even though it's the same revision) it should also be working.

Not a KoLmafia bug, but this is a reminder that people who are using the JET build should confirm the bug exists in regular builds of KoLmafia before posting here so the devs don't have to deal with it :) lostcalpolydude's post did sorta give me one of those "aha!" moments though. All the kolmafia classes are actually deleted by Ant before you build, but the monsters.txt file is part of data, so it doesn't get deleted unless there's been a change since last build (indicated by more recent "last modified" timestamp).
 
Last edited:
Okay this is starting to make sense now.

When I migrated my repository to Windows 8 I managed to somehow configure SVN to use commit time as the last modified date instead of sync time. My system timezone is ahead of UTC so this caused the Ant build process to assume the latest built file was more recent than what had been commited.

Long story short, it should be fixed now and for future JET builds. If you download the latest version (even though it's the same revision) it should also be working.

Not a KoLmafia bug, but this is a reminder that people who are using the JET build should confirm the bug exists in regular builds of KoLmafia before posting here so the devs don't have to deal with it :) lostcalpolydude's post did sorta give me one of those "aha!" moments though. All the kolmafia classes are actually deleted by Ant before you build, but the monsters.txt file is part of data, so it doesn't get deleted unless there's been a change since last build (indicated by more recent "last modified" timestamp).

I'll not pretend to understand all this, but, um, is monsters.txt a file that was out of date on your end? Because I didn't have any monsters.txt override files. But thanks for fixing at any rate!
 

Catch-22

Active member
I'll not pretend to understand all this, but, um, is monsters.txt a file that was out of date on your end? Because I didn't have any monsters.txt override files. But thanks for fixing at any rate!

Oh, yes. monsters.txt is a file on my end that gets built-in to KoLmafia. It contains all the monster data and it was out of date but my build process thought that it wasn't :p
 
Top