![]() |
BREAK; CONTINUE; - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: BREAK; CONTINUE; (/Thread-BREAK-CONTINUE) |
BREAK; CONTINUE; - Skul - 08-08-2014 06:12 AM Just wondering about this new feature. I'm wondering if there is a DELAY we can input> Example: Code: forinstances c_man RE: BREAK; CONTINUE; - darksun84 - 08-08-2014 06:59 AM Break and continue are not used "for stopping and/or restarting" a loop. Break allows you to "terminate" a loop, when the script execution will reach a break statement, Sphere will "jump out" from the current loop. Continue instead allows you to "skip" the current iteration of the loop and "jump" to the next loop iteration. RE: BREAK; CONTINUE; - XuN - 08-08-2014 07:34 AM As dark said break and continue are not meant for that, however you can easily do it with something like this: Code: local.delay=<serv.time>+10 RE: BREAK; CONTINUE; - Skul - 08-08-2014 10:59 AM oh, I see, my misunderstanding. Thanks for the info. RE: BREAK; CONTINUE; - kn4tseb - 08-10-2014 01:30 PM i tried looking info about "break" and "continue" at wiki, couldnt find it... what are they? RE: BREAK; CONTINUE; - XuN - 08-10-2014 04:56 PM Here you have an example using continue when there's no reference related to the specified layer, as you can see the for will go to the next loop. (Be sure you have some clothes or armor equiped before using it) Code: [function f_test1] Here you have the same example but using break instead of continue, I think you'll see the differences if you test both. Code: [function f_test2] The break will stop permanently the loop and continue with the rest of the script. RE: BREAK; CONTINUE; - kn4tseb - 08-11-2014 04:26 AM Got it, ty very much |