I want to get mine locations in a game the game uses php site and it updates the html dynamicaly based on user actions for example if i click a tile the game will send a post request to the html and the mine locations are only revealed when i cashout or clicked a mine so i want to get the mine locations of real time before i even click any tile tried using java and python but they dont extract the mine positions so we need to extract the mine locations tile id in the html and simulate click on the tiles to get the desired responce but the code should keep up with the game because after i win or lose again the html will change so please help me
I tried using this code but didnt work at all so i need to manilulate the html not the network request problem is the html changes dynamically
import requests
import time
def configure_game_params():
game_params = {
"access-token": "39fa080b862e50c48c11a5a5f5a8034f53e1f7d76fb9fa5c4675fed1f1f482450c",
"fp-userSeed": "SnuPVeYLOWKNACMDK12dyoEIooUuXm4iCLSwDprUta3FuRtHST74O3HRrz4qA0J7",
"gameAccess": "true",
"isClientSeedSet": "false", # Set to "true" or "false" as needed
"user-email": "[email protected]",
"mines_bet": "0.00074249", # Replace with your actual value
"color-scheme": "dark",
"selectedCurrency": "DGB",
}
return game_params
def construct_request_headers():
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer ae1ece19d806d9e6630429bac2cfb2f4a406b6ddc0a37af0856635880cb73d7e",
}
return headers
def make_api_request(url, payload, headers, retries=3):
for _ in range(retries):
try:
response = requests.post(url, json=payload, headers=headers)
if response.status_code == 200:
return response
elif response.status_code == 429:
print("Rate limit exceeded. Retrying after backoff.")
time.sleep(2 ** _)
else:
print(f"Error: {response.status_code} - {response.text}")
except requests.RequestException as e:
print(f"Error: {e}")
return None
Configure game parameters
game_params = configure_game_params()
Construct the request headers
headers = construct_request_headers()
Mock the “busted” status in the request payload
request_payload = {
"status": "BUSTED",
**game_params,
}
Make the API request with retries and backoff
response = make_api_request(“https://api.faucetpay.io/mines/sweep”, request_payload, headers)
Handle response
if response:
mine_locations = response.json().get("data", {}).get("mine_locations")
if mine_locations:
print("Mine locations:", mine_locations)
else:
print("No mine locations found.")
else:
print("Failed to retrieve mine locations.")
Njongo Magagula is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.