Sikuli farming (gaming) code random and undetectable

Asked by Meadows on 2018-10-13

Hey all,

I am a beginner to sikuli/coding and was looking for some help with my farming script for a mobile app.

I recently got banned for a couple days from a mobile app game I play for using auto programs.

I am looking to make the clicking, while following the script, random to hopefully avoid detection.

Here's an overview of the script:
1. Start battle
2. Look for 2 images (win or fail)
3a. If win, click sell resource or accept resource (2 different options depending on the resource)
3b. If lose, click "no" to end battle
4. At end of battle click restart script and do it all over again
5. Every so often you must refresh energy using resources. If prompted, refresh energy.

Between all events through the process of 1 round, I have wait times to allow everything to load and it has images to click on as they appear. Is it possible to make the wait times random (between 3-20 seconds) and make the click within that screen random (not on center every time).

I appreciate any help/advise. I can post my script if necessary to see more detail.

Thanks!

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2018-10-16
Last reply:
2018-10-16
Manfred Hampl (m-hampl) said : #1

For clicking on a random spot in a picture see e.g. comment #2 in https://answers.launchpad.net/sikuli/+question/665546

Waiting with a randomly distributed time span can be achieved in a similar way.

Remark: We do not endorse (mis-)suing Sikuli for gaining benefits in games in an unfair way.

Meadows (meowdows) said : #2

I attempted to have 1 line in a new document to test how this works and got an error. As mentioned, I don't know a lot with coding so am probably doing this wrong.

Any suggestions?

I wrote:

i = 'start image on bottom left of windows 10'
click(Location(random.randint(i.getX(),i.getX()+i.getW()),random.randint(i.getY(),i.getY()+i.getH())))

Error:

NameError: name 'random' is not defined.

Also, any idea on programming a random wait time?

wait(3) is what I have now

Manfred Hampl (m-hampl) said : #3

You have to load the "random" routines by adding the line
import random
at the beginning of your script.

You probably have to use something like
wait(random.uniform(3, 6))
for waiting some unpredictable time between 3 and 6 seconds.

Please see https://docs.python.org/2/library/random.html for details about the available functions.

Can you help with this problem?

Provide an answer of your own, or ask Meadows for more information if necessary.

To post a message you must log in.