# Could someone guide me with URScript Looping?

**URL:** https://forum.universal-robots.com/t/could-someone-guide-me-with-urscript-looping/33702
**Category:** URScript
**Created:** [April 15, 2024, 6:32am UTC](https://forum.universal-robots.com/t/could-someone-guide-me-with-urscript-looping/33702 "2024-04-15T06:32:58Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![gicelay672](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/gicelay672/32/6024_2.png) [@gicelay672](https://forum.universal-robots.com/u/gicelay672)
#### Post date: [April 15, 2024, 6:32am UTC](https://forum.universal-robots.com/t/could-someone-guide-me-with-urscript-looping/33702/1 "2024-04-15T06:32:58Z")

</div>

Hello there,

As I am working on a project with a Universal Robots robot and I’m facing some challenges with URScript looping. Specifically, I’m trying to implement a loop that repeats a series of movements, but I’m encountering issues with the syntax and logic.

This is what I am trying to achieve:  
while(condition):  
# Perform some movements  
movej(pose1, a=1.0, v=0.1)  
movej(pose2, a=1.0, v=0.1)  
end

However, I’m unsure about the correct way to structure the loop and handle the conditions. Can someone provide guidance or an example of how to correctly implement this in URScript?

Also I have taken help from this: [https://forum.universal-robots.com/t/loop-according-to-variable/17653](https://forum.universal-robots.com/t/loop-according-to-variable/17653)[aws](https://www.igmguru.com/cloud-computing/aws-devops-training/) which definitely help me out a lot.

Any help or advice would be greatly appreciated.

Thank you in advance for your kind assistance.

---

<div class="post-metadata">

### Author: ![Robpod](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/robpod/32/5837_2.png) [@Robpod](https://forum.universal-robots.com/u/Robpod)
#### Post date: [April 16, 2024, 5:53pm UTC](https://forum.universal-robots.com/t/could-someone-guide-me-with-urscript-looping/33702/2 "2024-04-16T17:53:13Z")

</div>

Hi @gicelay672,  
here a couple of examples with loop condition in URscript:

![2024-04-16 19-48-26](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/c/c2e5ff332cb02c49944a2a21ecd59f21eee315c6.gif)
