Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test new feature #1

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions Input-Output_NF.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import time


def covert_input():
input_error_check = True
while input_error_check == True:

input_lenght = str(input("Input how long you want to AFK (Hour,Minute)"))

list_lenght = input_lenght.split(",")

try:
hour_lenght = float(list_lenght[0])
min_lenght = float(list_lenght[1])
input_error_check = False
except:
print()
print("there an error")
print("make sure to input only the number")
print("and with Hour,Minute format")
print("for example 1,30 ")
print()

global apk_lenght
apk_lenght = ((hour_lenght * 3600) + (min_lenght * 60)) / 1.43
print(apk_lenght)
for i in range(int(apk_lenght)):
print("hello", i)
print(apk_lenght)


covert_input()


for i in range(int(apk_lenght)):
print(i)
print(apk_lenght)


def covert_sec():
afk_long = 120
convert_afk_long = time.strftime(
"%H hours %M minutes %S second", time.gmtime(afk_long)
)
print(convert_afk_long)


covert_sec()
99 changes: 99 additions & 0 deletions afk.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import pyautogui # to install type "pip3 install pyautogui" on your terminal
import random
import time
import json


def covert_input():
input_error_check = True
while input_error_check == True:

input_lenght = str(input("Input how long you want to AFK (Hour,Minute)"))

list_lenght = input_lenght.split(",")

try:
hour_lenght = float(list_lenght[0])
min_lenght = float(list_lenght[1])
input_error_check = False
except:
print()
print("there an error")
print("make sure to input only the number")
print("and with Hour,Minute format")
print("for example 1,30 ")
print()

global afk_times
afk_times = ((hour_lenght * 3600) + (min_lenght * 60)) / 1.43


def json_setting_open_file():
with open("setting.json", "r") as f:
data_json = json.load(f)

global first_x
global second_x

global first_y
global second_y

first_x = data_json["setting"]["x"][0]
second_x = data_json["setting"]["x"][1]

first_y = data_json["setting"]["y"][0]
second_y = data_json["setting"]["y"][1]


def radom_point():
global move
global right
global start
global end
start = time.perf_counter() # start of timer
right = 0
move = 0
for i in range(int(afk_times)):
move += 1
print("move", move)
# random x and the range is depend on your screen
x = random.randint(first_x, second_x)
# random y and the range is depend on your sreen
y = random.randint(first_y, second_y)
pyautogui.moveTo(x, y, 1) # move the cursor to the point by x and y

# random for the click 1 is click other is do nothing so it's 1/10
# we don't have the left click because it will be annoying or making the problem.
click = random.randint(1, 10)
if click == 1:
pyautogui.rightClick() # auto right click
print("click")
right += 1
print(move, right)
end = time.perf_counter()


def covert_sec():
# end of timer
# calculate time spent and convert from second to minute
afk_long = end - start
convert_afk_long = time.strftime(
"%H hours %M minutes %S second", time.gmtime(afk_long)
)
print(convert_afk_long)


def print_summry():
# print the over all summary
print()
print("DONE")
covert_sec()
print(
"move = ", move, "times," "right click = ", right, "times"
) # print how many time that move and click


covert_input()
json_setting_open_file()
radom_point()
print_summry()
43 changes: 0 additions & 43 deletions apk.py

This file was deleted.

53 changes: 53 additions & 0 deletions json-setting.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import json
import pyautogui
import random


def json_setting_open_file():
with open("setting.json", "r") as f:
data_json = json.load(f)

global first_x
global second_x

global first_y
global second_y

first_x = data_json["setting"]["x"][0]
second_x = data_json["setting"]["x"][1]

first_y = data_json["setting"]["y"][0]
second_y = data_json["setting"]["y"][1]

print(first_x) # for debug
print(second_x) # for debug
print(first_y) # for debug
print(second_y) # for debug


def radom_point():
global move
global right
right = 0
move = 0
for i in range(int(10)):
move += 1
print("move", move)
# random x and the range is depend on your screen
x = random.randint(first_x, second_x)
# random y and the range is depend on your sreen
y = random.randint(first_y, second_y)
pyautogui.moveTo(x, y, 1) # move the cursor to the point by x and y

# random for the click 1 is click other is do nothing so it's 1/10
# we don't have the left click because it will be annoying or making the problem.
click = random.randint(1, 10)
if click == 1:
pyautogui.rightClick() # auto right click
print("click")
right += 1
print(move, right)


json_setting_open_file()
radom_point()
6 changes: 6 additions & 0 deletions setting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"setting":{
"x":[0,1920],
"y":[0,1080]
}
}