Page 1 of 1

help "repeat syntax"

Posted: Wed Feb 08, 2012 11:38 am
by flashgump
hello all :)

I wonder if it would be possible to make a syntax that only repeated 3 times?

ex:

Code: Select all

<!-- # 12 --><waypoint x="1696" z="2891" y="433"  tag="Out1">  
		findzi()
			local zoneid = RoMScript("GetZoneID()")                                -------------------------|
				if zoneid == zid then                                                                        |---------------------> repeat this action just 3 times
                                 __WPL:setWaypointIndex(__WPL:findWaypointTag("Out1"))                   |
            end                                                             -----------------------------|
				ireset()                          -----------------------------------------------------------------|
				cprintf(cli.lightred, "  --=== !!! Portail FAIL - Leave party go OUT !!! ===--\n")                 |    
				waitForLoadingScreen(30)                                                                           |------> if loadingscreen didin't appear he do this action
				loadPaths("dodreturn");                           -------------------------------------------------|
				end
    </waypoint>
I do not know how this syntax and if it is realizable?
because occasionally the exit portal of the instance is not.

thanks for help

Re: help "repeat syntax"

Posted: Wed Feb 08, 2012 12:32 pm
by lisa

Code: Select all

local times = 0
reapeat
--some code here
times = times + 1
until times == 3


Re: help "repeat syntax"

Posted: Wed Feb 08, 2012 1:45 pm
by flashgump

Code: Select all

<!-- # 12 --><waypoint x="1696" z="2891" y="433"  tag="Out1"> 
       local times = 0
       reapeat
       findzi()
         local zoneid = RoMScript("GetZoneID()")                                
            if zoneid == zid then                                                                       
                __WPL:setWaypointIndex(__WPL:findWaypointTag("Out1"))  
            end  
            times = times + 1
            until times == 3           
           ireset()                         
           cprintf(cli.lightred, "  --=== !!! Portail FAIL - Leave party go OUT !!! ===--\n")                
           waitForLoadingScreen(30)                                                                         
           loadPaths("dodreturn");  
        end
    </waypoint>
like that?

Re: help "repeat syntax"

Posted: Wed Feb 08, 2012 5:04 pm
by flashgump

Code: Select all

<!-- # 12 --><waypoint x="1696" z="2891" y="433"  tag="Out1">
       local times = 0
       local zoneid = RoMScript("GetZoneID()") 
       repeat
       	findzi()                           
        	if zoneid == zid then
			__WPL:setWaypointIndex(__WPL:findWaypointTag("Out1"))		
              		times = times + 1
		elseif
			times = 3                                                   
        	end 
       until times == 3           
           ireset()                         
           cprintf(cli.lightred, "  --=== !!! Portail FAIL - Leave party go OUT !!! ===--\n")               
           waitForLoadingScreen(30)                                                                         
           loadPaths("dodreturn"); 
        end
    </waypoint>
like this is better :D i think

Re: help "repeat syntax"

Posted: Wed Feb 08, 2012 6:57 pm
by lisa
have you tried using the function
getZoneId()

Code: Select all

<!-- # 12 --><waypoint x="1696" z="2891" y="433"  tag="Out1">
       local times = 0
       repeat
          findzi()                           
           if getZoneId() == zid then
         __WPL:setWaypointIndex(__WPL:findWaypointTag("Out1"))      
                    times = times + 1
      elseif
         times = 3                                                   
           end 
       until times == 3           
           ireset()                         
           cprintf(cli.lightred, "  --=== !!! Portail FAIL - Leave party go OUT !!! ===--\n")               
           waitForLoadingScreen(30)                                                                         
           loadPaths("dodreturn"); 
        end
    </waypoint>

--=== Added ===--

Actually this usage is no good.
you add a times but then tell it to use the same waypoint again, so it will reset times to 0, so basically there is no point in the count as it will never actually count. You may aswell just use a true or false variable.