# Question about Using tool\_contact function in URScript

**URL:** <https://forum.universal-robots.com/t/question-about-using-tool-contact-function-in-urscript/20308>\
**Category:** URScript\
**Created:** [April 1, 2022, 6:12pm UTC](https://forum.universal-robots.com/t/question-about-using-tool-contact-function-in-urscript/20308 "2022-04-01T18:12:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon87886619](https://avatars.discourse-cdn.com/v4/letter/a/34f0e0/32.png) [@anon87886619](https://forum.universal-robots.com/u/anon87886619)\
**Post date:** [April 1, 2022, 6:12pm UTC](https://forum.universal-robots.com/t/question-about-using-tool-contact-function-in-urscript/20308/1 "2022-04-01T18:12:21Z")

</div>

Hello,

 ![Screenshot (13)](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/e/ecf0e0ffc4e7f001675d121cc53da90cfff883d2.png)

I am interested in getting some guidance and clarification on an example made in the scripting manual for the tool contact function option.

I have attached a screenshot of the example. I’m not entirely sure how to use this function, but I was planning on setting a variable equal to this function and adding in a direction in the argument of the function.

example : make\_contact = tool\_contact(direction[1,0,0,0,0,0])  
My understanding is that when you run this command it will seek contact in the x direction relative to the robot base. But does it keep seeking contact with something until it is found? Or do I need to somehow add in a command to have it keep moving in the x direction until contact is detected?

The example 14.1.49 in the manual makes it seem like I should add this command but I’m not entirely sure. I would also like some clarification on the part of the example where it says “while True:” While what is true?

Thank you.
