Results 1 to 5 of 5

Thread: Indentation problems,need help please!

  1. #1
    Junior Member
    Join Date
    Oct 2011
    Posts
    11

    Indentation problems,need help please!

    Hey guys so i'm kinda new to coding and i'm working on a bone bot atm. So here's my problem, in my kill function i want go for a while statement. Thing is it gonna tell me no while statement matching the Wend, while my Wend is onthe same column as the while statement.
    I've noticed that the red line onthe left in scyte(to know in wich function you're in or statement, where you can click on it to minimise function and regions)
    goes for the whole rest of the code when i stand in this kill fucntion and doesn't seem to recognise the endfunc either.
    So here's the code, if anyone has an idea i would be forever thankfull!!
    Code:
    Func Kill()
       Local $ProtectiveSpirit = GetEffect(GetSkillBarSkillID(1, 0))
       Local $ShieldingHands = GetEffect(GetSkillBarSkillID(3, 0))
       Local $ShieldOfAbsorption = GetEffect(GetSkillBarSkillID(4, 0))
       If GetIsDead(-2) Then Return
       Out("Killing stuff.")
       While GetNumberOfFoesInRangeOfAgent(-2,1000) > 1
    	  If GetSkillBarSkillRecharge(1) = 0 and GetEffectTimeRemaining($ProtectiveSpirit) < 1500 then
    		UseSkillEx(1, -2) EndIf ; Protective Spirit
          If GetSkillBarSkillRecharge(1) = 0 and GetEffectTimeRemaining($ProtectiveSpirit) < 1500 then
    		UseSkillEx(1, -2) EndIf ; Protective Spirit
    	  If GetSkillBarSkillRecharge(4) = 0 and GetEffectTimeRemaining($ShieldOfAbsorption) < 1500 then
    		UseSkillEx(4, -2) EndIf ; Shield of absorbtion
          If GetSkillBarSkillRecharge(3) = 0 and GetEffectTimeRemaining($ShieldingHands) < 2500 then
    		UseSkillEx(3, -2) ; Shielding hands
          If IsRecharged (2) Then
            UseSkillEx (2,-2) EndIf ;mystic regen
          If IsRecharged (5) Then ;shield of judgment
    	    UseSkillEx (5,-2) EndIf
          If IsRecharged (6) Then ;smite condi
    	  UseskillEx (6,-2) EndIf
    
          RndSleep(500)
       WEnd
       Out("undeads dead.") ;aha
       
    EndFunc
    Last edited by poum; 04-20-2016 at 05:50 PM.

  2. #2
    Senior Member the great gree's Avatar
    Join Date
    Feb 2014
    Location
    Georgia
    Posts
    168
    be better if you posted rest of code because it could be that u dont have an endFunc somewhere else

    if you dont want to post it and make it publicly seen u can message it to someone

    also missing endif here

    If GetSkillBarSkillRecharge(3) = 0 and GetEffectTimeRemaining($ShieldingHands) < 2500 then
    UseSkillEx(3, -2) ; Shielding hands
    Last edited by the great gree; 04-21-2016 at 01:59 AM.

  3. #3
    Junior Member
    Join Date
    Oct 2011
    Posts
    11
    Oh great Gee!
    The rest of the code is basically your bone elona bot aha
    Here it is
    Thanks for reply!!
    Attached Files Attached Files

  4. #4
    Senior Member
    Join Date
    Jun 2014
    Posts
    116
    Code:
    Func Kill()
       Local $ProtectiveSpirit = GetEffect(GetSkillBarSkillID(1, 0))
       Local $ShieldingHands = GetEffect(GetSkillBarSkillID(3, 0))
       Local $ShieldOfAbsorption = GetEffect(GetSkillBarSkillID(4, 0))
       If GetIsDead(-2) Then Return
       Out("Killing stuff.")
       While GetNumberOfFoesInRangeOfAgent(-2,1000) > 1
    	  If GetSkillBarSkillRecharge(1) = 0 and GetEffectTimeRemaining($ProtectiveSpirit) < 1500 then
    		 UseSkillEx(1, -2) 
    	  EndIf ; Protective Spirit
          If GetSkillBarSkillRecharge(1) = 0 and GetEffectTimeRemaining($ProtectiveSpirit) < 1500 then
    		 UseSkillEx(1, -2) 
    	  EndIf ; Protective Spirit
    	  If GetSkillBarSkillRecharge(4) = 0 and GetEffectTimeRemaining($ShieldOfAbsorption) < 1500 then
    		 UseSkillEx(4, -2) 
    	  EndIf ; Shield of absorbtion
          If GetSkillBarSkillRecharge(3) = 0 and GetEffectTimeRemaining($ShieldingHands) < 2500 then
    		 UseSkillEx(3, -2) 
    		 ; Shielding hands
          If IsRecharged (2) Then
    		 UseSkillEx (2,-2) 
    	  EndIf ;mystic regen
          If IsRecharged (5) Then 
    		 UseSkillEx (5,-2) 
    	  EndIf ;shield of judgment
          If IsRecharged (6) Then 
    		 UseskillEx (6,-2) 
    	  EndIf ;smite condi
    
          RndSleep(500)
       WEnd
       Out("undeads dead.") ;aha
       
    EndFunc
    If you let the EndIf have its own line, the missing EndIf pointed out by the great gree is pretty easy to spot.

  5. #5
    Junior Member
    Join Date
    Oct 2011
    Posts
    11
    Yeah i changed it in mine, but after uploading it.
    Kinda tested allkind of stuff to try to fix it up, random way since i don't really know what i'm doing^^
    So it's not really clean, but i added it back on mine.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •