ScriptUO
Official ScriptUO EasyUO Scripts => Scripting Tutorials => Topic started by: chasemac140 on September 27, 2018, 06:46:49 AM
-
So this is my first working script. I am working to alter another to use this script with target and attack subs so you can just destroy w/e mobs you would like :)
;===================================
;=====Chase's Auto Mage Heals=============================================
;=========================================================================
;=========================================================================
; Script Name: Auto Mage Heals
; Author: Chase
; Version: 1.0
; Shard: OSI
; Revision Date: September 2018
; Purpose: To quickly heal and cure
; This is my first scrip, I am just playing with stuff at the moment.
; Its super simple but if there's a better way to do this please tell me.
;=========================================================================
Mainloop
repeat
if C in #charStatus
gosub cure
if #hits < #maxhits
gosub heal
;=========Cure Sub==================
Sub cure
event macro 15 10
wait 30
event macro 23 0
wait 10
return
;=========Heal Sub==================
Sub heal
event macro 15 3
wait 12
event macro 23 0
wait 5
return
-
Few issues with your script.
You have Repeat but you do not tell it what to repeat and until when. You need to always have Repeat with an Until statement.
Second issue is you will run out of bandages REALLY fast. You have no way of telling it to wait until it has attempted the full heal or cure. So it will spam your bandages. You need to have it either read your journal or set up the timing so that after it uses the bandages it waits a bit to try another one.
-
Few issues with your script.
You have Repeat but you do not tell it what to repeat and until when. You need to always have Repeat with an Until statement.
Second issue is you will run out of bandages REALLY fast. You have no way of telling it to wait until it has attempted the full heal or cure. So it will spam your bandages. You need to have it either read your journal or set up the timing so that after it uses the bandages it waits a bit to try another one.
This is using magery to heal, not bandages. Definitely agree with having a Until Statement though
I'm also not sure what "Mainloop" is doing there. It's one quirk with EUO that I'm not really a huge fan of... you can pretty much put gibberish in spots and it just moves on like nothing happened.
-
Sorry was a quick read and am at work. You are correct Trigs :).
-
-
-
;
if C in #charStatus
gosub cure
if #hits < #maxhits
gosub heal
repeat until #CharGhost = Yes
a repeat condition like this?
also, how do I make it target a mob? I think the mob type is TH (Artic Ogre Lord)
-
The stuff to repeat goes between the repeat and until
repeat
if C in #charStatus
gosub cure
if #hits < #maxhits
gosub heal
until #CharGhost = Yes
-
ahh ok, changing it.
changes in the new one.
-
So lets say I want to use this to heal one of my other guys on a different account. So this guy just sits back and heals him while the other guy beats on something.
How do I pull the second character as the target?
Is there a way to make the script look for a name?
Can I also make this target mobs in a similar manner?
-
So lets say I want to use this to heal one of my other guys on a different account. So this guy just sits back and heals him while the other guy beats on something.
How do I pull the second character as the target?
Is there a way to make the script look for a name?
Can I also make this target mobs in a similar manner?
A quick / dirty implementation of healing a second person would be like:
set %otherChar SOME_ID
<mainloop same as before>
sub heal
set #LTARGETID %otherChar
event macro 15 3
wait 12
event macro 22 0 ; target last target
wait 5
return
<similar for cure>
Attacking is a little different, but similar to the above.
set #LTARGETID %monsterID
event macro 27 0 ;; attack last target
I don't think there is a built in way to find chars by name, but I think some combination of:
set %humanType IS ;; theres some other types too
finditem %humanType G_6 ;; search all around you with in 6 tiles
for %ind 1 #FINDINDEX
event property #FINDID
if Trigs in #PROPERTY
set %otherChar #FINDID
I haven't tested it, or even tried it but that should give you some ideas to get started on both fronts.
-
ok, that gets me going in the right direction! Thanks so much