Bug - Fixed Combat Macro syntax checker

Just looked at mafia's compared to mine; Mafia is saying that you need double-quotes around parameters containing spaces for the monstername predicate. This is inaccurate. Only the match predicate requires quotes around parameters containing spaces. use <item name> or monstername <monster name> does not need quotes, and it might actually mess up if quotes are used, haven't tested that, but I do know that KoL is perfectly fine with having no quotes around item names or monster names.
 

jasonharper

Developer
r8486 updates the syntax checker to 1.2, which implements this change. The file relay/macrohelper.js may need to be manually deleted to get the new version to load.
 

jambosque

New member
Wow! The syntax checker is excellent!

However, apparently leading white-space matters for combat macros -- v.1.2 didn't catch it. (It took me a good 30 seconds to notice that there was extra white-space in my macro... :))
 

jasonharper

Developer
Could you give an example of what you mean by "leading white-space matters"? You certainly can (but aren't required to) indent lines of the macro, so this appears false at first glance.
 

jambosque

New member
Ah, good to know that semi-colons are also statement separators for macros.

I was implementing Disco Combos as macros, and was copy-pasting from the wiki (hence the spaces I didn't initially notice). If I recall correctly, the macro looked something like the following:

Code:
    skill Disco Eye-Poke
    skill Disco Dance of Doom
    skill Disco Dance II: Electric Boogaloo

Edit: Also good to know, spiny. I was making combat decisions manually at the time (I don't trust myself enough as a coder to write a ccs that uses resources efficiently during ascension, plus I like to rethink my actions in the game as I'm in the middle of carrying them out -- in fact, this was exactly why I ended up writing that particular macro).
 
Last edited:

Spiny

Member
Ah, good to know that semi-colons are also statement separators for macros.

I was implementing Disco Combos as macros, and was copy-pasting from the wiki (hence the spaces I didn't initially notice). If I recall correctly, the macro looked something like the following:

Code:
    skill Disco Eye-Poke
    skill Disco Dance of Doom
    skill Disco Dance II: Electric Boogaloo

If the macro is run from mafia, mafia will handle the conversion of "combo Disco Concentration" and other Disco combos into their finer parts, so long as mafia has observed the skill to be aware of it. This includes the Rave combo skills as well. I only became aware of this recently myself when I saw Bale's post in the KoL Forums here.
 

jasonharper

Developer
jambosque, you still haven't said exactly what the problem is. Did that copy&pasted macro not work, but the syntax checker thought it was OK? Or did it work, but the checker said it was bad?

Indentation on a webpage is somewhat problematic, due to the way HTML deals with whitespace. Indentation may have been done via non-breaking space characters, which are rather inconsistently handled (they turn into asterisks when pasted here, for example), so could easily be interpreted differently by the checker and the game.
 
Okay, just did further testing.
this works: monstername "black knight"
this also works: monstername black knight

this doesn't work: use "turtle totem"
but this does work: use turtle totem
 
Top