Author Topic: Is there a spell timer script anywhere?  (Read 4084 times)

0 Members and 1 Guest are viewing this topic.

Offline HalfMercyTopic starter

  • Jr. Member
  • **
  • Posts: 40
  • Activity:
    0%
  • Reputation Power: 1
  • HalfMercy has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Is there a spell timer script anywhere?
« on: October 22, 2015, 04:59:25 AM »
0
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. 

Offline Crome969

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: Is there a spell timer script anywhere?
« Reply #1 on: October 22, 2015, 05:21:49 AM »
0
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.


Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Is there a spell timer script anywhere?
« Reply #2 on: October 22, 2015, 06:03:08 AM »
0
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.
« Last Edit: October 22, 2015, 06:05:50 AM by Endless Night »
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline HalfMercyTopic starter

  • Jr. Member
  • **
  • Posts: 40
  • Activity:
    0%
  • Reputation Power: 1
  • HalfMercy has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: Is there a spell timer script anywhere?
« Reply #3 on: October 23, 2015, 04:31:17 AM »
0
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  :)

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Is there a spell timer script anywhere?
« Reply #4 on: October 24, 2015, 05:06:32 AM »
0
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
Code: [Select]
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

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Is there a spell timer script anywhere?
« Reply #5 on: October 24, 2015, 05:37:03 AM »
0
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)


Code: [Select]
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
« Last Edit: October 24, 2015, 05:38:43 AM by Endless Night »
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline HalfMercyTopic starter

  • Jr. Member
  • **
  • Posts: 40
  • Activity:
    0%
  • Reputation Power: 1
  • HalfMercy has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: Is there a spell timer script anywhere?
« Reply #6 on: October 24, 2015, 07:09:19 PM »
0
Thank you both, Ghost and EN! Very nice of you guys to do that + I'm anxious to start trying them out!  :)

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Is there a spell timer script anywhere?
« Reply #7 on: October 24, 2015, 07:19:27 PM »
0
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?

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Is there a spell timer script anywhere?
« Reply #8 on: October 25, 2015, 07:36:48 AM »
0
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

Code: [Select]
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

Code: [Select]
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.
« Last Edit: October 25, 2015, 07:41:19 AM by Endless Night »
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Is there a spell timer script anywhere?
« Reply #9 on: October 25, 2015, 02:50:49 PM »
0
Funny EN, I have something very similar in my champ spawn manager.  :) Again, great minds think alike.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Is there a spell timer script anywhere?
« Reply #10 on: October 26, 2015, 05:11:01 AM »
0
Funny EN, I have something very similar in my champ spawn manager.  :) Again, great minds think alike.

:)
ooo  champ spawn manager... that sounds powerful...   
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Is there a spell timer script anywhere?
« Reply #11 on: October 26, 2015, 06:19:36 AM »
0
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!!!!!!   
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Is there a spell timer script anywhere?
« Reply #12 on: October 26, 2015, 08:12:47 AM »
0
Now you two get me drooling all over my self   ???

Tags: