J~<rNukes: [0/3]> <vAir Drop: [3/3]> Reset: [63%] Suit: Salamander
if x.value:find("J~<rNukes: [(%d+)/(%d+)]> <vAir Drop: [(%d+)/(%d+)]> Reset: [(%d+)%] Suit: (%w+)") then
nukesCur = x.value:match("<rNukes: [(%d+)")
nukesMax = x.value:match("(%d+)]> <vAir Drop:")
adropCur = x.value:match("<vAir Drop: [(%d+)")
adropMax = x.value:match("/(%d+)]> Reset")
reset = x.value:match("Reset: [(%d+)%]")
suitCur = x.value:match("Suit: (%w+)")
clearUserWindow("StatusBar2")
cecho("StatusBar2","<white>[<LightSeaGreen>M<light_slate_grey>:<LightSeaGreen>" .. nukesCur .. "<white>/<LightSeaGreen>" .. nukesMax .. "<white>][<LightSeaGreen>C<light_slate_grey>:<LightSeaGreen>" .. adropCur .. "<white>/<LightSeaGreen>" .. adropMax .. "<white>][<LightSeaGreen>R<light_slate_grey>:<LightSeaGreen>" .. reset .. "%<white>]")
end
I have these 2 if/then statements within a certain trigger. For some reason i can't deduce, the code in the above box doesn't work, but the code in the box below does even though they seem the same to me. Can anyone see if there's something wrong with the above code? Or what difference is causing this?
K~A Small Nightmare Cow Herd~L~74~
if x.value:find("K~([^~]+)~L~(%d+)") then
mobName = x.value:match("K~([^~]+)")
mobHealth = x.value:match("L~(%d+)")
clearUserWindow("StatusBar5")
cecho("StatusBar5","<white>[<purple>E<light_slate_grey>:<magenta>" .. mobName.. "<white>:<purple>" .. mobHealth .. "%<white>]")
end