ScriptUO

Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: The Ghost on October 18, 2013, 03:10:37 PM

Title: Reading #Hits with a Gargoyles
Post by: The Ghost on October 18, 2013, 03:10:37 PM
Ok  I have a snippet that I use to heal my mage (elves)  if the #hits go under number.  Now I just run the same snippet on my gargoyle and it won't stop casting heal on him self event it max heal.    Look like I miss to add something that will work on Gargoyles., anyone have a clue.   thx

Edits.   Look like the cast Heal over and over on my mage too. 

Here the main loop
Code: [Select]
Repeat
if #charName = N/A
   event macro 8 2
if #CHARSTATUS = CB    ; Poison Gargoyle
{
 gosub cure
}
if #hits < ( #maxhits - 30 )
(
gosub heal
 }
gosub Invis
until #CHARGHOST = yes
 }

sub heal
        {
       event macro 15 28
       target
       wait 20
       event macro 23 0
       set %spelltimer #scnt2 + %safety
       }
    wait 5
return

Title: Re: Reading #Hits with a Gargoyles
Post by: dxrom on October 18, 2013, 03:50:41 PM
Reading gargoyles is weird... I remember running into complications in regards to scanning them with various scripts and tools (Namely with AUO).

Something about it just doesn't want to work correctly.
Title: Re: Reading #Hits with a Gargoyles
Post by: manwinc on October 18, 2013, 03:54:20 PM
Bracket imbalance
You are bottoming out and jumping straight into the healing sub



Repeat
if #charName = N/A
   event macro 8 2
if #CHARSTATUS = CB    ; Poison Gargoyle
{
 gosub cure
}
if #hits < ( #maxhits - 30 )
( <-------- ( not a {
gosub heal
 }
gosub Invis
until #CHARGHOST = yes
 } <--- Where did this one come from?
Title: Re: Reading #Hits with a Gargoyles
Post by: dxrom on October 18, 2013, 05:08:32 PM
Just got around to reading the actual code... Manwinc pointed it out before I did xD

EDIT:

Cleaned it up a bit for you.

Code: [Select]
repeat
  if #charName = N/A
    event macro 8 2
  if #CHARSTATUS = CB    ; Poison Gargoyle
    gosub cure
  if #hits < ( #maxhits - 30 )
    gosub heal
  gosub Invis     ; This executes regardless for some reason, did you mean to have it execute conditionally?
  
  wait 1 ; Always a good idea to have wait's in main loops to prevent excess resources being eaten up.
until #CHARGHOST <> no

sub heal
  event macro 15 28
  target
  wait 20
  event macro 23 0
  set %spelltimer #scnt2 + %safety
  
  wait 5
return
Title: Re: Reading #Hits with a Gargoyles
Post by: The Ghost on October 18, 2013, 05:37:54 PM
Thx Man  
 
after reading the use of {}  i add them after each IF statement.  look like I use the wrong bracket.  thx to pointing my mistake.
and Thx for the clean up.   Guest I didn't needed of bracket after all.  


 gosub Invis     ; This executes regardless for some reason, did you mean to have it execute conditionally?
Code: [Select]
sub invisible
    Call ScanBuffBar
    if _Invisibility_ notin %BuffBarIconNames
       {
       event macro 15 43
       target
       wait 20
       event macro 23 0
       set %spelltimer #scnt2 + %safety
       }
    wait 10
return
Title: Re: Reading #Hits with a Gargoyles
Post by: manwinc on October 18, 2013, 05:48:23 PM
Yeah, for 1 Line IF Statements you don't need Brackets.