UOGamers Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • To obtain new Razor updates, please reinstall Razor from our new website.

Need help with UOS hell hound vet > Solved <

alex916

Sorceror
so I'm trying to figure out how to make a script macro so that with 1 button press will figure out which hell hound has the lowest health and attempt to vet it but I'm stuck on how to compare hp beyond more than 2 targets such as

bandaids blah blah blah
if diffhits 'pet1' > diffhits 'pet2'
autotargetobject 'pet1'
else
autotargetobject 'pet2'
endif

how do i expand this into 5 targets? or is there a better way to do this?
 

MB

Knight
Assign an alias to the lower health pet and use it in the check for the third and so on. Heal winning alias at the end
 

alex916

Sorceror
thanks for the reply, so this is what i came up with, is there anyway i can improve upon this?

//Setup
if not findalias 'dog1'
headmsg 'Select first pet'
promptalias 'dog1'
pause 300
endif
if not findalias 'dog2'
headmsg 'Select second pet'
promptalias 'dog2'
pause 300
endif
if not findalias 'dog3'
headmsg 'Select second pet'
promptalias 'dog3'
pause 300
endif
if not findalias 'dog4'
headmsg 'Select second pet'
promptalias 'dog4'
pause 300
endif
if not findalias 'dog5'
headmsg 'Select second pet'
promptalias 'dog5'
pause 300
endif
if not findalias 'bandages'
headmsg 'Select bandages'
promptalias 'bandages'
endif
//Heal the lowest HP pet
if @findobject 'bandages'
useobject 'found'
endif
if diffhits 'dog1' >= diffhits 'dog2'
@setalias 'dog-low' 'dog1'
else
@setalias 'dog-low' 'dog2'
endif
if diffhits 'dog-low' >= diffhits 'dog3'
pause 1
else
@setalias 'dog-low' 'dog3'
endif
if diffhits 'dog-low' >= diffhits 'dog4'
pause 1
else
@setalias 'dog-low' 'dog4'
endif
if diffhits 'dog-low' >= diffhits 'dog5'
autotargetobject 'dog-low'
else
autotargetobject 'dog5'
endif
@unsetalias 'dog-low'

i know this doesnt cover the scenario in which a dog is poisoned but has yet to take damage and all other dogs are full hp, not sure how i would fix that though
 
Last edited:

MB

Knight
I would usetype for the bandages and hardcode all the dog aliases at the top.

@setalias 'dog1' 0xfffff


if diffhits 'dog-low' >= diffhits 'dog3'
pause 1
else
@setalias 'dog-low' 'dog3'
endif

Could be shortened to

if diffhits 'dog3' >= diffhits 'dog-low'
@setalias 'dog-low' 'dog3'
endif
 

MB

Knight
i know this doesnt cover the scenario in which a dog is poisoned but has yet to take damage and all other dogs are full hp, not sure how i would fix that though

If diffhits 'dog-low' > 10
autotargetobject 'dog-low'
elseif poisoned 'dog1'
autotargetobject 'dog1'
elseif...
 

alex916

Sorceror
So this is what i ended up coming up with, thoughts? further improvements?

//Vet Macro designed for 5 pets
//Setup: edit zz yy xx ww vv to Your specific 5 pets IDs
if not findalias 'dog1'
@setalias 'dog1' zz
endif
if not findalias 'dog2'
@setalias 'dog2' yy
endif
if not findalias 'dog3'
@setalias 'dog3' xx
endif
if not findalias 'dog4'
@setalias 'dog4' ww
endif
if not findalias 'dog5'
@setalias 'dog5' vv
endif
if not findalias 'bandages'
headmsg 'Select bandages'
promptalias 'bandages'
endif
//Clear Timer for finished vet
if timerexists 'vet-timer'
if @injournal 'finish' 'system'
removetimer 'vet-timer'
@clearjournal
endif
elseif timerexists 'vet-timer'
if @injournal 'You have cured the target of all poisons!' 'system'
removetimer 'vet-timer'
@clearjournal
endif
endif
//Timer Check to stop overwriting vet attempts
if timerexists 'vet-timer'
stop
endif
//Heal the lowest HP pet or cure an undamaged pet
if @findobject 'bandages'
if not timerexists 'vet-timer'
if diffhits 'dog1' >= diffhits 'dog2'
@setalias 'dog-low' 'dog1'
else
@setalias 'dog-low' 'dog2'
endif
if diffhits 'dog3' >= diffhits 'dog-low'
@setalias 'dog-low' 'dog3'
endif
if diffhits 'dog4' >= diffhits 'dog-low'
@setalias 'dog-low' 'dog4'
endif
if diffhits 'dog5' >= diffhits 'dog-low'
@setalias 'dog-low' 'dog5'
endif
if diffhits 'dog-low' > 5
@cleartargetqueue
useobject 'found'
autotargetobject! 'dog-low'
createtimer 'vet-timer'
elseif poisoned 'dog1'
@cleartargetqueue
useobject 'found'
autotargetobject 'dog1'
createtimer 'vet-timer'
elseif poisoned 'dog2'
@cleartargetqueue
useobject 'found'
autotargetobject 'dog2'
createtimer 'vet-timer'
elseif poisoned 'dog3'
@cleartargetqueue
useobject 'found'
autotargetobject 'dog3'
createtimer 'vet-timer'
elseif poisoned 'dog4'
@cleartargetqueue
useobject 'found'
autotargetobject 'dog4'
createtimer 'vet-timer'
elseif poisoned 'dog5'
@cleartargetqueue
useobject 'found'
autotargetobject 'dog5'
createtimer 'vet-timer'
endif
endif
endif
//Clear Misc.
@unsetalias 'dog-low'
@cleartargetqueue
 
Last edited:

MB

Knight
//Vet Macro designed for 5 pets
//Setup: edit zz yy xx ww vv to Your specific 5 pets
@setalias 'dog1' zz
@setalias 'dog2' yy
@setalias 'dog3' xx
@setalias 'dog4' ww
@setalias 'dog5' vv
If not timerexists 'vet-timer'
createtimer 'vet-timer'
endif
if timer 'vet-timer' < 10000 //upper limit bandage time
if @injournal 'finish' 'system' or @injournal 'you have cured' 'system'
settimer 'vet-timer' 11000
@clearjournal
else @ifinjournal 'no damage' //or whatever it is
settimer 'vet-timer' 11000
@clearjournal
endif
else
//Heal the lowest HP pet or cure an undamaged pet
if diffhits 'dog1' > diffhits 'dog2'
@setalias 'dog-low' 'dog1'
else
@setalias 'dog-low' 'dog2'
endif
if diffhits 'dog3' > diffhits 'dog-low'
@setalias 'dog-low' 'dog3'
endif
if diffhits 'dog4' > diffhits 'dog-low'
@setalias 'dog-low' 'dog4'
endif
if diffhits 'dog5' > diffhits 'dog-low'
@setalias 'dog-low' 'dog5'
endif
usetype! bandage
@cleartargetqueue
if diffhits 'dog-low' > 5
autotargetobject! 'dog-low'
elseif poisoned 'dog1'
autotargetobject! 'dog1'
elseif poisoned 'dog2'
autotargetobject 'dog2'
elseif poisoned 'dog3'
autotargetobject 'dog3'
elseif poisoned 'dog4'
autotargetobject 'dog4'
createtimer 'vet-timer'
elseif poisoned 'dog5'
autotargetobject 'dog5'
else
autotargetobject 'low-dog'
endif
if @injournal 'begin bandaging'
settimer 'vet-timer' 0
endif
endif
 

alex916

Sorceror
thanks for all your help i really appreciate it, so this is what i ended up with after a few minor improvements

//Vet Macro designed for 5 pets
//Setup: edit zz yy xx ww vv to Your specific 5 pets
@setalias 'dog1' zz
@setalias 'dog2' yy
@setalias 'dog3' xx
@setalias 'dog4' ww
@setalias 'dog5' vv
If not timerexists 'vet-timer'
createtimer 'vet-timer'
endif
//Clear Timer for finished vet
if timer 'vet-timer' <= 10000
if @injournal 'finish' 'system' or @injournal 'you have cured' 'system' or @injournal 'not damaged' 'system' or @injournal 'too far away' 'system' or @injournal 'stay close enough' 'system' or@injournal 'little damage' 'system'//or whatever it is
settimer 'vet-timer' 11000
@clearjournal
endif
else
//Heal the lowest HP pet or cure an undamaged pet
if diffhits 'dog1' >= diffhits 'dog2'
@setalias 'dog-low' 'dog1'
else
@setalias 'dog-low' 'dog2'
endif
if diffhits 'dog3' >= diffhits 'dog-low'
@setalias 'dog-low' 'dog3'
endif
if diffhits 'dog4' >= diffhits 'dog-low'
@setalias 'dog-low' 'dog4'
endif
if diffhits 'dog5' >= diffhits 'dog-low'
@setalias 'dog-low' 'dog5'
endif
if diffhits 'dog-low' > 5
usetype 0xe21 'any' 'backpack'
autotargetobject! 'dog-low'
elseif poisoned 'dog1'
usetype 0xe21 'any' 'backpack'
autotargetobject! 'dog1'
elseif poisoned 'dog2'
usetype 0xe21 'any' 'backpack'
autotargetobject! 'dog2'
elseif poisoned 'dog3'
usetype 0xe21 'any' 'backpack'
autotargetobject! 'dog3'
elseif poisoned 'dog4'
usetype 0xe21 'any' 'backpack'
autotargetobject! 'dog4'
elseif poisoned 'dog5'
usetype 0xe21 'any' 'backpack'
autotargetobject! 'dog5'
elseif diffhits 'dog-low' > 0
usetype 0xe21 'any' 'backpack'
autotargetobject! 'dog-low'
endif
if @injournal 'begin bandaging'
settimer 'vet-timer' 0
endif




1)the clear journal line now checks for all possible outcomes of the vet attempt
2) i improved upon my previous iteration so that the script again Onlt attempts to use a bandage if a pet is damaged or poisoned, it longer attempts to bandage a dog as an else case, this has the benefit of producing no system messages unless a vet attempt happens thus cleaning up the screen
 
Last edited:

MB

Knight
if @injournal 'finish' 'system' or @injournal 'you have cured' 'system' or @injournal 'not damaged' 'system' or @injournal 'too far away' 'system' or @injournal 'stay close enough' 'system' or@injournal 'little damage'

You can only do two statements on a line with or/and separators
 
Last edited:

alex916

Sorceror
if timer 'vet-timer' <= 10000
if @injournal 'finish' 'system' or @injournal 'you have cured' 'system'
settimer 'vet-timer' 11000
@clearjournal
elseif @injournal 'not damaged' 'system' or @injournal 'too far away' 'system'
settimer 'vet-timer' 11000
@clearjournal
elseif @injournal 'stay close enough' 'system' or @injournal 'little damage' 'system'
settimer 'vet-timer' 11000
@clearjournal
endif
else

is there a way to condense this section?
 
Last edited:

alex916

Sorceror
Ah true OK i wont worry about it then and again thanks for all of your help i really appreciate it!
 
Top