Author Topic: Clarifiaction with If #hits < ...  (Read 3336 times)

0 Members and 1 Guest are viewing this topic.

Offline The GhostTopic starter

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Clarifiaction with If #hits < ...
« on: October 29, 2015, 03:26:48 AM »
0
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
« Last Edit: October 29, 2015, 03:29:06 PM by The Ghost »

Offline addicted

  • Jr. Member
  • **
  • Posts: 19
  • Activity:
    0%
  • Reputation Power: 1
  • addicted has no influence.
  • Respect: +3
  • Referrals: 1
    • View Profile
Re: Clarifiaction with If #hits < ...
« Reply #1 on: October 29, 2015, 02:47:13 PM »
0
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

Offline The GhostTopic starter

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Clarifiaction with If #hits < ...
« Reply #2 on: October 29, 2015, 03:29:55 PM »
0
The bracket space was just a miss typo here,  my bad.

Offline Crome969

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: Clarifiaction with If #hits < ...
« Reply #3 on: October 30, 2015, 03:28:30 AM »
0
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*

Tags: