Jump to content

Welcome to Gaming On Steroids Forums
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account
Photo

Targeting Allies for Heal


  • Please log in to reply
1 reply to this topic

#1
hyyerrkid

hyyerrkid

    Member

  • Members
  • 10 posts

Having issues with a function in a soraka script of mine, it is supposed to handle healing with w and r

 

However, it is having issues with the way I have the checks for ally health. Can anybody help me get this working?

function Heal()
  local needHeal = 0
    for _, hero in pairs(GetAllyHeroes()) do
      if hero ~= myHero and ValidTarget(hero, Spells.W.range) and (GetCurrentHP(hero)/GetMaxHP(hero)) >= 0.8 and (GetCurrentMana(myHero)/GetMaxMana(myHero)) >= (Menu.Heal.Mana:Value()/100) then
        castTargetSpell(hero, _W)
      end
      if hero and (Menu.Heal.RHP:Value()/100) >= (GetCurrentHP(hero)/GetMaxHP(hero)) then
        needHeal = (needHeal + 1)
        if hero == myHero and Menu.Heal.RSelf:Value() then
          castR()
        end
      end
    end
    if needHeal >= Menu.Heal.RCount:Value() then
      castR()
    end
end

Edited by hyyerrkid, 05 February 2018 - 07:10 .

  • 0

#2
hyyerrkid

hyyerrkid

    Member

  • Members
  • 10 posts
function Heal()
	local needHeal = 0
	for _, hero in pairs(GetAllyHeroes()) do
		if Menu.Heal.AutoW:Value() and (GetCurrentMana(myHero)/GetMaxMana(myHero)) >= (Menu.Heal.Mana:Value()/100)  then
			if Ready(_W) and hero ~= myHero and ValidTarget(hero, 550) and (GetCurrentHP(hero)/GetMaxHP(hero)) <= 0.8 then
				castTargetSpell(hero, _W)
			end
		end
		if hero and (Menu.Heal.RHP:Value()/100) >= (GetCurrentHP(hero)/GetMaxHP(hero)) then
			needHeal = (needHeal + 1)
			if hero == myHero and Menu.Heal.RSelf:Value() and Ready(_R) then
				castR()
			elseif Ready(_R) and (GetCurrentHP(myHero)/GetMaxHP(myHero)) <= (Menu.Heal.RHP:Value()/100) and Menu.Heal.RSelf:Value() then
				castR()
			end
		end
		if needHeal >= Menu.Heal.RCount:Value() and Ready(_R) then
			castR()
		end
	end
end

  • 0




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users