forked from marcb1387/reports
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquestreport.py
More file actions
941 lines (915 loc) · 51.1 KB
/
questreport.py
File metadata and controls
941 lines (915 loc) · 51.1 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
from discord_webhook import DiscordWebhook, DiscordEmbed
import mysql.connector as mariadb
import time
import datetime
import os
from os import path
import configparser
import argparse
import csv
import operator
import re
import json
import requests
from bs4 import BeautifulSoup
parser = argparse.ArgumentParser()
parser.add_argument("-a", "--area",default="config.ini", help="Area config file to use")
parser.add_argument("-c", "--check",action="store_true", help="Check to make sure amount of stops and task is the same before posting")
parser.add_argument("-g", "--gif",action="store_true", help="Use Animated Gif Pokemon Sprites")
parser.add_argument("-s", "--safe",action="store_true", help="Dose no stop vs task check only a file check as a filesafe run")
args = parser.parse_args()
areafile = args.area
# CONFIG
config = configparser.ConfigParser()
config.read(['config.ini',areafile])
webhookurl = config.get('CONFIG', 'DiscordQ')
area = config.get('CONFIG', 'Area')
areaname = config.get('CONFIG', 'Areaname')
author = config.get('CONFIG', 'Author')
footerimg = config.get ('CONFIG', 'AuthorIMG')
use_emoji = config.getboolean('CONFIG','use_emoji')
use_shiny_emoji = config.getboolean('CONFIG','use_shiny_emoji')
use_webhook_name = config.getboolean('CONFIG','use_webhook_name')
use_slim_name = config.getboolean('CONFIG','use_slim_name')
host = config.get('DATABASE', 'MAD_db_host')
database = config.get('DATABASE', 'db_name')
port = config.get('DATABASE', 'port')
user = config.get('DATABASE', 'db_user')
passwd = config.get('DATABASE', 'db_pass')
poke_ball = config.getboolean('ITEMS','poke_ball')
great_ball = config.getboolean('ITEMS','great_ball')
ultra_ball = config.getboolean('ITEMS','ultra_ball')
potion = config.getboolean('ITEMS','potion')
super_potion = config.getboolean('ITEMS','super_potion')
hyper_potion = config.getboolean('ITEMS','hyper_potion')
max_potion = config.getboolean('ITEMS','max_potion')
revive = config.getboolean('ITEMS','revive')
max_revive = config.getboolean('ITEMS','max_revive')
razz_berry = config.getboolean('ITEMS','razz_berry')
golden_razz_berry = config.getboolean('ITEMS','golden_razz_berry')
pinap_berry = config.getboolean('ITEMS','pinap_berry')
silver_pinap_berry = config.getboolean('ITEMS','silver_pinap_berry')
nanab_berry = config.getboolean('ITEMS','nanab_berry')
dragon_scale = config.getboolean('ITEMS','dragon_scale')
kings_rock = config.getboolean('ITEMS','kings_rock')
metal_coat = config.getboolean('ITEMS','metal_coat')
sun_stone = config.getboolean('ITEMS','sun_stone')
up_grade = config.getboolean('ITEMS','up_grade')
shinnoh_stone = config.getboolean('ITEMS','shinnoh_stone')
unova_stone = config.getboolean('ITEMS','unova_stone')
fast_tm = config.getboolean('ITEMS','fast_tm')
charged_tm = config.getboolean('ITEMS','charged_tm')
rare_candy = config.getboolean('ITEMS','rare_candy')
glacial_lure = config.getboolean('ITEMS','glacial_lure')
mossy_lure = config.getboolean('ITEMS','mossy_lure')
magnetic_lure = config.getboolean('ITEMS','magnetic_lure')
mega_energy = config.getboolean('ITEMS','mega_energy')
ar_task = config.getboolean('ITEMS','ar_task')
stardust = config.get('ITEMS','stardust')
encounters = config.getboolean('ITEMS','encounters')
mons = config.get('POKEMON','dex_number')
adtitle = config.get('AD','Ad_Title')
adbody = config.get('AD','Ad_Body')
adthumb = config.get('AD','Ad_Thumbnail')
# CONFIG END
# SPRITES
if args.gif:
img = 'https://raw.githubusercontent.com/marcb1387/assets/master/pokemon_icon_' #animated
ext = '.gif' #animated
else:
img = 'https://raw.githubusercontent.com/whitewillem/PogoAssets/resized/no_border/pokemon_icon_' # Static
ext = '.png' #Static
imgs = 'https://raw.githubusercontent.com/whitewillem/PogoAssets/resized/no_border/pokemon_icon_' # Static
exts = '.png' #Static
imgwn = "https://raw.githubusercontent.com/Debaucus/PAIcons/master/Current%20Shiny/pokemon_icon_" #webhook name shiny
mariadb_connection = mariadb.connect(user=user, password=passwd, database=database, host=host, port=port)
cursor = mariadb_connection.cursor()
shiny_data = requests.get("https://pogoapi.net/api/v1/shiny_pokemon.json").json()
mon_names = requests.get("https://pogoapi.net/api/v1/pokemon_names.json").json()
#Pokemon
def quest_mon():
query = ("SELECT DISTINCT quest_pokemon_id,quest_pokemon_form_id,quest_pokemon_costume_id FROM trs_quest inner join pokestop on trs_quest.GUID = pokestop.pokestop_id where DATE(FROM_UNIXTIME(trs_quest.quest_timestamp)) = CURDATE() and quest_reward_type = 7 and quest_type NOT like 46 and ST_CONTAINS(ST_GEOMFROMTEXT('POLYGON(("+area+"))'), point(pokestop.latitude, pokestop.longitude)) order by trs_quest.quest_pokemon_id;")
cursor.execute(query)
name = cursor.fetchall()
res =[tuple(str(ele) for ele in sub) for sub in name]
for mon in res:
monquery = ("select CONVERT(pokestop.name USING UTF8MB4) as pokestopname,pokestop.latitude,pokestop.longitude,quest_task from pokestop inner join trs_quest on pokestop.pokestop_id = trs_quest.GUID where DATE(FROM_UNIXTIME(trs_quest.quest_timestamp)) = CURDATE() and quest_reward_type = 7 and quest_pokemon_id ="+mon[0]+" and quest_type NOT like 46 and quest_pokemon_form_id like '%"+mon[1]+"%' and ST_CONTAINS(ST_GEOMFROMTEXT('POLYGON(("+area+"))'), point(pokestop.latitude, pokestop.longitude))")
cursor.execute(monquery)
monname = cursor.fetchall()
monres =[tuple(str(ele) for ele in sub) for sub in monname]
mon_name=mon_names.get(str(mon[0]), {}).get("name", True)
mon3d = "{:03d}".format(int(mon[0]))
form2d = "{:02d}".format(int(mon[1]))
shiny = ""
if str(mon[0]) in shiny_data:
if shiny_data.get(str(mon[0]), {}).get("found_research", True):
shiny = ":sparkles:"
if ":sparkles:" in shiny:
print (mon_name+" Shiny? YES")
else: print (mon_name+" Shiny? NO")
snum = ""
if int(mon[0]) == 327:
url = 'https://leekduck.com/research/'
reqs = requests.get(url)
soup = BeautifulSoup(reqs.content, 'html.parser')
s = soup.find_all('p')[2].get_text()
snumm = re.sub("[^0-9]", "", s)
snum = snumm+" "
alolan = ""
galar = ""
if int(mon[1]) in [46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80]:
alolan = "(Alolan) "
if int(mon[1]) in [944,946,948,2335,2336,2337,2338,2339,2340,2341,2342,2343,2344,2345]:
galar = "(Galarian) "
taskquery = ("select CONVERT(pokestop.name USING UTF8MB4) as pokestopname,pokestop.latitude,pokestop.longitude,quest_task from pokestop inner join trs_quest on pokestop.pokestop_id = trs_quest.GUID where DATE(FROM_UNIXTIME(trs_quest.quest_timestamp)) = CURDATE() and quest_reward_type = 7 and quest_pokemon_id ="+mon[0]+" and quest_type NOT like 46 and quest_pokemon_form_id like '%"+mon[1]+"%' and ST_CONTAINS(ST_GEOMFROMTEXT('POLYGON(("+area+"))'), point(pokestop.latitude, pokestop.longitude))")
cursor.execute(taskquery)
taskname = cursor.fetchall()
taskres =[tuple(str(ele) for ele in sub) for sub in taskname]
task3 =[]
for task in taskres:
task3 += [task[3]]
result = all(elem == task3[0] for elem in task3)
if result:
if mons:
for dex in mons.split(','):
if dex == mon3d:
print ("Research Task Is The Same "+mon_name)
#convert data into string
monres.sort()
webhook = DiscordWebhook(url=webhookurl)
# create embed object for webhook
research = ''
for stop in monres:
research += ('['+stop[0]+'](''https://maps.google.com/?q='''+stop[1]+','+stop[2]+')'+'\n')
if len(research)> 1900:
print ("larger then 2048 breaking up")
print (mon_name+" Length:", len(research))
if use_webhook_name:
embed = DiscordEmbed(title=shiny+' Research Task: '+stop[3]+shiny, description=research, color=16777011)
webhook.username = mon_name+" "+alolan+galar+snum+'Field Research'
url=imgwn+mon3d+'_'+form2d+ext
r = requests.head(url)
if r.status_code == requests.codes.ok:
webhook.avatar_url = imgwn+mon3d+'_'+form2d+exts
else:
webhook.avatar_url = img+mon3d+'_'+form2d+ext
elif use_slim_name:
embed = DiscordEmbed(title= shiny+mon_name+" "+alolan+galar+snum+': '+stop[3]+shiny, description=research, color=16777011)
else:
embed = DiscordEmbed(title= shiny+mon_name+" "+alolan+galar+snum+'Field Research'+shiny, description=research, color=16777011)
embed.set_author(name='Research Task: '+stop[3])
if use_emoji:embed.set_thumbnail(url=img+mon3d+'_'+form2d+ext)
if use_shiny_emoji:
url=imgwn+mon3d+'_'+form2d+ext
r = requests.head(url)
if r.status_code == requests.codes.ok:
embed.set_thumbnail(url=imgwn+mon3d+'_'+form2d+ext)
else:
embed.set_thumbnail(url=img+mon3d+'_'+form2d+ext)
if author: embed.set_footer(text='Research by '+author, icon_url=footerimg)
#add embed object to webhook
webhook.add_embed(embed)
webhook.execute()
research = ''
webhook.remove_embed(0)
time.sleep(2)
print (mon_name+" Length:", len(research))
if use_webhook_name:
embed = DiscordEmbed(title=shiny+' Research Task: '+stop[3]+shiny, description=research, color=16777011)
webhook.username = mon_name+" "+alolan+galar+snum+'Field Research'
url=imgwn+mon3d+'_'+form2d+ext
r = requests.head(url)
if r.status_code == requests.codes.ok:
webhook.avatar_url = imgwn+mon3d+'_'+form2d+exts
else:
webhook.avatar_url = img+mon3d+'_'+form2d+ext
elif use_slim_name:
embed = DiscordEmbed(title= shiny+mon_name+" "+alolan+galar+snum+': '+stop[3]+shiny, description=research, color=16777011)
else:
embed = DiscordEmbed(title= shiny+mon_name+" "+alolan+galar+snum+'Field Research'+shiny, description=research, color=16777011)
embed.set_author(name='Research Task: '+stop[3])
if use_emoji:embed.set_thumbnail(url=img+mon3d+'_'+form2d+ext)
if use_shiny_emoji:
url=imgwn+mon3d+'_'+form2d+ext
r = requests.head(url)
if r.status_code == requests.codes.ok:embed.set_thumbnail(url=imgwn+mon3d+'_'+form2d+ext)
else:embed.set_thumbnail(url=img+mon3d+'_'+form2d+ext)
if author: embed.set_footer(text='Research by '+author, icon_url=footerimg)
#add embed object to webhook
webhook.add_embed(embed)
webhook.execute()
research = ''
webhook.remove_embed(0)
time.sleep(2)
else:
print ("Research Task Is The Same "+mon_name)
#convert data into string
monres.sort()
webhook = DiscordWebhook(url=webhookurl)
# create embed object for webhook
research = ''
for stop in monres:
research += ('['+stop[0]+'](''https://maps.google.com/?q='''+stop[1]+','+stop[2]+')'+'\n')
if len(research)> 1900:
print ("larger then 2048 breaking up")
print (mon_name+" Length:", len(research))
if use_webhook_name:
webhook.username = mon_name+" "+alolan+galar+snum+'Field Research'
embed = DiscordEmbed(title=shiny+' Research Task: '+stop[3]+shiny, description=research, color=16777011)
url=imgwn+mon3d+'_'+form2d+ext
r = requests.head(url)
if r.status_code == requests.codes.ok:
webhook.avatar_url = imgwn+mon3d+'_'+form2d+exts
else:
webhook.avatar_url = img+mon3d+'_'+form2d+ext
elif use_slim_name:
embed = DiscordEmbed(title= shiny+mon_name+" "+alolan+galar+snum+': '+stop[3]+shiny, description=research, color=16777011)
else:
embed = DiscordEmbed(title= shiny+mon_name+" "+alolan+galar+snum+'Field Research'+shiny, description=research, color=16777011)
embed.set_author(name='Research Task: '+stop[3])
if use_emoji: embed.set_thumbnail(url=img+mon3d+'_'+form2d+ext)
if use_shiny_emoji:
url=imgwn+mon3d+'_'+form2d+ext
r = requests.head(url)
if r.status_code == requests.codes.ok:embed.set_thumbnail(url=imgwn+mon3d+'_'+form2d+ext)
else:embed.set_thumbnail(url=img+mon3d+'_'+form2d+ext)
if author: embed.set_footer(text='Research by '+author, icon_url=footerimg)
#add embed object to webhook
webhook.add_embed(embed)
webhook.execute()
research = ''
webhook.remove_embed(0)
time.sleep(2)
print (mon_name+" Length:", len(research))
if use_webhook_name:
webhook.username = mon_name+" "+alolan+galar+snum+'Field Research'
embed = DiscordEmbed(title=shiny+' Research Task: '+stop[3]+shiny, description=research, color=16777011)
url=imgwn+mon3d+'_'+form2d+ext
r = requests.head(url)
if r.status_code == requests.codes.ok:
webhook.avatar_url = imgwn+mon3d+'_'+form2d+exts
else:
webhook.avatar_url = img+mon3d+'_'+form2d+ext
elif use_slim_name:
embed = DiscordEmbed(title= shiny+mon_name+" "+alolan+galar+snum+': '+stop[3]+shiny, description=research, color=16777011)
else:
embed = DiscordEmbed(title= shiny+mon_name+" "+alolan+galar+snum+'Field Research'+shiny, description=research, color=16777011)
embed.set_author(name='Research Task: '+stop[3])
if use_emoji: embed.set_thumbnail(url=img+mon3d+'_'+form2d+ext)
if use_shiny_emoji:
url=imgwn+mon3d+'_'+form2d+ext
r = requests.head(url)
if r.status_code == requests.codes.ok:embed.set_thumbnail(url=imgwn+mon3d+'_'+form2d+ext)
else:embed.set_thumbnail(url=img+mon3d+'_'+form2d+ext)
if author: embed.set_footer(text='Research by '+author, icon_url=footerimg)
#add embed object to webhook
webhook.add_embed(embed)
webhook.execute()
research = ''
time.sleep(2)
else:
if mons:
for dex in mons.split(','):
if dex == mon3d:
print ("Research Task Is The Different "+mon_name)
#convert data into string
monname.sort(key = operator.itemgetter(3, 0))
monres =[tuple(str(ele) for ele in sub) for sub in monname]
webhook = DiscordWebhook(url=webhookurl)
# create embed object for webhook
research = ''
for stop in monres:
research += ('['+stop[0]+'](''https://maps.google.com/?q='''+stop[1]+','+stop[2]+')'+' '+stop[3]+'\n')
if len(research)> 1900:
print ("larger then 2048 breaking up")
print (mon_name+" Length:", len(research))
if use_webhook_name:
webhook.username = mon_name+" "+alolan+galar+snum+'Field Research'
embed = DiscordEmbed( description=research, color=16777011)
url=imgwn+mon3d+'_'+form2d+ext
r = requests.head(url)
if r.status_code == requests.codes.ok:
webhook.avatar_url = imgwn+mon3d+'_'+form2d+exts
else:
webhook.avatar_url = img+mon3d+'_'+form2d+ext
else:
embed = DiscordEmbed(title= shiny+mon_name+" "+alolan+galar+snum+'Field Research'+shiny, description=research, color=16777011)
webhook.avatar_url = img+mon3d+'_'+form2d+ext
if use_emoji: embed.set_thumbnail(url=img+mon3d+'_'+form2d+ext)
if use_shiny_emoji:
url=imgwn+mon3d+'_'+form2d+ext
r = requests.head(url)
if r.status_code == requests.codes.ok:embed.set_thumbnail(url=imgwn+mon3d+'_'+form2d+ext)
else:embed.set_thumbnail(url=img+mon3d+'_'+form2d+ext)
if author: embed.set_footer(text='Research by '+author, icon_url=footerimg)
#add embed object to webhook
webhook.add_embed(embed)
webhook.execute()
research = ''
webhook.remove_embed(0)
time.sleep(2)
print (mon_name+" Length:", len(research))
if use_webhook_name:
webhook.username = mon_name+" "+alolan+galar+snum+'Field Research'
embed = DiscordEmbed( description=research, color=16777011)
url=imgwn+mon3d+'_'+form2d+ext
r = requests.head(url)
if r.status_code == requests.codes.ok:
webhook.avatar_url = imgwn+mon3d+'_'+form2d+exts
else:
webhook.avatar_url = img+mon3d+'_'+form2d+ext
else:
embed = DiscordEmbed(title= shiny+mon_name+" "+alolan+galar+snum+'Field Research'+shiny, description=research, color=16777011)
if use_emoji: embed.set_thumbnail(url=img+mon3d+'_'+form2d+ext)
if use_shiny_emoji:
url=imgwn+mon3d+'_'+form2d+ext
r = requests.head(url)
if r.status_code == requests.codes.ok:embed.set_thumbnail(url=imgwn+mon3d+'_'+form2d+ext)
else:embed.set_thumbnail(url=img+mon3d+'_'+form2d+ext)
if author: embed.set_footer(text='Research by '+author, icon_url=footerimg)
#add embed object to webhook
webhook.add_embed(embed)
webhook.execute()
research = ''
time.sleep(2)
else:
print ("Research Task Is The Different "+mon_name)
#convert data into string
monname.sort(key = operator.itemgetter(3, 0))
monres =[tuple(str(ele) for ele in sub) for sub in monname]
webhook = DiscordWebhook(url=webhookurl)
# create embed object for webhook
research = ''
for stop in monres:
research += ('['+stop[0]+'](''https://maps.google.com/?q='''+stop[1]+','+stop[2]+')'+' '+stop[3]+'\n')
if len(research)> 1900:
print ("larger then 2048 breaking up")
print (mon_name+" Length:", len(research))
if use_webhook_name:
webhook.username = mon_name+" "+alolan+galar+snum+'Field Research'
embed = DiscordEmbed( description=research, color=16777011)
url=imgwn+mon3d+'_'+form2d+ext
r = requests.head(url)
if r.status_code == requests.codes.ok:
webhook.avatar_url = imgwn+mon3d+'_'+form2d+exts
else:
webhook.avatar_url = img+mon3d+'_'+form2d+ext
else:
embed = DiscordEmbed(title= shiny+mon_name+" "+alolan+galar+snum+'Field Research'+shiny, description=research, color=16777011)
if use_emoji: embed.set_thumbnail(url=img+mon3d+'_'+form2d+ext)
if use_shiny_emoji:
url=imgwn+mon3d+'_'+form2d+ext
r = requests.head(url)
if r.status_code == requests.codes.ok:embed.set_thumbnail(url=imgwn+mon3d+'_'+form2d+ext)
else:embed.set_thumbnail(url=img+mon3d+'_'+form2d+ext)
if author: embed.set_footer(text='Research by '+author, icon_url=footerimg)
#add embed object to webhook
webhook.add_embed(embed)
webhook.execute()
research = ''
webhook.remove_embed(0)
time.sleep(2)
print (mon_name+" Length:", len(research))
if use_webhook_name:
webhook.username = mon_name+" "+alolan+galar+snum+'Field Research'
embed = DiscordEmbed( description=research, color=16777011)
url=imgwn+mon3d+'_'+form2d+ext
r = requests.head(url)
if r.status_code == requests.codes.ok:
webhook.avatar_url = imgwn+mon3d+'_'+form2d+exts
else:
webhook.avatar_url = img+mon3d+'_'+form2d+ext
else:
embed = DiscordEmbed(title= shiny+mon_name+" "+alolan+galar+snum+'Field Research'+shiny, description=research, color=16777011)
if use_emoji: embed.set_thumbnail(url=img+mon3d+'_'+form2d+ext)
if use_shiny_emoji:
url=imgwn+mon3d+'_'+form2d+ext
r = requests.head(url)
if r.status_code == requests.codes.ok:embed.set_thumbnail(url=imgwn+mon3d+'_'+form2d+ext)
else:embed.set_thumbnail(url=img+mon3d+'_'+form2d+ext)
if author: embed.set_footer(text='Research by '+author, icon_url=footerimg)
#add embed object to webhook
webhook.add_embed(embed)
webhook.execute()
research = ''
time.sleep(2)
#items
def quest_item(itemid,item,sprite):
mariadb_connection = mariadb.connect(user=user, password=passwd, database=database, host=host,port=port)
cursor = mariadb_connection.cursor()
query = ("select CONVERT(pokestop.name USING UTF8MB4) as pokestopname,pokestop.latitude,pokestop.longitude,trs_quest.quest_task,trs_quest.quest_item_amount from pokestop inner join trs_quest on pokestop.pokestop_id = trs_quest.GUID where DATE(FROM_UNIXTIME(trs_quest.quest_timestamp)) = CURDATE() and quest_item_id = "+itemid+" and quest_type NOT like 46 and ST_CONTAINS(ST_GEOMFROMTEXT('POLYGON(("+area+"))'), point(pokestop.latitude, pokestop.longitude))")
cursor.execute(query)
name = cursor.fetchall()
if not name:
print ("no quests for "+item)
else:
#convert data into string
res =[tuple(str(ele) for ele in sub) for sub in name]
res.sort()
webhook = DiscordWebhook(url=webhookurl)
# create embed object for webhook
research = ''
task3 =[]
for task in res:
task3 += [task[3]]
result = all(elem == task3[0] for elem in task3)
if result:
print ("Research Task Is The Same "+item)
for stop in res:
research += ('['+stop[0]+'](''https://maps.google.com/?q='''+stop[1]+','+stop[2]+')'+ '- Amount: '+stop[4]+'\n')
if len(research)> 1900:
print ("larger then 2048 breaking up")
print (item+" Length:", len(research))
if use_webhook_name:
embed = DiscordEmbed(description=research, color=4390656)
webhook.username = item+' Field Research'
webhook.avatar_url = sprite
embed.set_author(name='Research Task: '+stop[3])
elif use_slim_name:
embed = DiscordEmbed(title= item+': '+stop[3], description=research, color=4390656)
else:
embed = DiscordEmbed(title= item+' Field Research', description=research, color=4390656)
embed.set_author(name='Research Task: '+stop[3])
if author: embed.set_footer(text='Research by '+author, icon_url=footerimg)
if use_emoji: embed.set_thumbnail(url=sprite)
webhook.add_embed(embed)
webhook.execute()
research = ''
webhook.remove_embed(0)
time.sleep(2)
print (item+" Length:", len(research))
if use_webhook_name:
embed = DiscordEmbed(description=research, color=4390656)
webhook.username = item+' Field Research'
webhook.avatar_url = sprite
embed.set_author(name='Research Task: '+stop[3])
elif use_slim_name:
embed = DiscordEmbed(title= item+': '+stop[3], description=research, color=4390656)
else:
embed = DiscordEmbed(title= item+' Field Research', description=research, color=4390656)
embed.set_author(name='Research Task: '+stop[3])
if author: embed.set_footer(text='Research by '+author, icon_url=footerimg)
if use_emoji: embed.set_thumbnail(url=sprite)
webhook.add_embed(embed)
webhook.execute()
research = ''
time.sleep(2)
else:
print ("Research Task Is Different "+item)
name.sort(key = operator.itemgetter(3,0))
res =[tuple(str(ele) for ele in sub) for sub in name]
for stop in res:
research += ('['+stop[0]+'](''https://maps.google.com/?q='''+stop[1]+','+stop[2]+')'+' '+stop[3]+' - Amount: '+stop[4]+'\n')
if len(research)> 1900:
print ("larger then 2048 breaking up")
print (item+" Length:", len(research))
#add embed object to webhook
if use_webhook_name:
embed = DiscordEmbed(description=research, color=4390656)
webhook.username = item+' Field Research'
webhook.avatar_url = sprite
else:
embed = DiscordEmbed(title= item+' Field Research', description=research, color=4390656)
if author: embed.set_footer(text='Research by '+author, icon_url=footerimg)
if use_emoji: embed.set_thumbnail(url=sprite)
webhook.add_embed(embed)
webhook.execute()
research = ''
webhook.remove_embed(0)
time.sleep(2)
print (item+" Length:", len(research))
#add embed object to webhook
if use_webhook_name:
embed = DiscordEmbed(description=research, color=4390656)
webhook.username = item+' Field Research'
webhook.avatar_url = sprite
else:
embed = DiscordEmbed(title= item+' Field Research', description=research, color=4390656)
if author: embed.set_footer(text='Research by '+author, icon_url=footerimg)
if use_emoji: embed.set_thumbnail(url=sprite)
webhook.add_embed(embed)
webhook.execute()
research = ''
time.sleep(2)
#AR Stops
def ar_stops(item,sprite):
mariadb_connection = mariadb.connect(user=user, password=passwd, database=database, host=host,port=port)
cursor = mariadb_connection.cursor()
query = ("select CONVERT(pokestop.name USING UTF8MB4) as pokestopname,pokestop.latitude,pokestop.longitude,trs_quest.quest_task from pokestop inner join trs_quest on pokestop.pokestop_id = trs_quest.GUID where DATE(FROM_UNIXTIME(trs_quest.quest_timestamp)) = CURDATE() and quest_type = 46 and ST_CONTAINS(ST_GEOMFROMTEXT('POLYGON(("+area+"))'), point(pokestop.latitude, pokestop.longitude))")
cursor.execute(query)
name = cursor.fetchall()
if not name:
print ("no quests for "+item)
else:
#convert data into string
res =[tuple(str(ele) for ele in sub) for sub in name]
res.sort()
webhook = DiscordWebhook(url=webhookurl)
# create embed object for webhook
research = ''
task3 =[]
for task in res:
task3 += [task[3]]
result = all(elem == task3[0] for elem in task3)
if result:
print ("Research Task Is The Same "+item)
for stop in res:
research += ('['+stop[0]+'](''https://maps.google.com/?q='''+stop[1]+','+stop[2]+')'+'\n')
if len(research)> 1900:
print ("larger then 2048 breaking up")
print (item+" Length:", len(research))
if use_webhook_name:
embed = DiscordEmbed(description=research, color=15105570)
webhook.username = item+' Field Research'
webhook.avatar_url = sprite
embed.set_author(name='Research Task: '+stop[3])
elif use_slim_name:
embed = DiscordEmbed(title= item+': '+stop[3], description=research, color=15105570)
else:
embed = DiscordEmbed(title= item+' Field Research', description=research, color=15105570)
embed.set_author(name='Research Task: '+stop[3])
if author: embed.set_footer(text='Research by '+author, icon_url=footerimg)
if use_emoji: embed.set_thumbnail(url=sprite)
webhook.add_embed(embed)
webhook.execute()
research = ''
webhook.remove_embed(0)
time.sleep(2)
print (item+" Length:", len(research))
if use_webhook_name:
embed = DiscordEmbed(description=research, color=15105570)
webhook.username = item+' Field Research'
webhook.avatar_url = sprite
embed.set_author(name='Research Task: '+stop[3])
elif use_slim_name:
embed = DiscordEmbed(title= item+': '+stop[3], description=research, color=15105570)
else:
embed = DiscordEmbed(title= item+' Field Research', description=research, color=15105570)
embed.set_author(name='Research Task: '+stop[3])
if author: embed.set_footer(text='Research by '+author, icon_url=footerimg)
if use_emoji: embed.set_thumbnail(url=sprite)
webhook.add_embed(embed)
webhook.execute()
research = ''
time.sleep(2)
else:
print ("Research Task Is Different "+item)
name.sort(key = operator.itemgetter(3,0))
res =[tuple(str(ele) for ele in sub) for sub in name]
for stop in res:
research += ('['+stop[0]+'](''https://maps.google.com/?q='''+stop[1]+','+stop[2]+')'+' '+stop[3]+'\n')
if len(research)> 1900:
print ("larger then 2048 breaking up")
print (item+" Length:", len(research))
#add embed object to webhook
if use_webhook_name:
embed = DiscordEmbed(description=research, color=15105570)
webhook.username = item+' Field Research'
webhook.avatar_url = sprite
else:
embed = DiscordEmbed(title= item+' Field Research', description=research, color=15105570)
if author: embed.set_footer(text='Research by '+author, icon_url=footerimg)
if use_emoji: embed.set_thumbnail(url=sprite)
webhook.add_embed(embed)
webhook.execute()
research = ''
webhook.remove_embed(0)
time.sleep(2)
print (item+" Length:", len(research))
#add embed object to webhook
if use_webhook_name:
embed = DiscordEmbed(description=research, color=15105570)
webhook.username = item+' Field Research'
webhook.avatar_url = sprite
else:
embed = DiscordEmbed(title= item+' Field Research', description=research, color=15105570)
if author: embed.set_footer(text='Research by '+author, icon_url=footerimg)
if use_emoji: embed.set_thumbnail(url=sprite)
webhook.add_embed(embed)
webhook.execute()
research = ''
time.sleep(2)
#mega energy
def mega_item(itemid,item,sprite):
mariadb_connection = mariadb.connect(user=user, password=passwd, database=database, host=host,port=port)
cursor = mariadb_connection.cursor()
query = ("select CONVERT(pokestop.name USING UTF8MB4) as pokestopname,pokestop.latitude,pokestop.longitude,trs_quest.quest_task,trs_quest.quest_item_amount,trs_quest.quest_pokemon_id from pokestop inner join trs_quest on pokestop.pokestop_id = trs_quest.GUID where DATE(FROM_UNIXTIME(trs_quest.quest_timestamp)) = CURDATE() and quest_reward_type = 12 and quest_pokemon_id = "+itemid+" and ST_CONTAINS(ST_GEOMFROMTEXT('POLYGON(("+area+"))'), point(pokestop.latitude, pokestop.longitude))")
cursor.execute(query)
name = cursor.fetchall()
if not name:
print ("no quests for "+item)
else:
#convert data into string
res =[tuple(str(ele) for ele in sub) for sub in name]
res.sort()
webhook = DiscordWebhook(url=webhookurl)
# create embed object for webhook
research = ''
task3 =[]
for task in res:
task3 += [task[3]]
result = all(elem == task3[0] for elem in task3)
if result:
print ("Research Task Is The Same "+item)
for stop in res:
research += ('['+stop[0]+'](''https://maps.google.com/?q='''+stop[1]+','+stop[2]+')'+' - Amount: '+stop[4]+'\n')
if len(research)> 1900:
print ("larger then 2048 breaking up")
print (item+" Length:", len(research))
if use_webhook_name:
embed = DiscordEmbed(description=research, color=1752220)
webhook.username = item+' Field Research'
webhook.avatar_url = sprite
embed.set_author(name='Research Task: '+stop[3])
elif use_slim_name:
embed = DiscordEmbed(title= item+': '+stop[3], description=research, color=1752220)
else:
embed = DiscordEmbed(title= item+' Field Research', description=research, color=1752220)
embed.set_author(name='Research Task: '+stop[3])
if author: embed.set_footer(text='Research by '+author, icon_url=footerimg)
if use_emoji: embed.set_thumbnail(url=sprite)
webhook.add_embed(embed)
webhook.execute()
research = ''
webhook.remove_embed(0)
time.sleep(2)
print (item+" Length:", len(research))
if use_webhook_name:
embed = DiscordEmbed(description=research, color=1752220)
webhook.username = item+' Field Research'
webhook.avatar_url = sprite
embed.set_author(name='Research Task: '+stop[3])
elif use_slim_name:
embed = DiscordEmbed(title= item+': '+stop[3], description=research, color=1752220)
else:
embed = DiscordEmbed(title= item+' Field Research', description=research, color=1752220)
embed.set_author(name='Research Task: '+stop[3])
if author: embed.set_footer(text='Research by '+author, icon_url=footerimg)
if use_emoji: embed.set_thumbnail(url=sprite)
webhook.add_embed(embed)
webhook.execute()
research = ''
time.sleep(2)
else:
print ("Research Task Is Different "+item)
name.sort(key = operator.itemgetter(3,0))
res =[tuple(str(ele) for ele in sub) for sub in name]
for stop in res:
research += ('['+stop[0]+'](''https://maps.google.com/?q='''+stop[1]+','+stop[2]+')'+' '+stop[3]+' - Amount: '+stop[4]+'\n')
if len(research)> 1900:
print ("larger then 2048 breaking up")
print (item+" Length:", len(research))
#add embed object to webhook
if use_webhook_name:
embed = DiscordEmbed(description=research, color=1752220)
webhook.username = item+' Field Research'
webhook.avatar_url = sprite
else:
embed = DiscordEmbed(title= item+' Field Research', description=research, color=1752220)
if author: embed.set_footer(text='Research by '+author, icon_url=footerimg)
if use_emoji: embed.set_thumbnail(url=sprite)
webhook.add_embed(embed)
webhook.execute()
research = ''
webhook.remove_embed(0)
time.sleep(2)
print (item+" Length:", len(research))
#add embed object to webhook
if use_webhook_name:
embed = DiscordEmbed(description=research, color=1752220)
webhook.username = item+' Field Research'
webhook.avatar_url = sprite
else:
embed = DiscordEmbed(title= item+' Field Research', description=research, color=1752220)
if author: embed.set_footer(text='Research by '+author, icon_url=footerimg)
if use_emoji: embed.set_thumbnail(url=sprite)
webhook.add_embed(embed)
webhook.execute()
research = ''
time.sleep(2)
#Stardust
def quest_stardust(itemid,item,sprite):
mariadb_connection = mariadb.connect(user=user, password=passwd, database=database, host=host, port=port)
cursor = mariadb_connection.cursor()
samount = (int(stardust) - 1)
query = ("select CONVERT(pokestop.name USING UTF8MB4) as pokestopname,pokestop.latitude,pokestop.longitude,trs_quest.quest_task,if(trs_quest.quest_stardust>"+str(samount)+",trs_quest.quest_stardust, null) from pokestop inner join trs_quest on pokestop.pokestop_id = trs_quest.GUID where quest_pokemon_id = "+itemid+" and DATE(FROM_UNIXTIME(trs_quest.quest_timestamp)) = CURDATE() and if(trs_quest.quest_stardust>"+str(samount)+",trs_quest.quest_stardust, null) is not null and ST_CONTAINS(ST_GEOMFROMTEXT('POLYGON(("+area+"))'), point(pokestop.latitude, pokestop.longitude))")
cursor.execute(query)
name = cursor.fetchall()
if not name:
print ("no quests for "+item)
else:
#convert data into string
name.sort(key = operator.itemgetter(4,3,0))
res =[tuple(str(ele) for ele in sub) for sub in name]
webhook = DiscordWebhook(url=webhookurl)
# create embed object for webhook
research = ''
for stop in res:
research += ('['+stop[0]+'](''https://maps.google.com/?q='''+stop[1]+','+stop[2]+')'+' '+stop[3]+' - Amount: '+stop[4]+'\n')
if len(research)> 1850:
print ("larger then 2048 breaking up")
print (item+" Length:", len(research))
if use_webhook_name:
embed = DiscordEmbed(description=research, color=16711931)
webhook.username = item+' Field Research'
webhook.avatar_url = sprite
else:
embed = DiscordEmbed(title= item+' Field Research', description=research, color=16711931)
if author: embed.set_footer(text='Research by '+author, icon_url=footerimg)
if use_emoji: embed.set_thumbnail(url=sprite)
#add embed object to webhook
webhook.add_embed(embed)
webhook.execute()
research = ''
webhook.remove_embed(0)
time.sleep(2)
print (item+" Length:", len(research))
if use_webhook_name:
embed = DiscordEmbed(description=research, color=16711931)
webhook.username = item+' Field Research'
webhook.avatar_url = sprite
else:
embed = DiscordEmbed(title= item+' Field Research', description=research, color=16711931)
if author: embed.set_footer(text='Research by '+author, icon_url=footerimg)
if use_emoji: embed.set_thumbnail(url=sprite)
#add embed object to webhook
webhook.add_embed(embed)
webhook.execute()
research = ''
time.sleep(2)
def ad():
if not adbody:
print ("no Ad to Display")
else:
print ("Ad found")
webhook = DiscordWebhook(url=webhookurl)
# create embed object for webhook
adbodydecode = bytes(adbody, "utf-8").decode("unicode_escape")
embed = DiscordEmbed(title=adtitle, description=adbodydecode, color=16711931)
if author: embed.set_footer(text='Research by '+author, icon_url=footerimg)
embed.set_thumbnail(url=adthumb)
#add embed object to webhook
webhook.add_embed(embed)
webhook.execute()
research = ''
webhook.remove_embed(0)
time.sleep(2)
#Pokeomon, Items, Stardust, Megas
def stuff():
if encounters:
quest_mon()
if max_revive:
quest_item('202', 'Max Revive','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/Item_0202.png')
if glacial_lure:
quest_item('502', 'Glacial Lure','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/TroyKey_glacial.png')
if mossy_lure:
quest_item('503', 'Mossy Lure','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/TroyKey_moss.png')
if magnetic_lure:
quest_item('504', 'Magnetic Lure','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/TroyKey_magnetic.png')
if golden_razz_berry:
quest_item('706', 'Golden Razz','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/Item_0706.png')
if silver_pinap_berry:
quest_item('708', 'Silver Pinap','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/Item_0707.png')
if sun_stone:
quest_item('1101', 'Sun Stone','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/Bag_Sun_Stone_Sprite.png')
if kings_rock:
quest_item('1102', 'Kings Rock',"https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/Bag_King's_Rock_Sprite.png")
if metal_coat:
quest_item('1103', 'Metal Coat','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/Bag_Metal_Coat_Sprite.png')
if dragon_scale:
quest_item('1104', 'Dragon Scale','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/Bag_Dragon_Scale_Sprite.png')
if up_grade:
quest_item('1105', 'Up-Grade','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/Bag_Up-Grade_Sprite.png')
if shinnoh_stone:
quest_item('1106', 'Sinnoh Stone','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/Bag_Sinnoh_Stone_Sprite.png')
if unova_stone:
quest_item('1107', 'Unova Stone','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/Bag_Unova_Stone_Sprite.png')
if fast_tm:
quest_item('1201', 'Fast TM','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/Item_1201.png')
if charged_tm:
quest_item('1202', 'Charged TM','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/Item_1202.png')
if rare_candy:
quest_item('1301', 'Rare Candy','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/Item_1301.png')
if poke_ball:
quest_item('1', 'Poke Ball','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/Item_0001.png')
if great_ball:
quest_item('2', 'Great Ball','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/Item_0002.png')
if ultra_ball:
quest_item('3', 'Ultra Ball','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/Item_0003.png')
if potion:
quest_item('101', 'Potion','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/Item_0101.png')
if super_potion:
quest_item('102', 'Super Potion','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/Item_0102.png')
if hyper_potion:
quest_item('103', 'Hyper Potion','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/Item_0103.png')
if max_potion:
quest_item('104', 'Max Potion','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/Item_0104.png')
if revive:
quest_item('201', 'Revive','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/Item_0201.png')
if razz_berry:
quest_item('701', 'Razz Berry','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/Item_0701.png')
if pinap_berry:
quest_item('705', 'Pinap Berry','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/Item_0705.png')
if nanab_berry:
quest_item('703', 'Nanab Berry','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/Item_0703.png')
if mega_energy:
mega_item('3','Venusaur Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('6','Charizard Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('9','Blastoise Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('15','Beedrill Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('18','Pidgeot Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('65','Alakazam Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('80','Slowbro Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('94','Gengar Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('115','Kangaskhan Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('127','Pinsir Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('130','Gyarados Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('142','Aerodactyl Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('150','Mewtwo Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('181','Ampharos Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('208','Steelix Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('212','Scizor Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('214','Heracross Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('229','Houndoom Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('248','Tyranitar Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('254','Sceptile Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('257','Blaziken Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('260','Swampert Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('282','Gardevoir Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('302','Sableye Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('303','Mawile Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('306','Aggron Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('308','Medicham Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('310','Manectric Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('319','Sharpedo Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('323','Camerupt Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('334','Altaria Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('354','Banette Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('359','Absol Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('362','Glalie Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('373','Salamence Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('376','Metagross Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('379','Registeel Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('380','Latias Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('381','Latios Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('382','Kyogre Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('383','Groudon Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('384','Rayquaza Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('428','Lopunny Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('445','Garchomp Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('448','Lucario Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('460','Abomasnow Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('475','Gallade Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('531','Audino Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
mega_item('719','Diance Mega Energy','https://raw.githubusercontent.com/marcb1387/assets/master/energy.png')
if ar_task:
ar_stops('AR','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/decrypted_assets/png/tx_tutorial_arDataSurround.png')
if int(stardust) > 199:
quest_stardust('0', 'Stardust Over ' + stardust + '','https://raw.githubusercontent.com/ZeChrales/PogoAssets/master/static_assets/png/stardust_painted.png')
now = (datetime.date.today())
today = now.strftime("%m_%d_%Y")
yday = (now - datetime.timedelta(days=1))
yesterday = yday.strftime("%m_%d_%Y")
mariadb_connection = mariadb.connect(user=user, password=passwd, database=database, host=host, port=port)
cursor = mariadb_connection.cursor()
quests = ("select count(*) from pokestop inner join trs_quest on pokestop.pokestop_id = trs_quest.GUID where DATE(FROM_UNIXTIME(trs_quest.quest_timestamp)) = CURDATE() and ST_CONTAINS(ST_GEOMFROMTEXT('POLYGON(("+area+"))'), point(pokestop.latitude, pokestop.longitude))")
stops = ("select count(*) from pokestop where ST_CONTAINS(ST_GEOMFROMTEXT('POLYGON(("+area+"))'), point(pokestop.latitude, pokestop.longitude))")
cursor.execute(quests)
qcount = cursor.fetchall()
cursor.execute(stops)
scount = cursor.fetchall()
my_path = os.path.abspath(os.path.dirname(__file__))
dir = os.path.join(my_path, "./temp/")
if args.check:
print("Checking Stop and Research Count")
if scount == qcount:
print("Counts Match, Checking File...")
if os.path.isfile(dir+areaname+'_'+today+'.temp'):
print("File exists, Report ran. EXITING")
else:
print("file dose not exist RUNNING REPORT")
x = open(dir+areaname+'_'+today+'.temp', 'w')
x.close()
stuff()
ad()
if os.path.isfile(dir+areaname+'_'+yesterday+'.temp'):
os.remove(dir+areaname+'_'+yesterday+'.temp')
else:
print ("Quests Still Scanning")
print ("Stop count: ",scount)
print ("Quest count: ",qcount)
elif args.safe:
if os.path.isfile(dir+areaname+'_'+today+'.temp'):
print("File exists, Report ran. EXITING")
else:
print("file dose not exist RUNNING REPORT")
x = open(dir+areaname+'_'+today+'.temp', 'w')
x.close()
stuff()
ad()
if os.path.isfile(dir+areaname+'_'+yesterday+'.temp'):
os.remove(dir+areaname+'_'+yesterday+'.temp')
else:
print("No checks running report")
stuff()
ad()