-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathshoutout.py
53 lines (40 loc) · 1.64 KB
/
shoutout.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from discord_webhook import DiscordWebhook # pip install discord-webhook
import time
from py_stealth import *
hookurl = 'https://discord.com/api/webhooks/783722507420041216' \
'/R5Tx8akek9nZebXv2isGqDWK60087lrgzUJ№№№№№№№№###'
# friends = ["Gitana", "Omar"] # если по никам
friends = [0x123456, 0x234567]
shouttime = 60
idtimers = {}
SetFindDistance(30)
def get_character_location(nickname):
location = {
"Valdis": "Covetous",
"maldis": "Britain Entrance",
}
return location.get(nickname, "unknown place")
def discosend(message):
webhook = DiscordWebhook(url=hookurl, content=message)
webhook.execute()
def findenemy(location):
global idtimers
if FindTypesArrayEx([0x0191, 0x0190], [0xFFFF], [Ground()], False):
for character in GetFoundList():
# enemy = GetName(character) # если имя
enemy = character # если ид
if enemy not in friends:
# if first appearance, adding timer
if enemy not in idtimers:
idtimers[enemy] = time.time()
discosend(f"{location} : {GetName(character)} has appeared")
# checking if the enemy name is in dictionary and checking if the historical timer is greater
if time.time() > idtimers[enemy] + shouttime:
# update the new value
idtimers[enemy] = time.time()
discosend(f"{location} : {GetName(character)} has appeared")
location = get_character_location(GetName(Self()))
Ignore(Self())
while True:
findenemy(location)
Wait(1000)