Monster Manuel Relay checker

charred

Member
Heh - just saw this. I actually noticed the problem a while back, but my work and travel have kept me from uploadng my fix. The regex is nice, but it makes my brain hurt most of the time.
I did this:
Code:
string kmon = monname;
if (substring(kmon,0,1)==" ") { kmon = substring(kmon,1) ; }
if (substring(kmon,0,2)=="a ") { kmon = substring(kmon,2) ; }
if (substring(kmon,0,3)=="an ") { kmon = substring(kmon,3) ; }
if (length(kmon)>3 && substring(kmon,0,4)=="the ") { kmon = substring(kmon,4) ; }
if (length(kmon)>4 && substring(kmon,0,5)=="some ") { kmon = substring(kmon,5) ; }

ckb
Just noticed that the script has issues with monster names that contain accented characters. *This is easily fixed:
Code:
	matcher nam = create_matcher("(?<=(id='monname'>))[B]([^<]+)[/B]",results);
*	string monname = "";

what lines do these go on or replace?
 

Aankhen

Member
My code replaces the existing matcher nam line (line 8). I think ckb’s code replaces the block of lines following if (find(nam)) { monname = group(nam); }.
 
Does anyone have any idea why this would work for one of my characters, but not for the other. Its a right steering wheel down the front of my pants, I tell you what.
 

xKiv

Active member
Does one of those characters have CAB enabled and the other doesn't?
Or does one of those characters have autoattack and the other doesn't?
(alternatively: does one of those characters kill the monster with just an autoattack, and the other not?)
 

Winterbay

Active member
CAB is the Combat Action Bar and is the, I guess MMO-like, bar at the top with your skills that you can define as you like it as opposed to the "old" system with buttons and dropdowns bellow the monster.
 

suinoq

New member
This thing still breaks when I fight a Bar. Otherwise, I'm happy for the most part.

Same for me. Here's the gCLI output.

[140598] Spooky Forest
Encounter: bar
Round 0: suinoq wins initiative!
End index 4 out of bounds (fight.ash, line 13)
Round 1: suinoq attacks!
Round 2: suinoq wins the fight!
You gain 14 Mana Points
You gain 17 Meat
You acquire an item: bar skin
You gain 63 Strongness
You gain 116 Mysteriousness
You gain 51 Sarcasm
End index 4 out of bounds (fight.ash, line 13)
 

lostcalpolydude

Developer
Staff member
A quick fix for that is changing
Code:
string kmon = monname;
if (substring(kmon,0,1)==" ") { kmon = substring(kmon,1) ; }
if (substring(kmon,0,2)=="a ") { kmon = substring(kmon,2) ; }
if (substring(kmon,0,3)=="an ") { kmon = substring(kmon,3) ; }
if (length(kmon)>3 && substring(kmon,0,4)=="the ") { kmon = substring(kmon,4) ; }
if (length(kmon)>4 && substring(kmon,0,5)=="some ") { kmon = substring(kmon,5) ; }
to
Code:
string kmon = monname;
if (substring(kmon,0,1)==" ") { kmon = substring(kmon,1) ; }
else if (substring(kmon,0,2)=="a ") { kmon = substring(kmon,2) ; }
else if (substring(kmon,0,3)=="an ") { kmon = substring(kmon,3) ; }
else if (length(kmon)>4 && substring(kmon,0,4)=="the ") { kmon = substring(kmon,4) ; }
else if (length(kmon)>5 && substring(kmon,0,5)=="some ") { kmon = substring(kmon,5) ; }

I thought that a fix for that issue was posted when the thread was active earlier, but I'm not seeing it. Not actually tested since my current method of factoid tracking is a manually-updated file, which works well enough when the list is down to about 20 monsters missing.
 
Last edited:

Theraze

Active member
Wouldn't it be easier to just make the checks actually right? Instead of checking for length of 4+ and then taking the 5th character, change the first length-check to >4. Change the second length-check to >5 (since you're checking 6 characters), and... good.

Since the current code breaks for any 4 or 5 character monster.
 

lostcalpolydude

Developer
Staff member
Fixed that in my previous post. Changing it to else if should speed things up slightly anyway, and would have worked around the issue at least.
 

Theraze

Active member
True... but the original code worked for improperly spaced monsters and other edge brief KoL or mafia bugs that crop up every now and then. :) Sort of like how gremlin juice has a space at the front of its name for the purposes of BCA. Why? Because it does. :)

But yeah, barring weird bugs, the if/elseif sequence should be faster since it stops evaluating as soon as there's a match.
 

ckb

Minion
Staff member
Is anyone still using this outdated thing? It probably still mostly works, I guess, but will likely break for some of the weird manuel cases. This does not handle them at all.
A good solid fix would be to <import missingManuel.ash> (by Turing) and use that logic. If I feel ambitious, I may do this. Or if anyone else feels that way...
 
Top