Page 1 of 1

Buff macro

Posted: January 20th, 2017, 10:12 pm
by Savitar
Can anyone help me with a uo steam macro to keep buffs up? Such as enemy of one consecrate wep divine fury and confidence

Re: Buff macro

Posted: January 20th, 2017, 11:01 pm
by zulu2401
When you cast consecrate does it appear in your buff bar?

Re: Buff macro

Posted: January 21st, 2017, 1:49 am
by Madmarz
Can change the order to whatever your needs/priorities, check loop and good

Code: Select all

if not buffexists 'Enemy of One'
  cast 'Enemy of One'
  pause 1000
endif
if not buffexists 'Consecrate Weapon'
  cast 'Consecrate Weapon'
  pause 1000
endif
if not buffexists 'Divine Fury'
  cast 'Divine Fury'
  pause 1000
endif
if not buffexists 'Confidence'
  cast 'Confidence'
  pause 1000
endif

Re: Buff macro

Posted: January 21st, 2017, 9:44 pm
by Haswell
Madmarz you can optimize this code by using something like:

Code: Select all

if not buffexists 'enemy of one'
  clearjournal
  cast 'enemy of one'
  waitforjournal 'disturbed' 1000 'system'
endif
if not buffexists 'consecrate weapon'
  clearjournal
  cast 'consecrate weapon'
  waitforjournal 'disturbed' 1000 'system'
endif
...
that way it should timeout once you get disturbed instead of waiting for the whole 1s

Re: Buff macro

Posted: January 21st, 2017, 9:53 pm
by EnEffetGile
Haswell wrote:Madmarz you can optimize this code by using something like:

Code: Select all

if not buffexists 'enemy of one'
  clearjournal
  cast 'enemy of one'
  waitforjournal 'disturbed' 1000 'system'
endif
if not buffexists 'consecrate weapon'
  clearjournal
  cast 'consecrate weapon'
  waitforjournal 'disturbed' 1000 'system'
endif
...
that way it should timeout once you get disturbed instead of waiting for the whole 1s
Unless it was fixed and Im not sure it can be without a uosteam patch. 1 of the spell from paly does not register to uosteam as a buff. I believe it was consecrate..(Been a while...)

If I am right, each time uosteam will get to this part of the code:

Code: Select all

if not buffexists 'consecrate weapon'
  clearjournal
  cast 'consecrate weapon'
  waitforjournal 'disturbed' 1000 'system'
endif
It will cast consecrate weapon every time, regardless of it being active or not.


Edit: Also, if you loop that kind of buffing macro. You should be aware that there is no sunch thing as 'priority' without some sort of 'if' statement. The only priority of uosteam will be the line it is at.

Dont really feel like writting it all but I can use a little ctrl+c, ctrl+v concept.

if not buffexists 'enemy of one'
clearjournal
cast 'enemy of one'
waitforjournal 'disturbed' 1000 'system'
elseif not buffexists 'divine fury'
clearjournal
cast 'enemy of one'
waitforjournal 'disturbed' 1000 'system'
elseif
blahblah
endif

Now, that give you some sort of priority... Tho, it could be ebtter optimised.

In a show way to explain it. Without the 'elseif'. You could do 1 macro for each spells and be more efficient then a simple if/endif statement for each spells as the elseif actualy represent the order in which you would prefer to queue up those 3 macro.

Re: Buff macro

Posted: January 21st, 2017, 10:01 pm
by Haswell
It took a while for servers to add all buff icons and I don't know if Demise added all icons but you can add support for more buffs by editing the UOS/Data/bufficons.xml file, for example:

Code: Select all

	<icon id="1082" name="Consecrate Weapon"/>
	<icon id="1088" name="Curse Weapon"/>
I don't have the game installed here so I can't provide you more data.

In case you can't use a buff icon you could use a timer, sample:

Code: Select all

// Initialize the timer
if not timerexists 'consecrate weapon'
  @settimer 'consecrate weapon' 10000
endif
// Check if it has reached 10s
if @timer 'consecrate weapon' >= 10000
  clearjournal
  cast 'consecrate weapon'
  waitforjournal 'disturbed' 1000 'system'
  // Check if not disturbed and reset the timer
  if not @injournal 'disturbed' 'system'
     @settimer 'consecrate weapon' 0
  endif
endif
Regarding if blocks using elseif or not using... it all depends on your scenario, lets say you have a loop like:

Code: Select all

while not dead
  // ACTION 1
  // ACTION 2
  // CASTS HERE
endwhile
if you use elseif you won't be casting in sequence (if you wan't that it is ok)... you'll end up casting only one spell at a time and it will perform action 1 and action 2 before casting spells again. so it really depends on what you want, "performance" is not the case here trust me... UOS is fast enough to process this so "priority" depends on your entire context, using or not using could affect desired behavior.

Re: Buff macro

Posted: January 21st, 2017, 10:59 pm
by Madmarz
Ya elseif statements would be good in certain scenarios, but honestly like haswell said steam is fast enough it will cycle through if you happened to be out of mana or interrupted etc during a priority cast macro or sequence. You could ditch the loop check and go with replay

Code: Select all

if not buffexists 'Consecrate Weapon' and not buffexists 'Divine Fury'
clearjournal
  cast 'consecrate weapon'
  waitforjournal 'disturbed' 1000 'system'
replay
stop
elseif buffexists 'Consecrate Weapon' and not buffexists 'Divine Fury'
cast 'Divine Fury'
//etc
etc etc, and rather than run through a sequence it will cast based on current buff in a priority you choose, you could even throw in mana checks so it doesnt try and cast if your below X mana, something like

Code: Select all

If mana >= X //whatever mana needed to cast the next spell
if not buffexists 'Consecrate Weapon'
cast 'Consecrate Weapon'
endif
endif
//blah
endif
if mana >= //etc
and that could be used with elseif statements as well

Re: Buff macro

Posted: January 23rd, 2017, 6:12 pm
by The Silvertiger
I find that 'while not buffexists' works best.

Re: Buff macro

Posted: January 23rd, 2017, 8:25 pm
by Savitar
thank you everyone!

Re: Buff macro

Posted: November 24th, 2019, 1:34 am
by Savitar
Sorry to bother everyone but how would i go about making a macro that loops but doesnt cast if the spell is already up and ready to cast. this is what i have so far...

if not buffexists 'lightning strike'
cast 'lightning strike'
endif
___________________________________
this is what i want:

if not buffexists 'lightning strike'
cast 'lightning strike'
endif
if buffexists 'lightning strike'
dont cast 'lightning strike'

this way i can loop it and not continue to hit the hotkey over and over again