ScriptUO

Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: The Ghost on October 29, 2015, 03:26:48 AM

Title: Clarifiaction with If #hits < ...
Post by: The Ghost on October 29, 2015, 03:26:48 AM
Was playing with a sub and  get an issue with this if statement.    Can someone explain what I'm not seeing.  


Code: [Select]
set %heal 10  ; Number to heal before to heal or
; set %heal ( #MAXHITS - 10 )  ; this one doesn't work ???

sub health_check
  if c in #charstatus
   {
 gosub scanbar
      if _poison_ in %icons . #charid
        gosub TM_NewCastSpell 24 self 1 10 10 ; Arch Cure
}
      set %icons . #charid _

if #hits < ( #maxhits - %heal )  < ---   this work if I enter a number.  
 ; if #hits < %heal  < ------------ this statement doesn't work
  {
     while #hits < #maxhits
      {
       gosub TM_NewCastSpell 28 self 1 10 10 ; G Heal
      }
    return
  }
return
Title: Re: Clarifiaction with If #hits < ...
Post by: addicted on October 29, 2015, 02:47:13 PM
Quote
Code: [Select]
set %heal (#MAXHITS - 10)  ; this one doesn't work ???

Code: [Select]
set %heal ( #MAXHITS - 10 )you need a space after/before the parentheses

Quote
Code: [Select]
if #hits < %heal  < ------------ this statement doesn't work
it works

my2c
Title: Re: Clarifiaction with If #hits < ...
Post by: The Ghost on October 29, 2015, 03:29:55 PM
The bracket space was just a miss typo here,  my bad.
Title: Re: Clarifiaction with If #hits < ...
Post by: Crome969 on October 30, 2015, 03:28:30 AM
Quote
Code: [Select]
set %heal (#MAXHITS - 10)  ; this one doesn't work ???

Code: [Select]
set %heal ( #MAXHITS - 10 )you need a space after/before the parentheses

Quote
Code: [Select]
if #hits < %heal  < ------------ this statement doesn't work
it works

my2c

If that is the case, the euo parser seems to be bad *giggles*