#🔒 Project Bot DetectGames for Scum #Scum
10 messages · Page 1 of 1 (latest)
@arctic river
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
import discord
import psutil
import asyncio
Configurações
TOKEN = 'Token'
CHANNEL_ID = 'id_discord' # Coloque o ID do canal para onde você quer enviar o código
CODIGO_ATIVACAO = 'Ativation_code'
NOME_PROCESSE = "SCUM.exe" # Nome do processo do jogo
client = discord.Client()
async def monitor_game():
await client.wait_until_ready() # Aguarda até que o bot esteja pronto
channel = client.get_channel(int(CHANNEL_ID)) # Obtém o canal usando o ID
while not client.is_closed():
# Verifica se o processo do jogo está em execução
game_running = any(NOME_PROCESSE in p.name() for p in psutil.process_iter())
if game_running:
await channel.send(f'O jogo SCUM está em execução! Código de ativação: {CODIGO_ATIVACAO}')
# Espera até que o jogo não esteja mais ativo para não enviar várias mensagens
while game_running:
await asyncio.sleep(5) # Verifica a cada 5 segundos
game_running = any(NOME_PROCESSE in p.name() for p in psutil.process_iter())
else:
await asyncio.sleep(10) # Verifica a cada 10 segundos se voltar a estar em execução
@client.event
async def on_ready():
print(f'Bot conectado como {client.user}')
client.loop.create_task(monitor_game())
client.run(TOKEN)
Hey @arctic river!
It looks like you're trying to paste code into this channel.
Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.
To do this, use the following method:
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
You can **edit your original message** to correct your code block.
!rule 5
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
illegal?
It 100% violates Jagex ToS for the Scum game
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.
🔒 Project Bot DetectGames for Scum #Scum