How to array

Post Reply
holypickle
Posts: 10
Joined: Sun Feb 14, 2016 1:06 pm

How to array

Post by holypickle »

I need to be able to heal myself when my health goes below 50%. How would I do this?

here's what the MUD sends me when I get damaged.

IE

Hp: 70 60%
Human bandit hits you.

User avatar
Belgarath
Posts: 232
Joined: Fri Jul 26, 2013 7:19 am
Discord: macjabeth#7149

Re: How to array

Post by Belgarath »

Something like this (bare minimum of effort unless you want to build a modular system):
Code: [show] | [select all] lua
-- ^Hp: \d+ (\d+)%$
if tonumber(matches[2]) < 50 then
  send("heal myself")
end
And you would probably add in extra variables like your health balance or a cooldown timer so you don't spam it.

holypickle
Posts: 10
Joined: Sun Feb 14, 2016 1:06 pm

Re: How to array

Post by holypickle »

Thanks man

Post Reply