UOsteam script help

General discussion pertaining to the Demise shard. Off-topic posts will be moderated.
Post Reply
Jeller
Posts: 36

UOsteam script help

Post by Jeller »

So what I'm trying to do is cast lightning on the Dark Fathers in doom and add an if conditional like command to cast greater heal on myself if my hits drop to 50 or so. I have this is razor but with Google's help I still can't figure out how to create this in UOS. I don't have coding knowledge so it's been trial and error each round of doom trying to change things until it works. No luck.

This is what I'm trying to do:
cast "Lightning"
waitfortarget 3000
target! 'last'
if hits < 50
cast "Greater Heal"
waitfortarget 3000
target! 'self'
User avatar
The Silvertiger
Posts: 4469

Re: UOsteam script help

Post by The Silvertiger »

Are you not getting a journal msg: "unexpected if"? A better alternative to the whole greater heal phrase is:
if hits < 50
bigheal 'self'
pause 1000
endif

Also you need a recovery pause after target.
Never forget June 4th 1989!
Selling List & Vendor

"Screenshots will never be used as evidence but more of a reference tool for us to help in our investigations."
kentares and Jeller like this.
Top
damaxman
Posts: 3

Re: UOsteam script help

Post by damaxman »

Not that I'm very good with steam myself but maybe you could try an "if" command?

if hits < 50
cast 'greater heal'
target 'self'
elseif hits > 49
cast 'lightning'
targettype 'enemy' 'grey'
endif

Insert pauses where needed.
Jeller likes this.
Top
Jeller
Posts: 36

Re: UOsteam script help

Post by Jeller »

The Silvertiger wrote: December 16th, 2020, 3:23 am Are you not getting a journal msg: "unexpected if"? A better alternative to the whole greater heal phrase is:
if hits < 50
bigheal 'self'
pause 1000
endif

Also you need a recovery pause after target.
Yes I was constantly getting "an unexpected if occurred" or something like that. I'll give this a try and add that recovery pause at the end.

Thanks
flex
Posts: 42

Re: UOsteam script help

Post by flex »

Jeller wrote: December 16th, 2020, 5:53 pm
The Silvertiger wrote: December 16th, 2020, 3:23 am Are you not getting a journal msg: "unexpected if"? A better alternative to the whole greater heal phrase is:
if hits < 50
bigheal 'self'
pause 1000
endif

Also you need a recovery pause after target.
Yes I was constantly getting "an unexpected if occurred" or something like that. I'll give this a try and add that recovery pause at the end.

Thanks
Because your statement was missing an „endif“ at the End. But Silver is right about the pause though.
Jeller likes this.
Top
Vampire337
Posts: 47
Location: Cincinnati, Ohio

Re: UOsteam script help

Post by Vampire337 »

Jeller wrote: December 16th, 2020, 1:23 am So what I'm trying to do is cast lightning on the Dark Fathers in doom and add an if conditional like command to cast greater heal on myself if my hits drop to 50 or so. I have this is razor but with Google's help I still can't figure out how to create this in UOS. I don't have coding knowledge so it's been trial and error each round of doom trying to change things until it works. No luck.
I like to keep my targeting predictable, so I would use an alias here rather than the last target. Something like this:

Code: Select all

if not findalias 'Dark Father'
  promptalias 'Dark Father'
endif
while inrange 'Dark Father' 10
  if hits < 50
    bigheal 'self'
    while waitingfortarget
    endwhile
  else
    cast 'Lightning' 'Dark Father'
    while waitingfortarget
    endwhile
  endif
endwhile
@unsetalias 'Dark Father'
Using the while loop allows you to repeat until it dies without making the entire script loop. Note that we prioritize healing before attacking (because dying sucks), so health check is first in the if/else chain. Putting the target into the cast command means you don't need to add extra lines of code to wait for target and then target. Rather than a pause after each cast, you could move the pause to after the endif and before the endwhile, but as it's written here you could tweak it to maximize casting efficiency for each spell (trial and error is good here). The "while waitingfortarget" loop is added per later feedback; I tried it out and it seems to work for me without any additional pause, and anywhere you can avoid arbitrary waiting is optimal. Then after we're done with the looping (Dark Father is no longer in range, so either it died or we ran away for some reason), I like to clean up my aliases.

You could also expand this to incorporate mana checks, like so:

Code: Select all

if not findalias 'Dark Father'
  promptalias 'Dark Father'
endif
while inrange 'Dark Father' 10
  if hits < 50
    bigheal 'self'
    while waitingfortarget
    endwhile
  elseif mana < 60
    useskill 'Meditation'
    while mana < 80
      if hits < 50
        break
      endif
    endwhile
  else
    cast 'Lightning' 'Dark Father'
    while waitingfortarget
    endwhile
  endif
endwhile
@unsetalias 'Dark Father'
We first check health, most important. Then we check mana. If health is below our minimum, the mana check never happens. If we're low on mana, meditate and wait in a while loop until mana returns to an acceptable level, BUT if health starts to drop we want to break the mana while loop, so the main while loop will make us heal up.
Last edited by Vampire337 on January 1st, 2021, 3:39 am, edited 1 time in total.
Jeller
Posts: 36

Re: UOsteam script help

Post by Jeller »

Whoaaa thanks so much for taking the time to create that and explain it out to me. That helps a ton and makes a lot more sense now. I just learned some things I need to update in my current macros too.

Brilliant!
Ciro
Posts: 114

Re: UOsteam script help

Post by Ciro »

i'm just trying to understand what kind of character/template u are using...
Ciro#7619
Jeller
Posts: 36

Re: UOsteam script help

Post by Jeller »

Ciro wrote: December 19th, 2020, 5:34 am i'm just trying to understand what kind of character/template u are using...
Mage Tamer w/ eval intel and as much SDI as I can get.
Ciro
Posts: 114

Re: UOsteam script help

Post by Ciro »

Jeller wrote: December 19th, 2020, 6:37 am
Ciro wrote: December 19th, 2020, 5:34 am i'm just trying to understand what kind of character/template u are using...
Mage Tamer w/ eval intel and as much SDI as I can get.
ok! I miss read what you posted! i read 'use lighting strike and g heal' hahhaa now it makes sensse. i'm sorry!
Ciro#7619
Vampire337, Jeller and Bama like this.
Top
Haswell
Posts: 44

Re: UOsteam script help

Post by Haswell »

Vampire337 wrote: December 17th, 2020, 7:37 pm
Jeller wrote: December 16th, 2020, 1:23 am So what I'm trying to do is cast lightning on the Dark Fathers in doom and add an if conditional like command to cast greater heal on myself if my hits drop to 50 or so. I have this is razor but with Google's help I still can't figure out how to create this in UOS. I don't have coding knowledge so it's been trial and error each round of doom trying to change things until it works. No luck.
I like to keep my targeting predictable, so I would use an alias here rather than the last target. Something like this:

Code: Select all

if not findalias 'Dark Father'
  promptalias 'Dark Father'
endif
while inrange 'Dark Father' 10
  if hits < 50
    bigheal 'self'
    pause 2000
  else
    cast 'Lightning' 'Dark Father'
    pause 2000
  endif
endwhile
@clearalias 'Dark Father'
Using the while loop allows you to repeat until it dies without making the entire script loop. Note that we prioritize healing before attacking (because dying sucks), so health check is first in the if/else chain. Putting the target into the cast command means you don't need to add extra lines of code to wait for target and then target. Rather than a pause after each cast, you could move the pause to after the endif and before the endwhile, but as it's written here you could tweak it to maximize casting efficiency for each spell (trial and error is good here). Then after we're done with the looping (Dark Father is no longer in range, so either it died or we ran away for some reason), I like to clean up my aliases.

You could also expand this to incorporate mana checks, like so:

Code: Select all

if not findalias 'Dark Father'
  promptalias 'Dark Father'
endif
while inrange 'Dark Father' 10
  if hits < 50
    bigheal 'self'
    pause 2000
  elseif mana < 60
    useskill 'Meditation'
    while mana < 80
      if hits < 50
        break
      endif
    endwhile
  else
    cast 'Lightning' 'Dark Father'
    pause 2000
  endif
endwhile
@clearalias 'Dark Father'
We first check health, most important. Then we check mana. If health is below our minimum, the mana check never happens. If we're low on mana, meditate and wait in a while loop until mana returns to an acceptable level, BUT if health starts to drop we want to break the mana while loop, so the main while loop will make us heal up.
When using the "managed cast" you should check against the "waitingfortarget" command, for example:

Code: Select all

bigheal 'self'
while waitingfortarget
endwhile
Any cast related command - or shortcut, such as bigheal, chivalryheal, etc. - is considered "managed" once you pass a target as an argument.

Code: Select all

cast 'lightning' 'enemy'
while waitingfortarget
endwhile
This is going to perform better than using a pause, because it checks for interruptions/disturbs. If a pause is necessary, for some reason, you can add a smaller one after that while statement.
kentares and Vampire337 like this.
Top
Vampire337
Posts: 47
Location: Cincinnati, Ohio

Re: UOsteam script help

Post by Vampire337 »

Thanks for the pointers, Haswell. I updated my post accordingly, after testing and finding that it does work as you say, and no additional pause was necessary in my case.

Also in testing I found that my use of "@clearalias" is not appropriate, and instead should be "@unsetalias". The downside of writing scripts in a forum instead of in UOS. I updated that as well.
Post Reply