Actually I am not sure if STRING_EQUAL is causing the problem or if it is due to something else. When I try to run this code I am told that "In state 23, I expected one of these tokens: [2] ~~. Parse error <state 23> at END". What I am attempting to do is detect whether a CRE is wearing an armour, find out what kind of armour it is and then replace it with something else.
READ_LONG 0x2b8 "itemslotoffset"
READ_LONG 0x2bc "itemsoffset"
READ_SHORT ("%itemslotoffset%" + "2") "armour"
PATCH_IF ("%race%" = "1" AND "%armour%" != "63535") BEGIN // Human Armour Correction
READ_ASCII ("%itemsoffset%" + ("%armour%" * "14")) "armourfile"
PATCH_IF ("%armourfile%" STRING_EQUAL "LEAT01") BEGIN
REPLACE_CRE_ITEM ~leat01a~ #0 #0 #0 ~armor~
END
END