Not sure what it's called really.

Post Reply
Guilend
Posts: 36
Joined: Fri Mar 09, 2018 1:21 am

Not sure what it's called really.

Post by Guilend »

A long time ago I was given settings to be able to just use one alias to do all of my healing of both my mana and health, but I have lost all of my settings and I now have all of them back except that one, I never figured out how it worked so I cannot recreate it. I play Avalon, but it would be kind of like the healing system in Achaea, the auto healing, except using an alias to do it.

2041/2041h, 2041/2041m cefCiptx ({-})

This is the prompt line. The "cefCiptx" changes and the little "p" and little "t" are the indicators of the healing/mana potions and healing herbs cooldowns. "p" for the potion and "t" for the herb. The last part of the line also changes, the brackets indicate if I am blended and/or invisible. the line in the middle just indicates what form I am in, in this case human.

I want to just hit like "h" and depending on how much health i have and how much mana I have, I either heal one or the other, and depending on if i am on herb, potion cooldown depending of if I use on or the other or use my healhand charm which takes eq, which is indicated by the "e" in the prompt.

So here are the different commands:
Drink Health
Drink Mana
Eat Lestagii//outp lestagii
point healhand

Those are the 4 ways to heal health and mana, healhand only heals health, lestagii can health both health and mana. I am not sure how to better explain this, if you have any questions please ask, I am bad at being able to explain things so I am sorry for that.

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Not sure what it's called really.

Post by Jor'Mox »

Can you write this out sort of like a flow chart?

I.E. something sort of like this:
Is health below 90% max health?
->No
-Is 'p' present in prompt?
-->No
--send "drink health"

Basically, lay out the process why which you would make the decision of what to do in a logical manner that can be easily traced, so that code can be written to execute the same steps and produce the proper outcome.

Guilend
Posts: 36
Joined: Fri Mar 09, 2018 1:21 am

Re: Not sure what it's called really.

Post by Guilend »

I am sure, but I think my biggest issue is knowing how to correctly capture the prompt cooldowns for everything. but anyway, It's kind of over my head right now and I think I will wait to figure this out once I get further in my learning. One day I will figure it out.

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Not sure what it's called really.

Post by Jor'Mox »

Are there any repeats in the prompt string thing that shows cooldowns, or are they all unique?

Assuming they are unique, I would make a prompt pattern like this: ^(\d+)/(\d+)h, (\d+)/(\d+)m (\w+)

Then, the cool down info would be stored in matches[6], so we could do something like this. In the prompt trigger, store that string in a variable to reference with your alias, like so:
Code: [show] | [select all] lua
current_health = matches[2]
max_health = matches[3]
current_mana = matches[4]
max_mana = matches[5]
cooldowns = matches[6]
And then in your alias, check that variable for the necessary text, like this:
Code: [show] | [select all] lua
if not string.find(cooldowns,"t") then
 -- your herb is NOT on cool down, make whatever decision you would make here
elseif not string.find(cooldowns,"p") then
 -- your potion is NOT on cool down, but your herb IS on cool down, make whatever decision here
else
 -- both your potion and herb are on cool down
end

Post Reply