ScriptUO
Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: HalfMercy on October 22, 2015, 04:59:25 AM
-
I'm thinking it would be handy to have a visual indicator of how much time my Consecrate Weapon / Div Fury have on them and/or how long debuffs or negative effects on monsters are going to last. If this has ever been done, I can't find it unfortunately.
-
On EasyUO this is not easy to do.
You would either need the calculation factors (skill , effect , calculations through resist and such) and calculate once the Skill Icon appears or parse text once you hover over the symbol on buff | debuff bar.
-
This is only about NEGATIVE buffs you cause on a target..
This issue has 2 sides.
(1) Actions that cause a Buff icon to appear on target and originators bar (ie bard masteries and others)
As crome stated you can mouse over the icon and it shows a countdown. I have previously thought about adding this ability to read this timer to the buffbar scanner; but didn't do it because is would mean moving the mouse and that would likely interrupt any combat game play going on and it is far simpler and far faster to simply repeatedly read the buff bar until the icon is gone. (buff bar scans take milliseconds)
(2) Actions that only cause a buff icon on target bar.
For these you have no choice but to calculate the length of duration based on a published or estimated formula.
Their might be a few cases where you get a journal message when the negative effect wears off the target .. but not 100% sure on that.
-
Gotcha, thanks. I play a free server where we don't have the buff icons so I do a mental countdown, lol. For short term effects it's good enough but on longer ones like bless, not so much. Oh well :)
-
since you don't have the buff bar and require to use the timer, at some point in time we use timer too.
this what you can may be do to help you. set all you timer on top
set %spellTimerCW #scnt
while #true
{
if %spellTimerCW < #scnt )
gosub CWep
}
sub CWep
event macro 15 203
set %spelltimer #scnt + 10 ; 10 is for the time to wait before it recast CW again.
wait 5 ; this is to help with FCR
return
-
Took me a few mins to knock up the code below; you can add as many actions as you wanted that would repeat when the set time is passed. (You can make is more instantaneous if you use Milliseconds instead of seconds... have fun (untested code but should more or less work)
gosub AddAction ConcencrateWeapon 15 203 10
;gosub AddAction ActionName event1 event2 timelasts
;gosub AddAction ActionName event1 event2 timelasts
;gosub AddAction ActionName event1 event2 timelasts
set !Count 0
Repeat
set !Count !Count + 1
if !Count > %TotalActions
set !Count 1
if #scnt > %ActionTime . !Count
{
event macro %ActionEvent1 . !Count %ActionEvent1 . !Count
set %ActionTime . !Count %ActionTimeLasts . !Count + #scnt
wait 5
}
until #charghost = yes
halt
gosub AddAction ; ActionSubName event1 event2 wait timelasts
if %TotalActions = N/A
set %TotalActions 0
set %TotalActions %TotalActions + 1
set %ActionSubName . %TotalActions %1
set %ActionEvent1 . %TotalActions %2
set %ActionEvent2 . %TotalActions %3
set %ActionTimeLasts . %TotalActions %4
set %ActionTime . %TotalActions %ActionTimeLasts . %TotalActions - #scnt ; trigger straight away
return
-
Thank you both, Ghost and EN! Very nice of you guys to do that + I'm anxious to start trying them out! :)
-
Nice job EN. will you be willing to add a few line of explanation beside each line. I'm trying to understand the next level of coding and having a little bit of problem. Like you use "dot" not sure why?
-
Nice job EN. will you be willing to add a few line of explanation beside each line. I'm trying to understand the next level of coding and having a little bit of problem. Like you use "dot" not sure why?
sure thing... by the way the code was just an extrapolation of the code you had posted. But I did just notice 2 small errors so below is corrected and below that big explanation version .. you should look up . and , uses in the wiki http://wiki.easyuo.com/index.php?title=Operators
gosub AddAction ConcencrateWeapon 15 203 10
;gosub AddAction ActionName event1 event2 timelasts
;gosub AddAction ActionName event1 event2 timelasts
;gosub AddAction ActionName event1 event2 timelasts
set !Count 0
Repeat
set !Count !Count + 1
if !Count > %TotalActions
set !Count 1
if #scnt > %ActionTime . !Count
{
event macro %ActionEvent1_ . !Count %ActionEvent2_ . !Count
set %ActionTime . !Count %ActionTimeLasts . !Count + #scnt
wait 5
}
until #charghost = yes
halt
gosub AddAction ; ActionSubName event1 event2 wait timelasts
if %TotalActions = N/A
set %TotalActions 0
set %TotalActions %TotalActions + 1
set %ActionSubName . %TotalActions %1
set %ActionEvent1_ . %TotalActions %2
set %ActionEvent2_ . %TotalActions %3
set %ActionTimeLasts . %TotalActions %4
set %ActionTime . %TotalActions %ActionTimeLasts . %TotalActions - #scnt ; trigger straight away
return
gosub AddAction ConcencrateWeapon 15 203 10
; SUBS are very usful for repeated actions . in this case i want to create
; a list of timers. So using a single sub to add items to the list = less code
; and easier to use .. I could have just repeated the contents of the add action sub for each of the lines below
;
; Every time you call this sub is increates the value of %TotalActions by 1. It then sets the varialbes %ActionSubname1 = %1 etc
; Add more timers in the this format... doesnt matter how many you add.
;gosub AddAction ActionName event1 event2 timelasts
;gosub AddAction ActionName event1 event2 timelasts
;gosub AddAction ActionName event1 event2 timelasts
set !Count 0 ; I am creating a loop !count moves from 1 to the value in %TotalActions
Repeat
set !Count !Count + 1 ; increment the loop count
if !Count > %TotalActions
set !Count 1 ; If the loop count is greater than the Total number of actions set the count back to 1
; When Count is 1 we look at the First Action when count is 2 we examine the 2nd action
; ie if count is 1 then %ActionTime . !Count becomes %ActionTime1
; if count is 37 then %ActionTime . !Count becomes %ActionTime37
if #scnt > %ActionTime . !Count ; If the time is greater than the next action
{
event macro %ActionEvent1_ . !Count %ActionEvent2_ . !Count
; if !count is 99 then above is event macro %ActionEvent1_99 %ActionEvent2_99
set %ActionTime . !Count %ActionTimeLasts . !Count + #scnt
; if !count is 99 then above is set %ActionTime99 %ActionTimeLasts99 + #scnt
}
until #charghost = yes ; stop looping when the the player is a ghost.
halt ; very important that you halt the script. Good script structure is start/initialize Some-Action-Loop Halt Subs (that contain the bulk of the code).
gosub AddAction ; ActionSubName event1 event2 wait timelasts
if %TotalActions = N/A ; First time you run the code %totalactions = N/a thierfor set it to 0 so can do math
set %TotalActions 0
set %TotalActions %TotalActions + 1 ; Increment the count (First time sub is run =1 2nd time = 2 .. 10th time = 10 etc)
set %ActionSubName . %TotalActions %1 ; if %Totalactions = 1 then becomes set %ActionSubName1 %1
set %ActionEvent1_ . %TotalActions %2 ; if %Totalactions = 2 then becomes set %ActionEvent1_2 %2
set %ActionEvent2_ . %TotalActions %3 ; if %Totalactions = x then becomes set %ActionEvent1_x %3
set %ActionTimeLasts . %TotalActions %4 ; as above
set %ActionTime . %TotalActions %ActionTimeLasts . %TotalActions - #scnt ; trigger straight away - as above sets the next trigger time
return
To see all the Vars set run the code then from tools choose VarDump... scroll down and look at all the %Action????? Vars.
-
Funny EN, I have something very similar in my champ spawn manager. :) Again, great minds think alike.
-
Funny EN, I have something very similar in my champ spawn manager. :) Again, great minds think alike.
:)
ooo champ spawn manager... that sounds powerful...
-
Funny EN, I have something very similar in my champ spawn manager. :) Again, great minds think alike.
:)
ooo champ spawn manager... that sounds powerful...
MmmmmmM! THE POWER!!!!!!
-
Now you two get me drooling all over my self ???