I've been trying for a while to get a queueable "Blesser" script running for Imperian. I've scrapped it a few times, and I'm hoping someone can help out. Basically, what I'd like it to do is:
Alias: ^bless (\w+)$
This alias will add PLAYER to a table. If it's not currently blessing someone else already, begin blessing that person.
The blessings are:
bless X frostshield
bless X willpower
bless X endurance
bless X thermalshield
bless X earthshield
If in the middle of the first players blessings, I want to add a 2nd person, I want to do "bless PLAYER" and have it add the 5 blessings to the queue to be done to that person.
if I get attacked, I'd like to:
Alias: ^pause bless$
Alias: ^clear ?bless$
or
Alias: ^show ?bless$
(to see how much longer I have till it ends)
If paused, I want to:
Alias: ^resume bless$
Trigger lines may be:
^You call upon your faith and bestow the (\w+) blessing upon .+\.$
Wildcard = Earthshield | Frostshield | Thermalshield | Willpower | Endurance
Each blessing takes 3.8 seconds of Equilibrium.
EDIT: Error handling triggers include:
^You have already been blessed with that blessing.$
^(\w+) has already been blessed with that blessing.$
The system would need to know what blessing it attempted last, remove it from the table (or +1) and do next. There is no EQ lost on attempted blessings that were already there.
Any thoughts on how to construct this? I'm a beginner in LUA (also known as terrible)
Imperian Blesser
Re: Imperian Blesser
This was typed up in notepad with no testing, so it may not be 100% accurate. But you get the picture.
Any comments, concerns, questions?
Re: Imperian Blesser
Nicely done I'd say. Left out the queue for people though. But still beggars can't be choosers right?
Re: Imperian Blesser
Hey guys,
Thanks a lot for the assistance. With a few tweaks, I got the system working just fine for what I need it to do. I spent some time trying to make it do some other things, and couldn't, but regardless, thank you for the starting point!
I'll post what I have so far, which has been tested to work. Here are some points I was curious about:
1. When does blesser ever = false (outside of toggle bless)?
2. How can I add "You have already been blessed with that blessing." to cecho: "cecho("\n<red>[<white>Blesser<red>]: <white>User already has "..blessings[1]) ? because doing that, simply, doesn't work.
3. I added cecho("\n<red>[<white>Blesser<red>]: <white>Blessing Finished!") to checkBlessing and it only fired when I already had all 5x blessings already. It wouldn't fire on the following EQ gained after blessing with the last bless, most likely because I could not figure out where to put it so that while blessing = true but blessings = nil, then blessings = false and then cecho the finished text.
SCRIPT:
You have regained your mental equilibrium. ---> checkBlessing()
^(\w+) has already been blessed with that blessing.$ ---> checkBlessing()
You have already been blessed with that blessing. --> checkBlessing()
Alias: ^bless (\w+)$
targ = matches[2]
startBlessing(targ)
The rest is all about the same. I removed the tempTimers in favour of an EQ trigger, since blessing time 3.8 varies a lot on whether you have a heavier shield on, without inspiration up, and/or any sort of lag.
local curTime was nil, so I just initialized it as local curTime = 0.0. Just for the sake of "show bless" working. Which isn't necessary, really, if the system doesn't queue. Which is fine.
Thanks a lot for the assistance. With a few tweaks, I got the system working just fine for what I need it to do. I spent some time trying to make it do some other things, and couldn't, but regardless, thank you for the starting point!
I'll post what I have so far, which has been tested to work. Here are some points I was curious about:
1. When does blesser ever = false (outside of toggle bless)?
2. How can I add "You have already been blessed with that blessing." to cecho: "cecho("\n<red>[<white>Blesser<red>]: <white>User already has "..blessings[1]) ? because doing that, simply, doesn't work.
3. I added cecho("\n<red>[<white>Blesser<red>]: <white>Blessing Finished!") to checkBlessing and it only fired when I already had all 5x blessings already. It wouldn't fire on the following EQ gained after blessing with the last bless, most likely because I could not figure out where to put it so that while blessing = true but blessings = nil, then blessings = false and then cecho the finished text.
SCRIPT:
TRIGGERS:
You have regained your mental equilibrium. ---> checkBlessing()
^(\w+) has already been blessed with that blessing.$ ---> checkBlessing()
You have already been blessed with that blessing. --> checkBlessing()
Alias: ^bless (\w+)$
targ = matches[2]
startBlessing(targ)
The rest is all about the same. I removed the tempTimers in favour of an EQ trigger, since blessing time 3.8 varies a lot on whether you have a heavier shield on, without inspiration up, and/or any sort of lag.
local curTime was nil, so I just initialized it as local curTime = 0.0. Just for the sake of "show bless" working. Which isn't necessary, really, if the system doesn't queue. Which is fine.
Re: Imperian Blesser
Oh, in case you just want the whole package, I'll append it here.
- Attachments
-
- Blesser.xml
- (6.75 KiB) Downloaded 489 times
Re: Imperian Blesser
Put it up in the scripts section, too
Re: Imperian Blesser
Good idea. It's not mine to put up, though. I wanted to see to its tweaks a bit first and then get it posted, possibly.Vadi wrote:Put it up in the scripts section, too