Jump to content

How to loop in Sikuli

everettrules

Random number is apparently like this:

import random
num = random.randrange(min,max)
// Instead of min and max, place the numbers you desire

And as for loops, it depends what kind of loop you are looking for. 'For'  or 'while'?

http://doc.sikuli.org/faq/000-can-i-do-xxx.html?highlight=loop

https://www.tutorialspoint.com/jython/jython_loops.htm

 

Although I would recommend you Google these sorts of things before making a forum topic. Searching for these types of things and trying out different pieces of code will only improve you as a programmer.

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to comment
Share on other sites

Link to post
Share on other sites

8 hours ago, Minibois said:

Random number is apparently like this:


import random
num = random.randrange(min,max)
// Instead of min and max, place the numbers you desire

And as for loops, it depends what kind of loop you are looking for. 'For'  or 'while'?

http://doc.sikuli.org/faq/000-can-i-do-xxx.html?highlight=loop

https://www.tutorialspoint.com/jython/jython_loops.htm

 

Although I would recommend you Google these sorts of things before making a forum topic. Searching for these types of things and trying out different pieces of code will only improve you as a programmer.

yeah, i tried a couple like the while var === 1 () {} or while var === 1:

But that didn't work.. i was thinking an infinite one.. thanks!

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×