asweigart / nicewin

A nicely-documented, pure-Python wrapper for the Windows API for Python 2 and 3.
GNU General Public License v3.0
137 stars 17 forks source link

Bot #3

Open Tanishq218 opened 1 week ago

Tanishq218 commented 1 week ago

I can provide a general outline of a script that could be used to automate farming in Utopia Origin, but please note that creating and using bots may be against the game's terms of service. It's essential to ensure that any automation complies with the game's rules to avoid penalties.

That being said, here's a simplified example of a script that could be used to automate rubber farming in Utopia Origin. This script is written in Python and uses the pyautogui library for GUI automation.

Please note that this script is for educational purposes only and should not be used without proper modifications and testing to ensure compliance with the game's terms of service.


import pyautogui
import time
import random

# Set the game window coordinates
game_window_x = 100
game_window_y = 100
game_window_width = 800
game_window_height = 600

# Set the coordinates of the rubber farm button
rubber_farm_button_x = 300
rubber_farm_button_y = 400

# Set the coordinates of the collect button
collect_button_x = 500
collect_button_y = 500

# Set the number of iterations
iterations = 10000 // 100  # assuming 100 rubber per iteration

try:
    for i in range(iterations):
        # Move to the game window
        pyautogui.moveTo(game_window_x, game_window_y)

        # Click the rubber farm button
        pyautogui.click(rubber_farm_button_x, rubber_farm_button_y)

        # Wait for the farm to complete
        time.sleep(60)  # adjust this value based on the farm duration

        # Move to the collect button
        pyautogui.moveTo(collect_button_x, collect_button_y)

        # Click the collect button
        pyautogui.click(collect_button_x, collect_button_y)

        # Wait for the collection to complete
        time.sleep(10)  # adjust this value based on the collection duration

        # Print the current iteration
        print(f"Iteration {i+1} completed")
Tanishq218 commented 1 week ago

import pyautogui import time import random

Set the game window coordinates

game_window_x = 100 game_window_y = 100 game_window_width = 800 game_window_height = 600

Set the coordinates of the rubber farm button

rubber_farm_button_x = 300 rubber_farm_button_y = 400

Set the coordinates of the collect button

collect_button_x = 500 collect_button_y = 500

Set the number of iterations

iterations = 10000 // 100 # assuming 100 rubber per iteration

try: for i in range(iterations):

Move to the game window

    pyautogui.moveTo(game_window_x, game_window_y)

    # Click the rubber farm button
    pyautogui.click(rubber_farm_button_x, rubber_farm_button_y)

    # Wait for the farm to complete
    time.sleep(60)  # adjust this value based on the farm duration

    # Move to the collect button
    pyautogui.moveTo(collect_button_x, collect_button_y)

    # Click the collect button
    pyautogui.click(collect_button_x, collect_button_y)

    # Wait for the collection to complete
    time.sleep(10)  # adjust this value based on the collection duration

    # Print the current iteration
    print(f"Iteration {i+1} completed")
Tanishq218 commented 1 week ago

import pyautogui import time import random

Set the game window coordinates

game_window_x = 100 game_window_y = 100 game_window_width = 800 game_window_height = 600

Set the coordinates of the rubber farm button

rubber_farm_button_x = 300 rubber_farm_button_y = 400

Set the coordinates of the collect button

collect_button_x = 500 collect_button_y = 500

Set the number of iterations

iterations = 10000 // 100 # assuming 100 rubber per iteration

try: for i in range(iterations):

Move to the game window

    pyautogui.moveTo(game_window_x, game_window_y)

    # Click the rubber farm button
    pyautogui.click(rubber_farm_button_x, rubber_farm_button_y)

    # Wait for the farm to complete
    time.sleep(60)  # adjust this value based on the farm duration

    # Move to the collect button
    pyautogui.moveTo(collect_button_x, collect_button_y)

    # Click the collect button
    pyautogui.click(collect_button_x, collect_button_y)

    # Wait for the collection to complete
    time.sleep(10)  # adjust this value based on the collection duration

    # Print the current iteration
    print(f"Iteration {i+1} completed")