├── Navigation ├── SetInventory ├── assets │ ├── home_quest_button.PNG │ └── home_pokeball_button.PNG ├── tests │ └── test_Locationtest.py ├── configs.py └── LocationTest.py ├── im.png ├── test.png ├── .gitignore ├── reset_res.sh ├── show_pointer_location.sh ├── CardPrototyping ├── Functions.py ├── card_ADB │ ├── scrcpy-server.jar │ ├── instances_ADB.py │ ├── control.py │ ├── viewer.py │ └── ADB.py ├── card_Human │ ├── instances_Human.py │ └── Human.py ├── card_ReceiveProcessText │ ├── instances_ReceiveText.py │ └── ReceiveText.py ├── card_Windows │ ├── utils.py │ └── Windows.py ├── shutdown.py ├── link_test.py ├── CardTest.py ├── card_TransferAllPokemon │ └── TransferPokemon.py ├── card_CatchPokemon │ └── CatchPokemon.py ├── card_SendGifts │ └── SendGifts.py └── GenericCard.py ├── test.py ├── models └── PokestopDetect │ ├── saved_model.pb │ └── variables │ ├── variables.index │ └── variables.data-00000-of-00001 ├── get_statusbar_height.sh ├── gift_received_profile.json ├── PokemonGo ├── images │ ├── DetectPokestop │ │ ├── ps_spun_col.png │ │ ├── ps_unspun_col.png │ │ ├── ps_walk_closer.png │ │ └── ps_walk_closer_area.png │ └── FriendGifting │ │ ├── open_gift_page.png │ │ ├── can_send_gift_profile.png │ │ ├── can_send_gift_profile2.png │ │ ├── gift_received_profile.png │ │ ├── can_send_gift_profile.json │ │ ├── gift_received_profile.json │ │ └── open_gift_page.json ├── PokestopState.py ├── SpinPokestop.py └── DetectPokestop.py ├── open_gift_page.json ├── images ├── Nothing │ ├── nothing_0162a137-3714-4ff2-aaea-09fc2a4ae725.jpg │ ├── nothing_0726de04-feb5-4452-ad14-7d3863889af8.jpg │ ├── nothing_1a25e48f-7eb4-4427-b86e-f29ec65653a3.jpg │ ├── nothing_374da7a0-05bd-49a0-89c9-ab615d178fcd.jpg │ ├── nothing_4249aee2-79ed-4c34-829c-59fe838f5159.jpg │ ├── nothing_448f0eed-5142-417d-a56b-a2be9f7f427a.jpg │ ├── nothing_4582dea6-eb10-4f3d-ae06-517cf6231881.jpg │ ├── nothing_495b14a9-1833-4499-a2db-eb5ca2df0b4d.jpg │ ├── nothing_4a1105dd-ea9f-4411-8594-74811786367d.jpg │ ├── nothing_4a699823-ee85-489c-b855-f534931d3d47.jpg │ ├── nothing_4da92329-44a8-4b5d-95f0-40defbe404a8.jpg │ ├── nothing_5756f752-96a2-4d1b-b3e2-6f28b3d54572.jpg │ ├── nothing_57b82416-db54-4114-8e2a-f7bf54756f88.jpg │ ├── nothing_57eba2a5-5a41-45b2-adcb-30cc51e888c5.jpg │ ├── nothing_5a052adf-5d09-4e40-9b26-270612ff687e.jpg │ ├── nothing_5c24cbfe-5aa7-4420-97f9-386893c6b349.jpg │ ├── nothing_5c7911fd-8284-4ed5-a1bc-873172caa486.jpg │ ├── nothing_604d7aea-e36c-4bc8-83db-e7cf3f10d6f6.jpg │ ├── nothing_684a1c00-b1b1-4076-a6ce-32308884e9c7.jpg │ ├── nothing_6c5df17b-6ade-4166-9847-287247bb8983.jpg │ ├── nothing_6c92abf1-ddc5-4a51-ae7c-167ffdb753fd.jpg │ ├── nothing_79622bf3-3d5c-434b-99ed-9c0058c6bfca.jpg │ ├── nothing_7b4a1a9f-84ae-4b7b-b92f-9d2da520921c.jpg │ ├── nothing_7bc138f1-732e-4fce-8859-8b259c301463.jpg │ ├── nothing_7c2ec8e1-48d9-4a90-8495-fef3c359a8e6.jpg │ ├── nothing_7e2f46ff-9cda-4bfc-a548-e16f64901c92.jpg │ ├── nothing_7ebf15fd-5d63-4ab0-95a7-7b83d3c540f3.jpg │ ├── nothing_85c0daf6-8812-4bf7-988a-64785f68f3cb.jpg │ ├── nothing_8647ec48-b16e-4a16-a8aa-e0add4645d52.jpg │ ├── nothing_8fa140eb-3361-4dd8-bf77-c7a07c9017f9.jpg │ ├── nothing_923017f1-27f3-4109-93ad-e9f6ccaedaaf.jpg │ ├── nothing_a861073c-dce9-4e2d-b6e5-1a9c352bf4de.jpg │ ├── nothing_acd227ea-67cc-43cf-bc32-16ed5be54269.jpg │ ├── nothing_afb8166a-b539-4a75-9cbb-bb049dfee63b.jpg │ ├── nothing_b2bb1065-874d-4398-b6ad-1d0f32c36053.jpg │ ├── nothing_bd0673d3-cf11-4922-8cf2-309461e8aacd.jpg │ ├── nothing_bd284c23-272c-4d99-9212-8911a33530ce.jpg │ ├── nothing_be9d1f4e-1ab6-40d0-b4fc-0d001cb19aa0.jpg │ ├── nothing_c3d03de7-3dfc-4db2-a87e-5c9d96ecee09.jpg │ ├── nothing_dfe59017-ab67-401a-8ba1-9136af1c4a5a.jpg │ ├── nothing_f47c384d-2e30-4703-9b57-4b3208fed9a2.jpg │ └── nothing_fa177ba3-8358-4b48-b019-2accd0163a62.jpg ├── Gym │ └── bots │ │ ├── default_021873d7-219a-4eeb-b8fb-0d9f8cc5adac.jpg │ │ ├── default_03f8853e-95bd-4506-8df4-fd804ef27b5a.jpg │ │ ├── default_0502e8df-5bc8-49cc-b7e7-ace962383199.jpg │ │ ├── default_11eb7a7a-5d85-4f17-b9e8-83e9dca3e5df.jpg │ │ ├── default_12dc9bec-1b02-439c-b0b8-d44007b64e0d.jpg │ │ ├── default_17feff86-0d6e-4838-9b1a-ed0c8c4d2099.jpg │ │ ├── default_21719dd9-fd82-4964-a82b-35a5b27f02a9.jpg │ │ ├── default_21dd5aa2-e26d-407b-a010-6b8da3d676e1.jpg │ │ ├── default_2837f09b-d423-42f8-9bac-b8ffe3b5af15.jpg │ │ ├── default_2b127b3d-7d9a-4c5f-8a6f-23079ca8ee76.jpg │ │ ├── default_3317383f-5c4a-43f3-99ba-de508af4c0e1.jpg │ │ ├── default_35c6695d-3c72-419d-b102-c8375da8a284.jpg │ │ ├── default_377a6df5-de75-406d-8b91-b70280838846.jpg │ │ ├── default_39b78717-d404-4b88-bfd1-287b48d348e0.jpg │ │ ├── default_49c94242-233d-4a88-b87f-589fd33b0cac.jpg │ │ ├── default_51c9844d-ae2a-4616-a80a-01942214b820.jpg │ │ ├── default_57d2ab28-e9c0-457a-ad45-fca1dc086dd2.jpg │ │ ├── default_5c5a2247-f4ab-4bd7-82f6-d85565047a88.jpg │ │ ├── default_69d3ce0b-89cd-4b15-bf30-61d574da0de7.jpg │ │ ├── default_6eae93e1-00fa-463b-a38d-3346f07fe890.jpg │ │ ├── default_74021eda-d852-4ad5-9831-052b22946d2b.jpg │ │ ├── default_7acd8600-5fe7-4a2c-a9ad-aceb19b0dab8.jpg │ │ ├── default_7cf83abe-f9f3-42f3-88bd-94dc2e4918f3.jpg │ │ ├── default_7e60f293-65ab-4f35-aa70-4fb1cbd8ca20.jpg │ │ ├── default_8510c57e-f7d2-455d-9872-1f9f0e85e67b.jpg │ │ ├── default_887d61ad-bf05-41be-ad95-0b3d5992bdab.jpg │ │ ├── default_8f2cf67b-0499-4467-b3e2-dbe96940b87d.jpg │ │ ├── default_9128fca8-7446-4c97-a829-117639226b6c.jpg │ │ ├── default_91a000f8-c9a4-4c8c-b924-5d188ac52ba8.jpg │ │ ├── default_93127810-b859-4b3b-9d85-00dd4e58e395.jpg │ │ ├── default_94437de6-ef1b-4d81-9155-e89268d5e797.jpg │ │ ├── default_95b43a69-ab1c-4744-b3ed-28740739bdae.jpg │ │ ├── default_98720824-3cf4-4457-84c8-8a5205734b64.jpg │ │ ├── default_997b76f0-5ce2-43dc-876f-5b9519a11264.jpg │ │ ├── default_9bdc360d-5b25-49d1-94c2-b0dacc7d4b44.jpg │ │ ├── default_9ef1282d-c8c1-424f-bd7c-13f0f49dda22.jpg │ │ ├── default_9fa935d0-9554-4e22-af19-c30ddf95882c.jpg │ │ ├── default_a027a5a3-b203-4c3c-b1f5-c5e1aff3b681.jpg │ │ ├── default_a5eeb0b1-2fbc-4340-81af-2cc5ab9dd423.jpg │ │ ├── default_afbacd6e-f053-4b27-abb9-644c4b24f93c.jpg │ │ ├── default_be001e0d-6412-4cfe-bdae-6e1d98350499.jpg │ │ ├── default_cf5d9625-63f8-431b-bc9a-0a6b0fde0f9d.jpg │ │ ├── default_d224e9a1-ffc0-4dfc-af5c-9d05bbaf2cda.jpg │ │ ├── default_d89e74ee-75bb-48fe-95e5-f1781d52caa0.jpg │ │ ├── default_d99ec159-5ad9-4d11-91f1-bd983ee88fd5.jpg │ │ ├── default_e041b8eb-6297-4ac6-9abd-295de3e250fa.jpg │ │ ├── default_e5e97137-53e2-4e47-b641-681aa51a688f.jpg │ │ ├── default_e969340e-69fe-4de4-8edb-f272c76454f5.jpg │ │ ├── default_e976da69-5c63-4f0c-9273-f4e680556924.jpg │ │ ├── default_ee10be8f-fc1c-4692-9cf8-9560586ec714.jpg │ │ ├── default_f684aba3-60be-47e3-b462-eb7653feddae.jpg │ │ ├── nothing_5d971ba8-0a26-46bf-931f-fca7cc22a66b.jpg │ │ └── nothing_efa8d109-7a01-47fd-9847-077708220842.jpg └── Pokestop │ ├── pokestop_02282517-af6c-445d-8e1e-d8f230c290a7.jpg │ ├── pokestop_026d8705-9dee-467a-9673-71a230096d69.jpg │ ├── pokestop_0c3e6bb0-aaf1-4004-857c-c4824049d7bf.jpg │ ├── pokestop_17868888-1182-4ae7-bc8f-992740b67775.jpg │ ├── pokestop_1b6e9e46-805b-492c-a5c0-8201bdb7bab7.jpg │ ├── pokestop_1fa09022-9aa1-4438-81f3-0b7f95cb92ca.jpg │ ├── pokestop_2909bd1d-be2e-47c3-8032-5ea215e4b9a9.jpg │ ├── pokestop_329d0b72-1075-4339-b87d-344dfd228e4e.jpg │ ├── pokestop_32fac038-ded4-468f-b77a-02ecae96c772.jpg │ ├── pokestop_33d78b9a-de80-4f8b-a0a6-173194ae0cbb.jpg │ ├── pokestop_3739ec3a-71d6-4013-be46-42bd2ad8c59c.jpg │ ├── pokestop_384d1e17-0262-4050-afd2-15cefc1df04f.jpg │ ├── pokestop_49a66cdd-f745-4030-8265-f5a9431097fb.jpg │ ├── pokestop_56ffa79f-7c91-4934-b20d-00d68bd34d16.jpg │ ├── pokestop_638b150f-e13a-41ad-9c63-de46ee5b1c5e.jpg │ ├── pokestop_63d4769a-bb96-49d5-b77a-4efc89530fd2.jpg │ ├── pokestop_64fc0d63-d22a-4a95-a305-5699ca578e9d.jpg │ ├── pokestop_75fcd93d-4875-4c73-97e2-e08e2405f431.jpg │ ├── pokestop_7d5258a2-387f-41b9-80fc-d85030d65524.jpg │ ├── pokestop_7efa1979-d066-4e01-9d20-9807b59805c2.jpg │ ├── pokestop_80cdaefc-4a3a-47e9-a9fb-244393c16a83.jpg │ ├── pokestop_80f5c80e-82c0-440a-a462-8f7c2a20fb3f.jpg │ ├── pokestop_8130c435-be3f-4fb2-a21f-73c28da651d6.jpg │ ├── pokestop_8e83daaf-934d-4029-9867-8d211835085c.jpg │ ├── pokestop_90723191-1174-4d3d-9fa0-4a844a4520fa.jpg │ ├── pokestop_92508418-3700-4866-a939-f73ea31740fc.jpg │ ├── pokestop_9dfb1759-52b0-4a58-bdfc-30576b5c34fa.jpg │ ├── pokestop_b83812dc-aa62-4b15-82e0-5979cdd7858b.jpg │ ├── pokestop_be059234-108e-45ed-a050-702a30967eb6.jpg │ ├── pokestop_cedb3659-e7fe-44d4-922d-fadc6499e478.jpg │ ├── pokestop_d603ee31-3c91-4689-b0be-51ce081c5ff0.jpg │ ├── pokestop_da7d382b-17e5-4571-8005-897191b13fd7.jpg │ ├── pokestop_de291498-1b9d-4dd6-bf14-ea293a616a26.jpg │ ├── pokestop_e348b326-f65f-441f-b0e5-3e7ba7beb337.jpg │ ├── pokestop_e7510b86-0e2c-451c-ae6f-cf416f31ed27.jpg │ ├── pokestop_ec6aa30e-df19-4e29-bf11-e560b408a4e1.jpg │ ├── pokestop_ed05b908-0e6f-414b-884e-8f7323d4896c.jpg │ ├── pokestop_f0859208-f8b6-41c0-b8ea-fc65a0f11b3b.jpg │ ├── pokestop_f0ef63e6-98c9-4a08-ad7b-460fade7bd75.jpg │ ├── pokestop_f29e2f46-12a4-4c40-ba92-9b5100259a10.jpg │ ├── pokestop_f9986784-d08e-4710-a5b6-d3ee692a9d75.jpg │ ├── pokestop_fda7ed5d-46a5-4550-b7a8-3e5c8c5562cf.jpg │ └── pokestop_fe6ba335-9039-48a1-8e1f-91288fbfe9d7.jpg ├── settings.py ├── ImageProcessing ├── GenerateImage.py ├── conv.py ├── MLPictureGen.py └── ImgTools.py ├── requirements.txt ├── testing.py ├── calibrate.py ├── playground.spec ├── README.md ├── ApplicationManagers ├── ProgramController.py └── LinuxWinWrapper.py ├── playground.py ├── catch_pokemon.py ├── gen_images.py ├── InstallationWindows.txt.save └── InstallationWindows.txt /Navigation/SetInventory: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /im.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/im.png -------------------------------------------------------------------------------- /test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/test.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | venv/ 2 | .idea/ 3 | *.__pycache__/ 4 | .idea/ 5 | __pycache__/ -------------------------------------------------------------------------------- /reset_res.sh: -------------------------------------------------------------------------------- 1 | adb shell wm size reset 2 | adb shell wm density reset 3 | -------------------------------------------------------------------------------- /show_pointer_location.sh: -------------------------------------------------------------------------------- 1 | adb shell settings put system pointer_location $1 2 | -------------------------------------------------------------------------------- /CardPrototyping/Functions.py: -------------------------------------------------------------------------------- 1 | def modify_text(text): 2 | return "modify_text modified: " + text 3 | 4 | -------------------------------------------------------------------------------- /test.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | 4 | print(os.getcwd()) 5 | print(sys.version) 6 | print('I AM WORKING NOW') 7 | -------------------------------------------------------------------------------- /models/PokestopDetect/saved_model.pb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/models/PokestopDetect/saved_model.pb -------------------------------------------------------------------------------- /Navigation/assets/home_quest_button.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/Navigation/assets/home_quest_button.PNG -------------------------------------------------------------------------------- /CardPrototyping/card_ADB/scrcpy-server.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/CardPrototyping/card_ADB/scrcpy-server.jar -------------------------------------------------------------------------------- /Navigation/assets/home_pokeball_button.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/Navigation/assets/home_pokeball_button.PNG -------------------------------------------------------------------------------- /get_statusbar_height.sh: -------------------------------------------------------------------------------- 1 | adb shell dumpsys window windows| sed -n '/Window .*StatusBar.*:/,/Window .*:/p'| grep 'Requested' |grep h 2 | -------------------------------------------------------------------------------- /gift_received_profile.json: -------------------------------------------------------------------------------- 1 | {"xy": [0.08148148148148149, 0.6691666666666667], "wh": [0.20833333333333331, 0.09375], "as_percentage": true} -------------------------------------------------------------------------------- /PokemonGo/images/DetectPokestop/ps_spun_col.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/PokemonGo/images/DetectPokestop/ps_spun_col.png -------------------------------------------------------------------------------- /models/PokestopDetect/variables/variables.index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/models/PokestopDetect/variables/variables.index -------------------------------------------------------------------------------- /open_gift_page.json: -------------------------------------------------------------------------------- 1 | {"xy": [0.08333333333333333, 0.6616666666666666], "wh": [0.22129629629629632, 0.10333333333333339], "as_percentage": true} -------------------------------------------------------------------------------- /PokemonGo/images/DetectPokestop/ps_unspun_col.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/PokemonGo/images/DetectPokestop/ps_unspun_col.png -------------------------------------------------------------------------------- /PokemonGo/images/DetectPokestop/ps_walk_closer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/PokemonGo/images/DetectPokestop/ps_walk_closer.png -------------------------------------------------------------------------------- /PokemonGo/images/FriendGifting/open_gift_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/PokemonGo/images/FriendGifting/open_gift_page.png -------------------------------------------------------------------------------- /CardPrototyping/card_ADB/instances_ADB.py: -------------------------------------------------------------------------------- 1 | from .ADB import ADBManager 2 | 3 | android_phone = ADBManager() 4 | android_phone.start_capture('android1') 5 | -------------------------------------------------------------------------------- /PokemonGo/images/DetectPokestop/ps_walk_closer_area.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/PokemonGo/images/DetectPokestop/ps_walk_closer_area.png -------------------------------------------------------------------------------- /PokemonGo/PokestopState.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class PokestopState(Enum): 5 | AVAILABLE = 0, 6 | COOL_DOWN = 1, 7 | TOO_FAR = 2 8 | -------------------------------------------------------------------------------- /PokemonGo/images/FriendGifting/can_send_gift_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/PokemonGo/images/FriendGifting/can_send_gift_profile.png -------------------------------------------------------------------------------- /PokemonGo/images/FriendGifting/can_send_gift_profile2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/PokemonGo/images/FriendGifting/can_send_gift_profile2.png -------------------------------------------------------------------------------- /PokemonGo/images/FriendGifting/gift_received_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/PokemonGo/images/FriendGifting/gift_received_profile.png -------------------------------------------------------------------------------- /PokemonGo/images/FriendGifting/can_send_gift_profile.json: -------------------------------------------------------------------------------- 1 | {"xy": [0.07592592592592592, 0.80625], "wh": [0.23148148148148148, 0.10312500000000002], "as_percentage": true} -------------------------------------------------------------------------------- /PokemonGo/images/FriendGifting/gift_received_profile.json: -------------------------------------------------------------------------------- 1 | {"xy": [0.7055555555555556, 0.803125], "wh": [0.22777777777777775, 0.10416666666666674], "as_percentage": true} -------------------------------------------------------------------------------- /PokemonGo/images/FriendGifting/open_gift_page.json: -------------------------------------------------------------------------------- 1 | {"xy": [0.24814814814814815, 0.7677083333333333], "wh": [0.512962962962963, 0.07395833333333335], "as_percentage": true} -------------------------------------------------------------------------------- /images/Nothing/nothing_0162a137-3714-4ff2-aaea-09fc2a4ae725.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_0162a137-3714-4ff2-aaea-09fc2a4ae725.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_0726de04-feb5-4452-ad14-7d3863889af8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_0726de04-feb5-4452-ad14-7d3863889af8.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_1a25e48f-7eb4-4427-b86e-f29ec65653a3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_1a25e48f-7eb4-4427-b86e-f29ec65653a3.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_374da7a0-05bd-49a0-89c9-ab615d178fcd.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_374da7a0-05bd-49a0-89c9-ab615d178fcd.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_4249aee2-79ed-4c34-829c-59fe838f5159.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_4249aee2-79ed-4c34-829c-59fe838f5159.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_448f0eed-5142-417d-a56b-a2be9f7f427a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_448f0eed-5142-417d-a56b-a2be9f7f427a.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_4582dea6-eb10-4f3d-ae06-517cf6231881.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_4582dea6-eb10-4f3d-ae06-517cf6231881.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_495b14a9-1833-4499-a2db-eb5ca2df0b4d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_495b14a9-1833-4499-a2db-eb5ca2df0b4d.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_4a1105dd-ea9f-4411-8594-74811786367d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_4a1105dd-ea9f-4411-8594-74811786367d.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_4a699823-ee85-489c-b855-f534931d3d47.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_4a699823-ee85-489c-b855-f534931d3d47.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_4da92329-44a8-4b5d-95f0-40defbe404a8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_4da92329-44a8-4b5d-95f0-40defbe404a8.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_5756f752-96a2-4d1b-b3e2-6f28b3d54572.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_5756f752-96a2-4d1b-b3e2-6f28b3d54572.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_57b82416-db54-4114-8e2a-f7bf54756f88.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_57b82416-db54-4114-8e2a-f7bf54756f88.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_57eba2a5-5a41-45b2-adcb-30cc51e888c5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_57eba2a5-5a41-45b2-adcb-30cc51e888c5.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_5a052adf-5d09-4e40-9b26-270612ff687e.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_5a052adf-5d09-4e40-9b26-270612ff687e.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_5c24cbfe-5aa7-4420-97f9-386893c6b349.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_5c24cbfe-5aa7-4420-97f9-386893c6b349.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_5c7911fd-8284-4ed5-a1bc-873172caa486.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_5c7911fd-8284-4ed5-a1bc-873172caa486.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_604d7aea-e36c-4bc8-83db-e7cf3f10d6f6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_604d7aea-e36c-4bc8-83db-e7cf3f10d6f6.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_684a1c00-b1b1-4076-a6ce-32308884e9c7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_684a1c00-b1b1-4076-a6ce-32308884e9c7.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_6c5df17b-6ade-4166-9847-287247bb8983.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_6c5df17b-6ade-4166-9847-287247bb8983.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_6c92abf1-ddc5-4a51-ae7c-167ffdb753fd.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_6c92abf1-ddc5-4a51-ae7c-167ffdb753fd.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_79622bf3-3d5c-434b-99ed-9c0058c6bfca.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_79622bf3-3d5c-434b-99ed-9c0058c6bfca.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_7b4a1a9f-84ae-4b7b-b92f-9d2da520921c.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_7b4a1a9f-84ae-4b7b-b92f-9d2da520921c.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_7bc138f1-732e-4fce-8859-8b259c301463.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_7bc138f1-732e-4fce-8859-8b259c301463.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_7c2ec8e1-48d9-4a90-8495-fef3c359a8e6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_7c2ec8e1-48d9-4a90-8495-fef3c359a8e6.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_7e2f46ff-9cda-4bfc-a548-e16f64901c92.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_7e2f46ff-9cda-4bfc-a548-e16f64901c92.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_7ebf15fd-5d63-4ab0-95a7-7b83d3c540f3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_7ebf15fd-5d63-4ab0-95a7-7b83d3c540f3.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_85c0daf6-8812-4bf7-988a-64785f68f3cb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_85c0daf6-8812-4bf7-988a-64785f68f3cb.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_8647ec48-b16e-4a16-a8aa-e0add4645d52.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_8647ec48-b16e-4a16-a8aa-e0add4645d52.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_8fa140eb-3361-4dd8-bf77-c7a07c9017f9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_8fa140eb-3361-4dd8-bf77-c7a07c9017f9.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_923017f1-27f3-4109-93ad-e9f6ccaedaaf.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_923017f1-27f3-4109-93ad-e9f6ccaedaaf.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_a861073c-dce9-4e2d-b6e5-1a9c352bf4de.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_a861073c-dce9-4e2d-b6e5-1a9c352bf4de.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_acd227ea-67cc-43cf-bc32-16ed5be54269.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_acd227ea-67cc-43cf-bc32-16ed5be54269.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_afb8166a-b539-4a75-9cbb-bb049dfee63b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_afb8166a-b539-4a75-9cbb-bb049dfee63b.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_b2bb1065-874d-4398-b6ad-1d0f32c36053.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_b2bb1065-874d-4398-b6ad-1d0f32c36053.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_bd0673d3-cf11-4922-8cf2-309461e8aacd.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_bd0673d3-cf11-4922-8cf2-309461e8aacd.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_bd284c23-272c-4d99-9212-8911a33530ce.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_bd284c23-272c-4d99-9212-8911a33530ce.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_be9d1f4e-1ab6-40d0-b4fc-0d001cb19aa0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_be9d1f4e-1ab6-40d0-b4fc-0d001cb19aa0.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_c3d03de7-3dfc-4db2-a87e-5c9d96ecee09.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_c3d03de7-3dfc-4db2-a87e-5c9d96ecee09.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_dfe59017-ab67-401a-8ba1-9136af1c4a5a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_dfe59017-ab67-401a-8ba1-9136af1c4a5a.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_f47c384d-2e30-4703-9b57-4b3208fed9a2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_f47c384d-2e30-4703-9b57-4b3208fed9a2.jpg -------------------------------------------------------------------------------- /images/Nothing/nothing_fa177ba3-8358-4b48-b019-2accd0163a62.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Nothing/nothing_fa177ba3-8358-4b48-b019-2accd0163a62.jpg -------------------------------------------------------------------------------- /models/PokestopDetect/variables/variables.data-00000-of-00001: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/models/PokestopDetect/variables/variables.data-00000-of-00001 -------------------------------------------------------------------------------- /images/Gym/bots/default_021873d7-219a-4eeb-b8fb-0d9f8cc5adac.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_021873d7-219a-4eeb-b8fb-0d9f8cc5adac.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_03f8853e-95bd-4506-8df4-fd804ef27b5a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_03f8853e-95bd-4506-8df4-fd804ef27b5a.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_0502e8df-5bc8-49cc-b7e7-ace962383199.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_0502e8df-5bc8-49cc-b7e7-ace962383199.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_11eb7a7a-5d85-4f17-b9e8-83e9dca3e5df.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_11eb7a7a-5d85-4f17-b9e8-83e9dca3e5df.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_12dc9bec-1b02-439c-b0b8-d44007b64e0d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_12dc9bec-1b02-439c-b0b8-d44007b64e0d.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_17feff86-0d6e-4838-9b1a-ed0c8c4d2099.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_17feff86-0d6e-4838-9b1a-ed0c8c4d2099.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_21719dd9-fd82-4964-a82b-35a5b27f02a9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_21719dd9-fd82-4964-a82b-35a5b27f02a9.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_21dd5aa2-e26d-407b-a010-6b8da3d676e1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_21dd5aa2-e26d-407b-a010-6b8da3d676e1.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_2837f09b-d423-42f8-9bac-b8ffe3b5af15.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_2837f09b-d423-42f8-9bac-b8ffe3b5af15.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_2b127b3d-7d9a-4c5f-8a6f-23079ca8ee76.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_2b127b3d-7d9a-4c5f-8a6f-23079ca8ee76.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_3317383f-5c4a-43f3-99ba-de508af4c0e1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_3317383f-5c4a-43f3-99ba-de508af4c0e1.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_35c6695d-3c72-419d-b102-c8375da8a284.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_35c6695d-3c72-419d-b102-c8375da8a284.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_377a6df5-de75-406d-8b91-b70280838846.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_377a6df5-de75-406d-8b91-b70280838846.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_39b78717-d404-4b88-bfd1-287b48d348e0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_39b78717-d404-4b88-bfd1-287b48d348e0.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_49c94242-233d-4a88-b87f-589fd33b0cac.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_49c94242-233d-4a88-b87f-589fd33b0cac.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_51c9844d-ae2a-4616-a80a-01942214b820.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_51c9844d-ae2a-4616-a80a-01942214b820.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_57d2ab28-e9c0-457a-ad45-fca1dc086dd2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_57d2ab28-e9c0-457a-ad45-fca1dc086dd2.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_5c5a2247-f4ab-4bd7-82f6-d85565047a88.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_5c5a2247-f4ab-4bd7-82f6-d85565047a88.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_69d3ce0b-89cd-4b15-bf30-61d574da0de7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_69d3ce0b-89cd-4b15-bf30-61d574da0de7.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_6eae93e1-00fa-463b-a38d-3346f07fe890.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_6eae93e1-00fa-463b-a38d-3346f07fe890.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_74021eda-d852-4ad5-9831-052b22946d2b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_74021eda-d852-4ad5-9831-052b22946d2b.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_7acd8600-5fe7-4a2c-a9ad-aceb19b0dab8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_7acd8600-5fe7-4a2c-a9ad-aceb19b0dab8.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_7cf83abe-f9f3-42f3-88bd-94dc2e4918f3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_7cf83abe-f9f3-42f3-88bd-94dc2e4918f3.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_7e60f293-65ab-4f35-aa70-4fb1cbd8ca20.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_7e60f293-65ab-4f35-aa70-4fb1cbd8ca20.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_8510c57e-f7d2-455d-9872-1f9f0e85e67b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_8510c57e-f7d2-455d-9872-1f9f0e85e67b.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_887d61ad-bf05-41be-ad95-0b3d5992bdab.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_887d61ad-bf05-41be-ad95-0b3d5992bdab.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_8f2cf67b-0499-4467-b3e2-dbe96940b87d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_8f2cf67b-0499-4467-b3e2-dbe96940b87d.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_9128fca8-7446-4c97-a829-117639226b6c.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_9128fca8-7446-4c97-a829-117639226b6c.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_91a000f8-c9a4-4c8c-b924-5d188ac52ba8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_91a000f8-c9a4-4c8c-b924-5d188ac52ba8.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_93127810-b859-4b3b-9d85-00dd4e58e395.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_93127810-b859-4b3b-9d85-00dd4e58e395.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_94437de6-ef1b-4d81-9155-e89268d5e797.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_94437de6-ef1b-4d81-9155-e89268d5e797.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_95b43a69-ab1c-4744-b3ed-28740739bdae.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_95b43a69-ab1c-4744-b3ed-28740739bdae.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_98720824-3cf4-4457-84c8-8a5205734b64.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_98720824-3cf4-4457-84c8-8a5205734b64.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_997b76f0-5ce2-43dc-876f-5b9519a11264.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_997b76f0-5ce2-43dc-876f-5b9519a11264.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_9bdc360d-5b25-49d1-94c2-b0dacc7d4b44.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_9bdc360d-5b25-49d1-94c2-b0dacc7d4b44.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_9ef1282d-c8c1-424f-bd7c-13f0f49dda22.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_9ef1282d-c8c1-424f-bd7c-13f0f49dda22.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_9fa935d0-9554-4e22-af19-c30ddf95882c.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_9fa935d0-9554-4e22-af19-c30ddf95882c.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_a027a5a3-b203-4c3c-b1f5-c5e1aff3b681.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_a027a5a3-b203-4c3c-b1f5-c5e1aff3b681.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_a5eeb0b1-2fbc-4340-81af-2cc5ab9dd423.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_a5eeb0b1-2fbc-4340-81af-2cc5ab9dd423.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_afbacd6e-f053-4b27-abb9-644c4b24f93c.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_afbacd6e-f053-4b27-abb9-644c4b24f93c.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_be001e0d-6412-4cfe-bdae-6e1d98350499.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_be001e0d-6412-4cfe-bdae-6e1d98350499.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_cf5d9625-63f8-431b-bc9a-0a6b0fde0f9d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_cf5d9625-63f8-431b-bc9a-0a6b0fde0f9d.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_d224e9a1-ffc0-4dfc-af5c-9d05bbaf2cda.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_d224e9a1-ffc0-4dfc-af5c-9d05bbaf2cda.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_d89e74ee-75bb-48fe-95e5-f1781d52caa0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_d89e74ee-75bb-48fe-95e5-f1781d52caa0.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_d99ec159-5ad9-4d11-91f1-bd983ee88fd5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_d99ec159-5ad9-4d11-91f1-bd983ee88fd5.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_e041b8eb-6297-4ac6-9abd-295de3e250fa.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_e041b8eb-6297-4ac6-9abd-295de3e250fa.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_e5e97137-53e2-4e47-b641-681aa51a688f.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_e5e97137-53e2-4e47-b641-681aa51a688f.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_e969340e-69fe-4de4-8edb-f272c76454f5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_e969340e-69fe-4de4-8edb-f272c76454f5.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_e976da69-5c63-4f0c-9273-f4e680556924.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_e976da69-5c63-4f0c-9273-f4e680556924.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_ee10be8f-fc1c-4692-9cf8-9560586ec714.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_ee10be8f-fc1c-4692-9cf8-9560586ec714.jpg -------------------------------------------------------------------------------- /images/Gym/bots/default_f684aba3-60be-47e3-b462-eb7653feddae.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/default_f684aba3-60be-47e3-b462-eb7653feddae.jpg -------------------------------------------------------------------------------- /images/Gym/bots/nothing_5d971ba8-0a26-46bf-931f-fca7cc22a66b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/nothing_5d971ba8-0a26-46bf-931f-fca7cc22a66b.jpg -------------------------------------------------------------------------------- /images/Gym/bots/nothing_efa8d109-7a01-47fd-9847-077708220842.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Gym/bots/nothing_efa8d109-7a01-47fd-9847-077708220842.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_02282517-af6c-445d-8e1e-d8f230c290a7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_02282517-af6c-445d-8e1e-d8f230c290a7.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_026d8705-9dee-467a-9673-71a230096d69.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_026d8705-9dee-467a-9673-71a230096d69.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_0c3e6bb0-aaf1-4004-857c-c4824049d7bf.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_0c3e6bb0-aaf1-4004-857c-c4824049d7bf.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_17868888-1182-4ae7-bc8f-992740b67775.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_17868888-1182-4ae7-bc8f-992740b67775.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_1b6e9e46-805b-492c-a5c0-8201bdb7bab7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_1b6e9e46-805b-492c-a5c0-8201bdb7bab7.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_1fa09022-9aa1-4438-81f3-0b7f95cb92ca.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_1fa09022-9aa1-4438-81f3-0b7f95cb92ca.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_2909bd1d-be2e-47c3-8032-5ea215e4b9a9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_2909bd1d-be2e-47c3-8032-5ea215e4b9a9.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_329d0b72-1075-4339-b87d-344dfd228e4e.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_329d0b72-1075-4339-b87d-344dfd228e4e.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_32fac038-ded4-468f-b77a-02ecae96c772.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_32fac038-ded4-468f-b77a-02ecae96c772.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_33d78b9a-de80-4f8b-a0a6-173194ae0cbb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_33d78b9a-de80-4f8b-a0a6-173194ae0cbb.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_3739ec3a-71d6-4013-be46-42bd2ad8c59c.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_3739ec3a-71d6-4013-be46-42bd2ad8c59c.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_384d1e17-0262-4050-afd2-15cefc1df04f.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_384d1e17-0262-4050-afd2-15cefc1df04f.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_49a66cdd-f745-4030-8265-f5a9431097fb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_49a66cdd-f745-4030-8265-f5a9431097fb.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_56ffa79f-7c91-4934-b20d-00d68bd34d16.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_56ffa79f-7c91-4934-b20d-00d68bd34d16.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_638b150f-e13a-41ad-9c63-de46ee5b1c5e.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_638b150f-e13a-41ad-9c63-de46ee5b1c5e.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_63d4769a-bb96-49d5-b77a-4efc89530fd2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_63d4769a-bb96-49d5-b77a-4efc89530fd2.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_64fc0d63-d22a-4a95-a305-5699ca578e9d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_64fc0d63-d22a-4a95-a305-5699ca578e9d.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_75fcd93d-4875-4c73-97e2-e08e2405f431.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_75fcd93d-4875-4c73-97e2-e08e2405f431.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_7d5258a2-387f-41b9-80fc-d85030d65524.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_7d5258a2-387f-41b9-80fc-d85030d65524.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_7efa1979-d066-4e01-9d20-9807b59805c2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_7efa1979-d066-4e01-9d20-9807b59805c2.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_80cdaefc-4a3a-47e9-a9fb-244393c16a83.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_80cdaefc-4a3a-47e9-a9fb-244393c16a83.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_80f5c80e-82c0-440a-a462-8f7c2a20fb3f.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_80f5c80e-82c0-440a-a462-8f7c2a20fb3f.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_8130c435-be3f-4fb2-a21f-73c28da651d6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_8130c435-be3f-4fb2-a21f-73c28da651d6.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_8e83daaf-934d-4029-9867-8d211835085c.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_8e83daaf-934d-4029-9867-8d211835085c.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_90723191-1174-4d3d-9fa0-4a844a4520fa.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_90723191-1174-4d3d-9fa0-4a844a4520fa.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_92508418-3700-4866-a939-f73ea31740fc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_92508418-3700-4866-a939-f73ea31740fc.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_9dfb1759-52b0-4a58-bdfc-30576b5c34fa.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_9dfb1759-52b0-4a58-bdfc-30576b5c34fa.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_b83812dc-aa62-4b15-82e0-5979cdd7858b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_b83812dc-aa62-4b15-82e0-5979cdd7858b.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_be059234-108e-45ed-a050-702a30967eb6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_be059234-108e-45ed-a050-702a30967eb6.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_cedb3659-e7fe-44d4-922d-fadc6499e478.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_cedb3659-e7fe-44d4-922d-fadc6499e478.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_d603ee31-3c91-4689-b0be-51ce081c5ff0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_d603ee31-3c91-4689-b0be-51ce081c5ff0.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_da7d382b-17e5-4571-8005-897191b13fd7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_da7d382b-17e5-4571-8005-897191b13fd7.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_de291498-1b9d-4dd6-bf14-ea293a616a26.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_de291498-1b9d-4dd6-bf14-ea293a616a26.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_e348b326-f65f-441f-b0e5-3e7ba7beb337.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_e348b326-f65f-441f-b0e5-3e7ba7beb337.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_e7510b86-0e2c-451c-ae6f-cf416f31ed27.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_e7510b86-0e2c-451c-ae6f-cf416f31ed27.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_ec6aa30e-df19-4e29-bf11-e560b408a4e1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_ec6aa30e-df19-4e29-bf11-e560b408a4e1.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_ed05b908-0e6f-414b-884e-8f7323d4896c.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_ed05b908-0e6f-414b-884e-8f7323d4896c.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_f0859208-f8b6-41c0-b8ea-fc65a0f11b3b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_f0859208-f8b6-41c0-b8ea-fc65a0f11b3b.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_f0ef63e6-98c9-4a08-ad7b-460fade7bd75.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_f0ef63e6-98c9-4a08-ad7b-460fade7bd75.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_f29e2f46-12a4-4c40-ba92-9b5100259a10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_f29e2f46-12a4-4c40-ba92-9b5100259a10.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_f9986784-d08e-4710-a5b6-d3ee692a9d75.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_f9986784-d08e-4710-a5b6-d3ee692a9d75.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_fda7ed5d-46a5-4550-b7a8-3e5c8c5562cf.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_fda7ed5d-46a5-4550-b7a8-3e5c8c5562cf.jpg -------------------------------------------------------------------------------- /images/Pokestop/pokestop_fe6ba335-9039-48a1-8e1f-91288fbfe9d7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Occy88/bots/HEAD/images/Pokestop/pokestop_fe6ba335-9039-48a1-8e1f-91288fbfe9d7.jpg -------------------------------------------------------------------------------- /CardPrototyping/card_Human/instances_Human.py: -------------------------------------------------------------------------------- 1 | from CardPrototyping.card_Human.Human import Human 2 | 3 | octavio = Human("octavio") 4 | joe = Human("joe") 5 | mark = Human("mark") 6 | -------------------------------------------------------------------------------- /settings.py: -------------------------------------------------------------------------------- 1 | # 1. For showing the bot output on your computer sreen 2 | SCREEN_SCALE_FACTOR = 0.5 3 | 4 | # 2. For adjusting rendering due to Notification bar (top) not completely removed 5 | NOTiFICATION_BAR_RESCALE = False 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CardPrototyping/card_ReceiveProcessText/instances_ReceiveText.py: -------------------------------------------------------------------------------- 1 | from CardPrototyping.card_Human.instances_Human import octavio, joe 2 | from CardPrototyping.card_ReceiveProcessText.ReceiveText import ReceiveText 3 | 4 | tell_humans = ReceiveText() 5 | tell_humans.do_send_msg_complete(octavio.do_say,10) 6 | tell_humans.do_send_msg_complete(joe.do_say) 7 | -------------------------------------------------------------------------------- /Navigation/tests/test_Locationtest.py: -------------------------------------------------------------------------------- 1 | from ApplicationManagers.ProgramController import ProgramController 2 | 3 | p = ProgramController('scrcpy.exe', 'SM-G9650', 0) 4 | p.window.prepare_screenshot() 5 | s = p.window.get_latest_screenshot() 6 | 7 | from Navigation.LocationTest import test_home 8 | 9 | test_home(s) 10 | p.window.release() 11 | -------------------------------------------------------------------------------- /ImageProcessing/GenerateImage.py: -------------------------------------------------------------------------------- 1 | from ImageProcessing import conv 2 | from ImageProcessing import ImgTools 3 | from ImageProcessing import MLPictureGen 4 | import time 5 | 6 | gen=MLPictureGen.MLPictureGen('adb') 7 | time.sleep(5) 8 | img_name='open_gift_page' 9 | # img_name='gift_received_profile' 10 | path='../PokemonGo/images/FriendGifting/' 11 | gen.capture_on_two_click(img_name,path) 12 | # gen.test_image(path,img_name) 13 | time.sleep(100) -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | appdirs==1.4.4 2 | av==8.0.3 3 | cycler==0.10.0 4 | distlib==0.3.1 5 | filelock==3.0.12 6 | kiwisolver==1.3.1 7 | libusb1==1.9.2 8 | M2CryptoWin64==0.21.1.post3 9 | matplotlib==3.3.4 10 | numpy==1.20.1 11 | opencv-python==4.5.1.48 12 | parameterized==0.8.1 13 | Pillow==8.1.2 14 | pyparsing==2.4.7 15 | python-dateutil==2.8.1 16 | #pywin32==300 17 | scipy==1.6.1 18 | six==1.15.0 19 | typing==3.7.4.3 20 | virtualenv==20.4.2 21 | -------------------------------------------------------------------------------- /CardPrototyping/card_Human/Human.py: -------------------------------------------------------------------------------- 1 | from CardPrototyping.GenericCard import GenericCardTemplate 2 | 3 | 4 | class Human(GenericCardTemplate()): 5 | def __init__(self, name): 6 | super().__init__(self) 7 | self.name = name 8 | 9 | def do_say(self, words=''): 10 | print(self.name, " SAID: ", words) 11 | 12 | def do_move(self, x, y): 13 | self.x = x 14 | self.y = y 15 | print("HUMAN HAS MOVED: ", x, y) 16 | -------------------------------------------------------------------------------- /CardPrototyping/card_Windows/utils.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import psutil 3 | 4 | 5 | def get_process_by_name(name): 6 | processes = psutil.process_iter() 7 | 8 | for p in processes: 9 | try: 10 | process_name = p.name() 11 | pid = p.pid 12 | if process_name == name: 13 | return p 14 | except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess): 15 | pass 16 | 17 | -------------------------------------------------------------------------------- /CardPrototyping/shutdown.py: -------------------------------------------------------------------------------- 1 | import os 2 | if os.name=='nt': 3 | import signal 4 | import signal 5 | # def shutdown(handler): 6 | # try: 7 | # signal.signal(signal.SIGINT, ._shutdown) 8 | # signal.signal(signal.SIGTERM, ._shutdown) 9 | # # signal.signal(signal.SIGKILL, ._shutdown) 10 | # signal.signal(signal.SIGQUIT, ._shutdown) 11 | # signal.signal(signal.SIGHUP, self._shutdown) 12 | # except Exception as e: 13 | # pass -------------------------------------------------------------------------------- /CardPrototyping/card_ReceiveProcessText/ReceiveText.py: -------------------------------------------------------------------------------- 1 | # imports change_text from ChangeText 2 | from CardPrototyping.GenericCard import GenericCardTemplate 3 | 4 | 5 | class ReceiveText(GenericCardTemplate()): 6 | """ 7 | Print C 8 | """ 9 | 10 | def do_send_msg(self, text): 11 | """ 12 | receives text, 13 | :param text: 14 | :return: 15 | """ 16 | text = "do_msg_modified " + text 17 | print("MSG Received, (modified a bit) : ", text) 18 | pass 19 | -------------------------------------------------------------------------------- /testing.py: -------------------------------------------------------------------------------- 1 | import time 2 | 3 | from ImageProcessing.ImgTools import crop_img_percent, save_img, show_img 4 | from ApplicationManagers.ProgramController import * 5 | 6 | WINDOW_TITLE = '' 7 | p = ProgramController(WINDOW_TITLE) 8 | p.program.start_capture('adb') 9 | time.sleep(10) 10 | s = p.program.get_latest_screenshot() 11 | 12 | # print(s) 13 | s = crop_img_percent(s, 0, .3, 1, .5) 14 | from PokemonGo.DetectPokestop import clean_img 15 | 16 | s = clean_img([s])[0] 17 | # show_img(s) 18 | save_img(s, 'pokestop_detect', True) 19 | p.program.stop_all_threads() 20 | -------------------------------------------------------------------------------- /PokemonGo/SpinPokestop.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class Spin(Enum): 5 | """ 6 | Response codes for effect of spin on pokestop. 7 | 8 | SUCCESS: pokestop spun successfully 9 | FAIL: pokestop can't be spun (cooldown try again later etc...) 10 | ERROR: pokestop can't be detected. 11 | """ 12 | SUCCESS = 1, 13 | ALREADY_SPUN=2 14 | FAIL=3, 15 | ERROR = 3, 16 | 17 | 18 | def spin(): 19 | """ 20 | Spins a pokestop, assumes it is in the center of the screen, 21 | Detects the message response, Returns said response. 22 | :return: CODE for response 23 | """ 24 | -------------------------------------------------------------------------------- /Navigation/configs.py: -------------------------------------------------------------------------------- 1 | HOME_BUTTON_LOCATION = { 2 | 'x': 0.3975346687211094, 3 | 'y': 0.8395522388059702, 4 | 'w': 0.6070878274268104 - 0.3975346687211094, 5 | 'h': 0.9022388059701493 - 0.8395522388059702 6 | } 7 | 8 | QUEST_BUTTON_LOCATION={ 9 | 'x': 0.847457627118644, 10 | 'y': 0.7895522388059701, 11 | 'w': 0.9738058551617874 - 0.847457627118644, 12 | 'h': 0.8395522388059702 - 0.7895522388059701 13 | } 14 | # -2263147.0 -2466806.75 15 | # 27703920.0 4501372.5 16 | # -3521657.75 -112152.3515625 17 | # 3521657.75 172998.3125 18 | 19 | 20 | # 6,968,178 21 | # 285,150 22 | 23 | # 29,967,067 24 | # 7,043,314 -------------------------------------------------------------------------------- /calibrate.py: -------------------------------------------------------------------------------- 1 | from CardPrototyping.card_SendGifts.SendGifts import SendGifts 2 | import time 3 | 4 | def main(): 5 | 6 | t = SendGifts("some name") 7 | 8 | t.calibrate() 9 | time.sleep(100) 10 | if __name__ == '__main__': 11 | main() 12 | # {'on_msg': {'args': ('hello world',), 'kwargs': {}, -1: [], 10: [.GenericCard.__generic_callback_template..__generic_callback of >], 5: [.GenericCard.__generic_callback_template..__generic_callback of >], 'returned_args': [None]}} 13 | -------------------------------------------------------------------------------- /CardPrototyping/link_test.py: -------------------------------------------------------------------------------- 1 | # test this shit 2 | from CardPrototyping.GenericCard import GenericCardTemplate 3 | 4 | 5 | class ChangeText(GenericCardTemplate()): 6 | def do_call(self, arg='hello world'): 7 | print("PROCESS TEXT RECEIVED: : ", arg) 8 | arg = arg + " some modification" 9 | return arg 10 | 11 | def do_method(self): 12 | return None 13 | 14 | def other_method(self, args): 15 | return args 16 | 17 | # def example(): 18 | # adb_manager_card.do_frame_update_complete(card_test_card.my_fun_bot, 20) 19 | # card_test_card.do_swipe_complete(adb_manager_card.swipe) 20 | # 21 | # # some random sleep to decide how long you want the above to run for :D 22 | # import time 23 | # time.sleep(run_time) 24 | -------------------------------------------------------------------------------- /Navigation/LocationTest.py: -------------------------------------------------------------------------------- 1 | from ImageProcessing.ImgTools import crop_img_percent 2 | from ImageProcessing.ImgTools import template_match 3 | from Navigation.configs import QUEST_BUTTON_LOCATION as qb 4 | from Navigation.configs import HOME_BUTTON_LOCATION as hb 5 | 6 | 7 | def test_home(img): 8 | """ 9 | Current test is check if the orange spectacles are in the correct location 10 | and if the pokeball in the bottom center is there as well. (a double test 11 | for redundancy) 12 | :param img: 13 | :return: 14 | """ 15 | home_b = crop_img_percent(img, **hb) 16 | quest_b = crop_img_percent(img, **qb) 17 | res= template_match(home_b, 'Navigation\\assets\\home_pokeball_button.PNG') 18 | res2 = template_match(quest_b, 'Navigation\\assets\\home_quest_button.PNG') 19 | thresh=0.7 20 | if res2.max()>thresh and res.max()>thresh: 21 | print("TRUE") 22 | return True 23 | print("False, ",res.max(),res2.max()) 24 | return False 25 | -------------------------------------------------------------------------------- /playground.spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python ; coding: utf-8 -*- 2 | 3 | block_cipher = None 4 | 5 | 6 | a = Analysis(['playground.py'], 7 | pathex=['/home/caramel/PycharmProjects/bots'], 8 | binaries=[], 9 | datas=[], 10 | hiddenimports=[], 11 | hookspath=[], 12 | runtime_hooks=[], 13 | excludes=[], 14 | win_no_prefer_redirects=False, 15 | win_private_assemblies=False, 16 | cipher=block_cipher, 17 | noarchive=False) 18 | pyz = PYZ(a.pure, a.zipped_data, 19 | cipher=block_cipher) 20 | exe = EXE(pyz, 21 | a.scripts, 22 | [], 23 | exclude_binaries=True, 24 | name='playground', 25 | debug=False, 26 | bootloader_ignore_signals=False, 27 | strip=False, 28 | upx=True, 29 | console=True ) 30 | coll = COLLECT(exe, 31 | a.binaries, 32 | a.zipfiles, 33 | a.datas, 34 | strip=False, 35 | upx=True, 36 | upx_exclude=[], 37 | name='playground') 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # bots 2 | Welcome to the generic bot platform 3 | 4 | Please make sure you install the requirements.txt 5 | pip3 install -r requirements.txt 6 | 7 | The android phone manager (screeshot, video streaming etc ) is under Application managers 8 | 9 | 10 | I broke things down into "cards" this just was some prototyping I was doing to simplify chaining events (for a larger overall project,) 11 | The pokemon go bot came out as a side product, i've made a vew other ones. 12 | 13 | just treat them as classes. 14 | 15 | the sending gifts program is in playground.py (it uses CardPrototyping/card_SendGrifts module 16 | 17 | it's a very easy run: 18 | 19 | on the phone order friends by can receive 20 | go on the first profile 21 | 22 | execute the file playground.py from root 23 | 24 | make sure your phone is connected via cable and you have adb installed 25 | 26 | there are many tools available in img_tools and throughout this project, feel free to explore document improove. 27 | i've made a tool to train images easily (with tensorflow) and save models/reload them when needed 28 | have some sample code for that as well somewhere, but this is mainly a fun place to explore and build bots. 29 | 30 | -------------------------------------------------------------------------------- /CardPrototyping/CardTest.py: -------------------------------------------------------------------------------- 1 | """ 2 | Simple card takes image from android, 3 | displays it, 4 | finds pokestops, 5 | clicks on pokestop locations 6 | """ 7 | 8 | from CardPrototyping.GenericCard import GenericCardTemplate 9 | from ImageProcessing.ImgTools import show_img, crop_img_percent 10 | from PokemonGo.DetectPokestop import pokestop_detector 11 | 12 | print("DECLARING CARD TEST CLASS") 13 | 14 | 15 | class CardTest(GenericCardTemplate()): 16 | """ 17 | An example class connecting with another one 18 | 19 | my fun bot recieves accepts an image and calls the swipe callback 20 | with the coordinates identified. 21 | """ 22 | 23 | def __init__(self): 24 | super().__init__() 25 | 26 | def do_bot_recieve_img(self, img): 27 | """ 28 | receives image, returns coordinates to swipe from and to 29 | :param img: 30 | :return: 31 | """ 32 | print("DETECTING LOCATIONS") 33 | img = crop_img_percent(img, 0, .4, 1, .4) 34 | # show_img(img) 35 | img1, (img2, num_loc) = pokestop_detector.find_locations(img) 36 | # show_img(img1) 37 | # show_img(img2) 38 | # print(num_loc) 39 | print("SWIPING") 40 | return (50, 100), (50, 20) 41 | 42 | 43 | print('DECLARED NOW INSTANTIATING') 44 | card_test_card = CardTest() 45 | -------------------------------------------------------------------------------- /CardPrototyping/card_TransferAllPokemon/TransferPokemon.py: -------------------------------------------------------------------------------- 1 | from CardPrototyping.GenericCard import GenericCardTemplate 2 | from CardPrototyping.card_ADB.instances_ADB import android_phone 3 | 4 | step1 = (130, 450) 5 | step2 = (625, 1300) 6 | step3 = (620, 1160) 7 | step4 = (370, 800) 8 | step5 = (370, 730) 9 | extra_l_d = 2.2 10 | long_d = 1.8 11 | med_d = 1.3 12 | short_d = 0.7 13 | import time 14 | 15 | ... 16 | 17 | 18 | class TransferPokemon(GenericCardTemplate()): 19 | def __init__(self, name): 20 | super().__init__(self) 21 | self.name = name 22 | 23 | def print_click(self, *args, **kwargs): 24 | print(args, kwargs) 25 | 26 | def do_transfer(self, num_pokemon): 27 | print("initiating transfer routine in 10s") 28 | time.sleep(10) 29 | print("initiating for: ") 30 | for i in range(num_pokemon): 31 | print(i / num_pokemon, '% left: ', num_pokemon - i) 32 | 33 | android_phone.swipe(step1, step1) 34 | time.sleep(long_d) 35 | android_phone.swipe(step2, step2) 36 | time.sleep(short_d) 37 | android_phone.swipe(step3, step3) 38 | time.sleep(short_d) 39 | android_phone.swipe(step4, step4) 40 | time.sleep(med_d) 41 | android_phone.swipe(step5, step5) 42 | time.sleep(long_d) 43 | 44 | 45 | t = TransferPokemon("some name") 46 | android_phone.do_mouse_event_complete(t.print_click) 47 | # t.do_transfer(5) 48 | time.sleep(100) -------------------------------------------------------------------------------- /ApplicationManagers/ProgramController.py: -------------------------------------------------------------------------------- 1 | from CardPrototyping.card_Windows.utils import get_process_by_name 2 | 3 | try: 4 | from CardPrototyping.card_Windows.Windows import Win32Wrapper as program 5 | except Exception as e: 6 | print("NOT WINDOWS, ASSUMING ADB.") 7 | from CardPrototyping.card_ADB.instances_ADB import android_phone as program 8 | import psutil 9 | 10 | PROGRAM_NAME = 'scrcpy.exe' 11 | program_TITLE = "SM-G9650" 12 | test = 'Device Manager' 13 | 14 | 15 | class ProgramController: 16 | def __init__(self, program_title): 17 | print('initiating program') 18 | 19 | self.program = program 20 | self.options = { 21 | '0': ('quit', lambda: None), 22 | '1': ('start preview', self.program), 23 | } 24 | 25 | def run(self): 26 | while True: 27 | val = self.control() 28 | if val == self.options['0']: 29 | break 30 | 31 | def control(self): 32 | command = input('Please choose option: ') 33 | if command in self.options: 34 | self.options[command][1]() 35 | else: 36 | print("you chose an invalid option.") 37 | 38 | def get_program(self, program_name): 39 | program = get_process_by_name(program_name) 40 | if not type(program) == psutil.Process: 41 | raise Exception("Program not found") 42 | else: 43 | print("program FOUND") 44 | return program 45 | 46 | # ProgramController(PROGRAM_NAME,program_TITLE,0) 47 | -------------------------------------------------------------------------------- /playground.py: -------------------------------------------------------------------------------- 1 | # from PokemonGo.DetectPokestop import pokestop_detector 2 | # from CardPrototyping.Functions import modify_text 3 | # from CardPrototyping.card_ReceiveProcessText.instances_ReceiveText import tell_humans 4 | # from CardPrototyping.card_ADB.instances_ADB import android_phone 5 | # from PokemonGo.DetectPokestop import find_locations 6 | from CardPrototyping.card_SendGifts.SendGifts import SendGifts 7 | import time 8 | # from CardPrototyping.card_ADB.instances_ADB import android_phone 9 | def main(): 10 | # print("+++++++++++++SENT SIGNAL TO PROCESS TEXT+++++++++++") 11 | # android_phone.do_frame_update_complete(find_locations, 20) 12 | # android_phone.do_frame_update_complete(find_locations,-1) 13 | # android_phone.do_frame_update_complete(find_locations,10) 14 | # 15 | # 16 | # input("enter to stop") 17 | 18 | t = SendGifts("some name") 19 | 20 | # android_phone.do_mouse_event_complete(t.print_click) 21 | t.do_send_gifts() 22 | # t.do_transfer(5) 23 | time.sleep(100) 24 | 25 | 26 | if __name__ == '__main__': 27 | main() 28 | # {'on_msg': {'args': ('hello world',), 'kwargs': {}, -1: [], 10: [.GenericCard.__generic_callback_template..__generic_callback of >], 5: [.GenericCard.__generic_callback_template..__generic_callback of >], 'returned_args': [None]}} 29 | -------------------------------------------------------------------------------- /catch_pokemon.py: -------------------------------------------------------------------------------- 1 | # from PokemonGo.DetectPokestop import pokestop_detector 2 | # from CardPrototyping.Functions import modify_text 3 | # from CardPrototyping.card_ReceiveProcessText.instances_ReceiveText import tell_humans 4 | # from CardPrototyping.card_ADB.instances_ADB import android_phone 5 | # from PokemonGo.DetectPokestop import find_locations 6 | from CardPrototyping.card_CatchPokemon.CatchPokemon import CatchPokemon 7 | import time 8 | # from CardPrototyping.card_ADB.instances_ADB import android_phone 9 | def main(): 10 | # print("+++++++++++++SENT SIGNAL TO PROCESS TEXT+++++++++++") 11 | # android_phone.do_frame_update_complete(find_locations, 20) 12 | # android_phone.do_frame_update_complete(find_locations,-1) 13 | # android_phone.do_frame_update_complete(find_locations,10) 14 | # 15 | # 16 | # input("enter to stop") 17 | 18 | t = CatchPokemon("some name") 19 | 20 | # android_phone.do_mouse_event_complete(t.print_click) 21 | t.catch_pokemon() 22 | # t.do_transfer(5) 23 | time.sleep(100) 24 | 25 | 26 | if __name__ == '__main__': 27 | main() 28 | # {'on_msg': {'args': ('hello world',), 'kwargs': {}, -1: [], 10: [.GenericCard.__generic_callback_template..__generic_callback of >], 5: [.GenericCard.__generic_callback_template..__generic_callback of >], 'returned_args': [None]}} 29 | -------------------------------------------------------------------------------- /gen_images.py: -------------------------------------------------------------------------------- 1 | from ImageProcessing.MLPictureGen import MLPictureGen 2 | # from ImageProcessing.ImgTools import img_col_similarity, crop_img 3 | from CardPrototyping.card_ADB.instances_ADB import android_phone 4 | 5 | android_phone.set_resolution() 6 | import time 7 | 8 | 9 | # from CardPrototyping.card_ADB.instances_ADB import android_phone 10 | def main(): 11 | # print("+++++++++++++SENT SIGNAL TO PROCESS TEXT+++++++++++") 12 | # android_phone.do_frame_update_complete(find_locations, 20) 13 | # android_phone.do_frame_update_complete(find_locations,-1) 14 | # android_phone.do_frame_update_complete(find_locations,10) 15 | # 16 | # 17 | # input("enter to stop") 18 | from ImageProcessing.ImgTools import load_img, show_img, resize_img, resize_bigger_to_smaller_img, \ 19 | img_col_similarity 20 | # show_img(orig) 21 | # 22 | # res = resize_img(orig, 0.7, percent=True) 23 | # show_img(res) 24 | # orig, res = resize_bigger_to_smaller_img(orig, res) 25 | # show_img(orig) 26 | # show_img(res) 27 | # print(img_col_similarity(orig,res)) 28 | 29 | m = MLPictureGen() 30 | 31 | # m.capture_on_two_click('open_gift_page', './PokemonGo/images/FriendGifting/') 32 | # m.capture_on_two_click('gift_received_profile', './PokemonGo/images/FriendGifting/') 33 | m.capture_on_two_click('can_send_gift_profile', './PokemonGo/images/FriendGifting/') 34 | time.sleep(100) 35 | 36 | # while True: 37 | # m.test_image('./PokemonGo/images/FriendGifting/', 'can_send_gift_profile') 38 | # time.sleep(100) 39 | 40 | 41 | if __name__ == '__main__': 42 | main() 43 | # {'on_msg': {'args': ('hello world',), 'kwargs': {}, -1: [], 10: [.GenericCard.__generic_callback_template..__generic_callback of >], 5: [.GenericCard.__generic_callback_template..__generic_callback of >], 'returned_args': [None]}} 44 | -------------------------------------------------------------------------------- /CardPrototyping/card_ADB/control.py: -------------------------------------------------------------------------------- 1 | import struct 2 | from time import sleep 3 | 4 | 5 | class ControlMixin: 6 | ACTION_MOVE = b'\x02' 7 | ACTION_DOWN = b'\x00' 8 | ACTION_UP = b'\x01' 9 | 10 | # Define in base class 11 | resolution = None 12 | control_socket = None 13 | 14 | def _build_touch_message(self, x, y, action): 15 | b = bytearray(b'\x02') 16 | b += action 17 | b += b'\xff\xff\xff\xff\xff\xff\xff\xff' 18 | b += struct.pack('>I', int(x)) 19 | b += struct.pack('>I', int(y)) 20 | b += struct.pack('>h', int(self.resolution[0])) 21 | b += struct.pack('>h', int(self.resolution[1])) 22 | b += b'\xff\xff' # Pressure 23 | b += b'\x00\x00\x00\x01' # Event button primary 24 | return bytes(b) 25 | 26 | def hold(self, x, y): 27 | self.control_socket.send(self._build_touch_message(x=x, y=y, action=self.ACTION_DOWN)) 28 | 29 | def release(self, x, y): 30 | self.control_socket.send(self._build_touch_message(x=x, y=y, action=self.ACTION_UP)) 31 | 32 | def swipe(self, start_x, start_y, end_x, end_y, step_pixels=5, step_delay=0.05): 33 | self.control_socket.send(self._build_touch_message(x=start_x, y=start_y, action=self.ACTION_DOWN)) 34 | import time 35 | next_x = start_x 36 | next_y = start_y 37 | 38 | if end_x > self.resolution[0]: 39 | end_x = self.resolution[0] 40 | 41 | if end_y > self.resolution[1]: 42 | end_y = self.resolution[1] 43 | 44 | decrease_x = True if start_x > end_x else False 45 | decrease_y = True if start_y > end_y else False 46 | while True: 47 | if decrease_x: 48 | next_x -= step_pixels 49 | if next_x < end_x: 50 | next_x = end_x 51 | else: 52 | next_x += step_pixels 53 | if next_x > end_x: 54 | next_x = end_x 55 | 56 | if decrease_y: 57 | next_y -= step_pixels 58 | if next_y < end_y: 59 | next_y = end_y 60 | else: 61 | next_y += step_pixels 62 | if next_y > end_y: 63 | next_y = end_y 64 | 65 | self.control_socket.send(self._build_touch_message(x=next_x, y=next_y, action=self.ACTION_MOVE)) 66 | 67 | if next_x == end_x and next_y == end_y: 68 | self.control_socket.send(self._build_touch_message(x=next_x, y=next_y, action=self.ACTION_UP)) 69 | break 70 | sleep(step_delay) 71 | -------------------------------------------------------------------------------- /InstallationWindows.txt.save: -------------------------------------------------------------------------------- 1 | Instructions to get started on windows, we will be using the powershell but don't worry it's mostly copy pasting. 2 | Any issues let me know, but it should be quire straight forward ;D 3 | 1. install chocolatey: 4 | - reason: this is to make installation of python/ packages easier. 5 | - result: when you enter choco into terminal, there should be some meaningful output. 6 | (it's very easy, just follow instructions) 7 | - link to instruction: https://chocolatey.org/install 8 | or: 9 | - Express instructions: 10 | open powershell in administrator mode and paste the following: 11 | Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) 12 | 13 | 14 | 15 | 1.1. install adb: 16 | - reason: we use this to communicate with the phone: 17 | execute: 18 | choco install adb 19 | 20 | 2. install python: 21 | - reason: program is written in python, need it to execute the bot. 22 | - result: execute python in powershell, you should get a python shell 23 | - instructions: 24 | in powershell (same one) 25 | execute: 26 | python3 27 | this should open microsoft store, if it doesn't open it yourself 28 | install python3.9 (microsoft store) 29 | 30 | 3. (omitted) 31 | 32 | 4. clone the project: 33 | got to: 34 | https://github.com/Occy88/bots 35 | click on the green code tab 36 | click download zip 37 | place it in a location of your choice such as desktop and unzip it, delete the zip. 38 | 39 | 5. navigate to the project in powershell. 40 | instructions: 41 | some simple comands in powershell: 42 | pwd -tells you where you are 43 | ls -lists everything in your current location. 44 | cd -navigates to a directory e.g.: cd Desktop 45 | 46 | one method of navigating to the project: 47 | open the project in file explorer, copy the project path 48 | execute: 49 | cd project_path 50 | (replace project_path with what you copied) 51 | 52 | 53 | 6. install requirements: 54 | in powershell (in project) 55 | execute: 56 | ls 57 | you should see requirements.txt 58 | if you do you are in the correct location. 59 | execute: 60 | pip3 install -r requirements.txt 61 | wait for installation to end 62 | 63 | 7. Run the programm: 64 | in powershell: 65 | you should be in the root of the project 66 | plug in your phone, make sure adb works but is not running. 67 | open pokemon go 68 | go to friends list 69 | order friends by can recieve 70 | open first friend's profile in list. 71 | execute: 72 | python3 playground.py 73 | 74 | you should see your phone's screen show up on the laptop. 75 | -------------------------------------------------------------------------------- /ApplicationManagers/LinuxWinWrapper.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import win32gui 3 | import win32ui 4 | from ctypes import windll 5 | from CardPrototyping.card_Windows.WindowInterface import WindowInterface 6 | import cv2 7 | from time import time 8 | 9 | 10 | class LinuxWinWrapper(WindowInterface): 11 | def __init__(self, window_title): 12 | WindowInterface.__init__(self,window_title) 13 | self.win_32_window = win32gui.FindWindow(None, window_title) 14 | self.update_properties() 15 | print('properties updated, starting thread') 16 | 17 | print('window thread complete') 18 | 19 | def update_properties(self): 20 | self.left, self.top, self.right, self.bottom = win32gui.GetWindowRect(self.win_32_window) 21 | self.height = self.bottom - self.top 22 | self.width = self.right - self.left 23 | print(self.width, self.height) 24 | cv2.namedWindow('preview') 25 | 26 | def prepare_screenshot(self): 27 | self.wDC = win32gui.GetWindowDC(self.win_32_window) 28 | self.dcObj = win32ui.CreateDCFromHandle(self.wDC) 29 | self.cDC = self.dcObj.CreateCompatibleDC() 30 | 31 | self.saveBitMap = win32ui.CreateBitmap() 32 | self.saveBitMap.CreateCompatibleBitmap(self.dcObj, self.width, self.height) 33 | self.cDC.SelectObject(self.saveBitMap) 34 | 35 | def show_image(self, screen_name, image): 36 | cv2.imshow(screen_name, image) 37 | if cv2.waitKey(1) == ord('q'): 38 | cv2.destroyAllWindows() 39 | 40 | def video(self): 41 | self.prepare_screenshot() 42 | 43 | t = time() 44 | f = 0 45 | while True: 46 | if cv2.waitKey(1) == ord('q'): 47 | cv2.destroyAllWindows() 48 | break 49 | if time() - t > 1: 50 | print(f) 51 | f = 0 52 | t = time() 53 | 54 | f += 1 55 | cv2.imshow('preview', self.get_latest_screenshot()) 56 | self.release() 57 | 58 | def get_latest_screenshot(self): 59 | result = windll.user32.PrintWindow(self.win_32_window, self.cDC.GetSafeHdc(), 0) 60 | signedIntsArray = self.saveBitMap.GetBitmapBits(True) 61 | img = np.fromstring(signedIntsArray, dtype='uint8') 62 | img.shape = (self.height, self.width, 4) 63 | # release happens here... 64 | img = img[..., :3] 65 | img = np.ascontiguousarray(img) 66 | return img 67 | 68 | def release(self): 69 | self.cDC.DeleteDC() 70 | self.dcObj.DeleteDC() 71 | win32gui.ReleaseDC(self.win_32_window, self.wDC) 72 | win32gui.DeleteObject(self.saveBitMap.GetHandle()) 73 | 74 | 75 | def kill_all_windows(self): 76 | cv2.destroyAllWindows() 77 | -------------------------------------------------------------------------------- /InstallationWindows.txt: -------------------------------------------------------------------------------- 1 | Instructions to get started on windows, we will be using the powershell but don't worry it's mostly copy pasting. 2 | Any issues let me know, but it should be quire straight forward ;D 3 | 1. install chocolatey: 4 | - reason: this is to make installation of python/ packages easier. 5 | - result: when you enter choco into terminal, there should be some meaningful output. 6 | (it's very easy, just follow instructions) 7 | - link to instruction: https://chocolatey.org/install 8 | -Express instructions: 9 | execute the following in admin powershell: 10 | Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) 11 | 12 | 1.1. install adb: 13 | - reason: we use this to communicate with the phone 14 | - result: when phone is plugged in if you execute: 15 | adb shell 16 | you should see a popup on the phone asking you to accept 17 | when you do, the powershell should not throw an error, you can type exit to leave adb. 18 | - instructions: 19 | admin powershell execute: 20 | choco install adb 21 | 22 | 2. install python: 23 | - reason: program is written in python, need it to execute the bot. 24 | - result: execute python in powershell, you should get a python shell 25 | - instructions: 26 | in powershell (same one) 27 | execute: 28 | python3 29 | this should open microsoft store, if it doesn't open it yourself 30 | install python3.9 (microsoft store) 31 | 32 | 3. (omitted) 33 | 34 | 4. clone the project: 35 | got to: 36 | https://github.com/Occy88/bots 37 | click on the green code tab 38 | click download zip 39 | place it in a location of your choice such as desktop and unzip it, delete the zip. 40 | 41 | 5. navigate to the project in powershell. 42 | instructions: 43 | some simple comands in powershell: 44 | pwd -tells you where you are 45 | ls -lists everything in your current location. 46 | cd -navigates to a directory e.g.: cd Desktop 47 | 48 | one method of navigating to the project: 49 | open the project in file explorer, copy the project path 50 | execute: 51 | cd project_path 52 | (replace project_path with what you copied) 53 | 54 | 55 | 6. install requirements: 56 | in powershell (in project) 57 | execute: 58 | ls 59 | you should see requirements.txt 60 | if you do you are in the correct location. 61 | execute: 62 | pip3 install -r requirements.txt 63 | wait for installation to end 64 | 65 | 7. Run the programm: 66 | in powershell: 67 | you should be in the root of the project 68 | plug in your phone, make sure adb works but is not running. 69 | open pokemon go 70 | go to friends list 71 | order friends by can recieve 72 | open first friend's profile in list. 73 | execute: 74 | python3 playground.py 75 | 76 | you should see your phone's screen show up on the laptop. 77 | -------------------------------------------------------------------------------- /ImageProcessing/conv.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | import matplotlib.pyplot as plt 4 | import numpy as np 5 | import tensorflow as tf 6 | from sklearn.model_selection import train_test_split 7 | from tensorflow.keras import layers, models 8 | 9 | from ImageProcessing.ImgTools import load_dir, resize_images 10 | 11 | 12 | def setup_dataset(im_valid, im_invalid, np_img_dim): 13 | print("setinug up dataset") 14 | inv = load_dir(im_invalid, np_img_dim) 15 | print('invalid: ', inv.shape) 16 | val = load_dir(im_valid, np_img_dim) 17 | print('valid:', val.shape) 18 | inv_l = np.zeros(len(inv)) 19 | val_l = np.ones(len(val)) 20 | 21 | X = np.concatenate([inv, val]) 22 | Y = np.concatenate([inv_l, val_l]) 23 | print("DATASET LOADED") 24 | print(X.shape, Y.shape) 25 | 26 | return X, Y 27 | 28 | 29 | def preprocess_images(X, resize_dim, clean_function=lambda x: x): 30 | print('preprocessing') 31 | X = clean_function(X) 32 | X = resize_images(X, resize_dim) 33 | # normalize 34 | X = X / 255 35 | return X 36 | 37 | 38 | def conv2d_32_32_3_model(): 39 | model = models.Sequential() 40 | model.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape=(32, 32, 3))) 41 | model.add(layers.MaxPooling2D((2, 2))) 42 | model.add(layers.Conv2D(64, (3, 3), activation='relu')) 43 | model.add(layers.MaxPooling2D((2, 2))) 44 | model.add(layers.Conv2D(64, (3, 3), activation='relu')) 45 | model.add(layers.Flatten()) 46 | model.add(layers.Dense(64, activation='relu')) 47 | model.add(layers.Dense(2)) 48 | 49 | model.compile(optimizer='adam', 50 | loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True), 51 | metrics=['accuracy']) 52 | return model 53 | 54 | 55 | def load_model(model_path): 56 | return tf.keras.models.load_model(model_path) 57 | 58 | 59 | def train_images(X, Y, model, save_path): 60 | # Normalize images 61 | print("training: ", X.shape, Y.shape) 62 | xtr, xts, ytr, yts = train_test_split(X, Y, test_size=0.33, random_state=42) 63 | 64 | history = model.fit(xtr, ytr, epochs=10, 65 | validation_data=(xts, yts)) 66 | plt.plot(history.history['accuracy'], label='accuracy') 67 | plt.plot(history.history['val_accuracy'], label='val_accuracy') 68 | plt.xlabel('Epoch') 69 | plt.ylabel('Accuracy') 70 | plt.ylim([0.5, 1]) 71 | plt.legend(loc='lower right') 72 | plt.show() 73 | test_loss, test_acc = model.evaluate(xts, yts, verbose=2) 74 | print(test_acc) 75 | if not os.path.exists(save_path): 76 | os.makedirs(save_path) 77 | model.save(save_path) 78 | return model 79 | 80 | 81 | def train_model(detect_images, ignore_images, img_np_dim, preprocess_function, model_save_path): 82 | x, y = setup_dataset(detect_images, ignore_images, img_np_dim) 83 | print("DATASET LOADED") 84 | print(x.shape) 85 | print('PREPROCESSING') 86 | x = preprocess_function(x) 87 | print("PREPROCESSING FINISHED") 88 | print(x.shape) 89 | print('TRAINING') 90 | return train_images(x, y, conv2d_32_32_3_model(), model_save_path) 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /CardPrototyping/card_Windows/Windows.py: -------------------------------------------------------------------------------- 1 | from ctypes import windll 2 | from time import time 3 | from CardPrototyping.GenericCard import GenericCardTemplate 4 | import cv2 5 | import numpy as np 6 | import win32api 7 | import win32gui 8 | import win32ui 9 | 10 | 11 | class Win32Wrapper(GenericCardTemplate()): 12 | def __init__(self, window_title): 13 | self.win_32_window = win32gui.FindWindow(None, window_title) 14 | self.update_properties() 15 | print('properties updated, starting thread') 16 | 17 | print('window thread complete') 18 | 19 | def update_properties(self): 20 | self.left, self.top, self.right, self.bottom = win32gui.GetWindowRect(self.win_32_window) 21 | self.height = self.bottom - self.top 22 | self.width = self.right - self.left 23 | print(self.width, self.height) 24 | 25 | def get_window_dim(self): 26 | return np.array([self.width, self.height]) 27 | 28 | def get_mouse_pos(self): 29 | x, y = win32gui.GetCursorPos() 30 | print(self.left, self.right, self.bottom, self.top) 31 | x -= self.left 32 | y -= self.top 33 | return np.array([x, y]) 34 | 35 | def get_cursor_location(self): 36 | flags, hcursor, (x, y) = win32gui.GetCursorInfo() 37 | return win32api.GetCursorPos() 38 | 39 | def prepare_screenshot(self): 40 | self.wDC = win32gui.GetWindowDC(self.win_32_window) 41 | self.dcObj = win32ui.CreateDCFromHandle(self.wDC) 42 | self.cDC = self.dcObj.CreateCompatibleDC() 43 | 44 | self.saveBitMap = win32ui.CreateBitmap() 45 | self.saveBitMap.CreateCompatibleBitmap(self.dcObj, self.width, self.height) 46 | self.cDC.SelectObject(self.saveBitMap) 47 | 48 | def show_image(self, screen_name, image): 49 | cv2.imshow(screen_name, image) 50 | if cv2.waitKey(1) == ord('q'): 51 | cv2.destroyAllWindows() 52 | 53 | def start_capture(self): 54 | self.prepare_screenshot() 55 | 56 | t = time() 57 | f = 0 58 | while True: 59 | if cv2.waitKey(1) == ord('q'): 60 | cv2.destroyAllWindows() 61 | break 62 | if time() - t > 1: 63 | print(f) 64 | f = 0 65 | t = time() 66 | 67 | f += 1 68 | cv2.imshow('preview', self.get_latest_screenshot()) 69 | self.release() 70 | 71 | def get_latest_screenshot(self): 72 | result = windll.user32.PrintWindow(self.win_32_window, self.cDC.GetSafeHdc(), 0) 73 | signedIntsArray = self.saveBitMap.GetBitmapBits(True) 74 | img = np.fromstring(signedIntsArray, dtype='uint8') 75 | img.shape = (self.height, self.width, 4) 76 | # release happens here... 77 | img = img[..., :3] 78 | img = np.ascontiguousarray(img) 79 | return img 80 | 81 | def release(self): 82 | self.cDC.DeleteDC() 83 | self.dcObj.DeleteDC() 84 | win32gui.ReleaseDC(self.win_32_window, self.wDC) 85 | win32gui.DeleteObject(self.saveBitMap.GetHandle()) 86 | 87 | def screenshot(self): 88 | img = self.get_latest_screenshot() 89 | self.show_image('preview', img) 90 | 91 | def kill_all_windows(self): 92 | cv2.destroyAllWindows() 93 | -------------------------------------------------------------------------------- /PokemonGo/DetectPokestop.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | import numpy as np 3 | 4 | from ImageProcessing.ImgTools import TfImageFinder 5 | from ImageProcessing.conv import load_model 6 | from ImageProcessing.conv import preprocess_images 7 | 8 | POKESTOP_MODEL_PATH = '../models/PokestopDetect' 9 | POKESTOP_IMAGES = '../images/Pokestop/*' 10 | NOT_POKESTOP_IMAGES = '../images/Nothing/*' 11 | POKESTOP_IMG_DIM = (100, 150, 3) 12 | POKESTOP_RESIZE_DIM = (32, 32, 3) 13 | 14 | 15 | def clean_img(img_list): 16 | """ 17 | remove all unnecessary colours (conecntrate on blue pokestops only) 18 | 19 | :param img: 20 | :return:q 21 | """ 22 | print("CLEANING N IMAGES: ", len(img_list)) 23 | for i, img in enumerate(img_list): 24 | # print('CLEANING IMAGE: ', i) 25 | # print(img.shape) 26 | # print(type(img)) 27 | # print(img[0][0]) 28 | hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) 29 | # Threshold of blue in HSV space 30 | lower_blue = np.array([35, 190, 130]) 31 | upper_blue = np.array([170, 236, 255]) 32 | 33 | # preparing the mask to overlay 34 | mask = cv2.inRange(hsv, lower_blue, upper_blue) 35 | 36 | # The black region in the mask has the value of 0, 37 | # so when multiplied with original image removes all non-blue regions 38 | img_list[i] = cv2.bitwise_and(img, img, mask=mask) 39 | return img_list 40 | 41 | 42 | 43 | 44 | pokestop_detector = TfImageFinder( 45 | load_model(POKESTOP_MODEL_PATH), preprocessor, POKESTOP_IMG_DIM, threshold=0.8) 46 | POKESTOP_COLOR_CHANGE_PERCENT_AREA = () 47 | POKESTOP_TOO_FAR_PERCENT_AREA = () 48 | POKESTOP_TOO_FAR_IMAGE = '' 49 | POKESTOP_AVAILABLE_IMAGE = '' 50 | POKESTOP_NOT_AVAILABLE_IMAGE = '' 51 | 52 | # two clicks registered: [ 23 1350] [ 61 1374] 53 | # (2,) (2,) (2,) 54 | # purple 55 | # x,y: [0.03194444 0.91216216] 56 | # w,h: [0.05277778 0.01621622] 57 | # =========== IMAGE SAVED======== 58 | # two clicks registered: [ 24 1353] [ 66 1381] 59 | # (2,) (2,) (2,) 60 | # blue 61 | # x,y: [0.03333333 0.91418919] 62 | # w,h: [0.05833333 0.01891892] 63 | # =========== IMAGE SAVED======== 64 | # two clicks registered: [ 121 1169] [ 600 1200] 65 | # (2,) (2,) (2,) 66 | # words 67 | # x,y: [0.16805556 0.78986486] 68 | # w,h: [0.66527778 0.02094595] 69 | # =========== IMAGE SAVED======== 70 | # two clicks registered: [ 94 1150] [ 633 1297] 71 | # (2,) (2,) (2,) 72 | # area 73 | # x,y: [0.13055556 0.77702703] 74 | # w,h: [0.74861111 0.09932432] 75 | # =========== IMAGE SAVED======== 76 | from ImageProcessing.ImgTools import crop_img_percent 77 | 78 | p_xy = [0, 0.4] 79 | p_wh = [1, 0.4] 80 | 81 | 82 | def get_pokestop_area(img): 83 | return crop_img_percent(img, *p_xy, *p_wh) 84 | 85 | 86 | from CardPrototyping.card_ADB.instances_ADB import android_phone 87 | 88 | swipe = (270, 800), (600, 800) 89 | click = (350, 1300) 90 | 91 | import time 92 | 93 | 94 | def find_locations(img): 95 | img2 = get_pokestop_area(img) 96 | picture, peaks = pokestop_detector.find_locations(img2) 97 | print(np.array(p_xy), np.array(np.flip(img.shape)[1:], dtype=np.float)) 98 | print(peaks) 99 | offset = np.array(np.flip(p_xy), dtype=np.float) * np.array(img.shape[:-1], dtype=np.float) 100 | print(peaks) 101 | print(offset) 102 | for index, p in enumerate(peaks): 103 | p += offset.astype(int) 104 | p = np.flip(p) 105 | if index > 3: 106 | break 107 | print("CLICKING ON: ", p) 108 | android_phone.swipe(p, p) 109 | # time.sleep(0.7) 110 | # android_phone.swipe(*swipe) 111 | # time.sleep(0.3) 112 | # android_phone.swipe(click, click) 113 | time.sleep(1) 114 | print("==============") 115 | -------------------------------------------------------------------------------- /CardPrototyping/card_CatchPokemon/CatchPokemon.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | print(os.getcwd()) 4 | 5 | from CardPrototyping.GenericCard import GenericCardTemplate 6 | from CardPrototyping.card_ADB.instances_ADB import android_phone 7 | from ImageProcessing.ImgTools import img_col_similarity, find_circles 8 | from ImageProcessing import MLPictureGen 9 | import numpy as np 10 | 11 | # path = '../PokemonGo/images/FriendGifting/' 12 | path = 'PokemonGo/images/FriendGifting/' 13 | gen = MLPictureGen.MLPictureGen() 14 | 15 | 16 | def can_send(): 17 | return gen.test_image(path, 'can_send_gift_profile') > 0.7 18 | 19 | 20 | def catch(): 21 | pokeball_select_location = np.array([0.43, 0.4]) * 2 22 | pokeball_master_location = np.array([0.415, 0.4]) * 2 23 | pokeball_hold = np.array([0.25, 0.42]) * 2 24 | # select master -> great ->pokeball 25 | print("SELECTING POKEBALL") 26 | android_phone.swipe(pokeball_select_location,pokeball_select_location) 27 | time.sleep(1) 28 | android_phone.swipe(pokeball_master_location,pokeball_master_location) 29 | time.sleep(1) 30 | print("SEARCHING") 31 | 32 | android_phone.hold(pokeball_hold, True) 33 | time.sleep(0.5) 34 | c1 = find_circles(android_phone.latest_frame, np.array([.05, .4]), np.array([0, 0.3, 1, .3])) 35 | while not len(c1) > 0: 36 | print("ATTEMPT, FIND") 37 | c1 = find_circles(android_phone.latest_frame, np.array([.05, .4]), np.array([0, 0.3, 1, .3])) 38 | time.sleep(1) 39 | print("FOUND, SWIPING") 40 | x, y, r = c1[0] 41 | android_phone.release(pokeball_hold, True) 42 | time.sleep(0.5) 43 | android_phone.swipe(pokeball_hold, 44 | np.array([x, y]) / np.array(np.flip(android_phone.latest_frame.shape[:2])), as_percent=True,step_pixels=10,step_delay=0.001) 45 | # hold down 46 | # detect circle 47 | 48 | # throw ball into circle. 49 | pass 50 | 51 | 52 | def send_gift(): 53 | print("Send Click") 54 | send_button = np.array([0.185, 0.88]) 55 | android_phone.swipe(send_button, send_button, True) 56 | time.sleep(3) 57 | print("Gift Click") 58 | 59 | gift_button = np.array([0.5, 0.35]) 60 | android_phone.swipe(gift_button, gift_button, True) 61 | time.sleep(2) 62 | print("Send Confirm") 63 | send_confirm = np.array([0.5, 0.79625]) 64 | 65 | android_phone.swipe(send_confirm, send_confirm, True) 66 | time.sleep(7) 67 | 68 | 69 | import time 70 | 71 | 72 | class CatchPokemon(GenericCardTemplate()): 73 | def __init__(self, name): 74 | super().__init__(self) 75 | android_phone.set_resolution() 76 | self.name = name 77 | 78 | def print_click(self, *args, **kwargs): 79 | if kwargs['event'] != 4: 80 | return 81 | p = np.array([kwargs['x'], kwargs['y']]) 82 | t = np.array([android_phone.width, android_phone.height]) 83 | p_percent = p / t 84 | print(p_percent) 85 | 86 | def next_profile(self): 87 | android_phone.swipe() 88 | 89 | def catch_pokemon(self): 90 | android_phone.do_mouse_event_complete(self.print_click) 91 | time.sleep(2) 92 | while True: 93 | catch() 94 | print("SLEEPING") 95 | time.sleep(10) 96 | 97 | # print("initiating for: ") 98 | # for i in range(num_pokemon): 99 | # print(i / num_pokemon, '% left: ', num_pokemon - i) 100 | # 101 | # android_phone.swipe(step1, step1) 102 | # time.sleep(long_d) 103 | # android_phone.swipe(step2, step2) 104 | # time.sleep(short_d) 105 | # android_phone.swipe(step3, step3) 106 | # time.sleep(short_d) 107 | # android_phone.swipe(step4, step4) 108 | # time.sleep(med_d) 109 | # android_phone.swipe(step5, step5) 110 | # time.sleep(long_d) 111 | -------------------------------------------------------------------------------- /ImageProcessing/MLPictureGen.py: -------------------------------------------------------------------------------- 1 | import uuid 2 | 3 | try: 4 | import keyboard 5 | from keyboard import KeyboardEvent 6 | 7 | except ModuleNotFoundError: 8 | keyboard = 'No Keyboard' 9 | KeyboardEvent = str 10 | print("keyboard module not loaded") 11 | from CardPrototyping.card_ADB.instances_ADB import android_phone 12 | from ImageProcessing.ImgTools import crop_center, save_img, crop_img, show_img, img_col_similarity, load_img, \ 13 | resize_images 14 | import json 15 | import os 16 | 17 | 18 | class MLPictureGen: 19 | def __init__(self): 20 | """ 21 | 22 | :param program_name: 23 | :return: 24 | """ 25 | print("initiating program controller") 26 | # android_phone = ProgramController(program_name) 27 | print(android_phone, " Initiation complete") 28 | self.width = 100 29 | self.height = 100 30 | self.name = 'default' 31 | 32 | def check_event_is_click(self, args): 33 | if not args['event'] == 1: 34 | return False 35 | return True 36 | 37 | def save_img(self, **kwargs): 38 | if self.check_event_is_click(kwargs): 39 | x, y = android_phone._get_mouse_pos() 40 | img = android_phone.get_latest_screenshot() 41 | img = crop_center(img, x, y, self.width, self.height) 42 | save_img(img, self.name, True) 43 | 44 | def set_img_attr(self, name, width, height): 45 | self.name = name 46 | self.width = width 47 | self.height = height 48 | 49 | def capture_on_event(self, key, window_name, name='default', width=100, height=100): 50 | self.set_img_attr(name, width, height) 51 | android_phone.start_capture(window_name) 52 | 53 | def capture(e: KeyboardEvent): 54 | if e.name == key: 55 | self.save_img() 56 | 57 | try: 58 | keyboard.on_press(capture) 59 | except: 60 | "Keyboard module not available" 61 | 62 | def capture_on_click(self, window_name, name='default', width=100, height=100): 63 | self.set_img_attr(name, width, height) 64 | android_phone.start_capture(window_name) 65 | android_phone.add_click_callback(self.save_img) 66 | 67 | def test_image(self, path, img_name, format='.png'): 68 | """ 69 | Image name should be in the format: name+ | + coord 1 + coord 2 +|+bool as percent 70 | """ 71 | # print(path) 72 | # print(os.listdir(path)) 73 | # print("-------------") 74 | 75 | img = android_phone.latest_frame 76 | 77 | # show_img(img) 78 | details = json.loads(open(path + img_name + '.json', 'r').read()) 79 | img = crop_img(img, *details['xy'], *details['wh'], details['as_percentage']) 80 | # show_img(img) 81 | fp = path + img_name + format 82 | # print(fp) 83 | img2 = load_img(fp) 84 | # show_img(img2) 85 | sim = img_col_similarity(img, img2) 86 | # print(sim) 87 | return sim 88 | 89 | def capture_on_two_click(self, name, path, as_percentage=True, with_coords=True, with_uuid=False, format='.png'): 90 | """ 91 | Click first time for top left corner, 92 | Second for bottom right corner 93 | image is saved 94 | area_printed as percentage/as pixel. 95 | :return: 96 | """ 97 | self.ctc_first = None 98 | print(android_phone) 99 | 100 | def process_click(**kwargs): 101 | if self.check_event_is_click(kwargs): 102 | if self.ctc_first is None: 103 | self.ctc_first = android_phone._get_mouse_pos() 104 | else: 105 | ctc_first = self.ctc_first 106 | self.ctc_first = None 107 | ctc_second = android_phone._get_mouse_pos() 108 | print("two clicks registered: ", ctc_first, ctc_second) 109 | win_dim = android_phone._get_window_dim() 110 | print(ctc_first.shape, ctc_second.shape, win_dim.shape) 111 | 112 | if as_percentage: 113 | ctc_first = ctc_first / win_dim 114 | ctc_second = ctc_second / win_dim 115 | print("x,y:", ctc_first) 116 | wh = ctc_second - ctc_first 117 | print("w,h:", wh) 118 | img = android_phone.latest_frame 119 | details = dict() 120 | import numpy as np 121 | 122 | details['xy'] = ctc_first.tolist() 123 | details['wh'] = wh.tolist() 124 | details['as_percentage'] = as_percentage 125 | open(path + name + '.json', 'w').write(json.dumps(details)) 126 | save_img(crop_img(img, *ctc_first, *wh, as_percentage), name, with_uuid=with_uuid, 127 | format=format, 128 | path=path) 129 | print('=========== IMAGE SAVED========') 130 | 131 | android_phone.do_mouse_event_complete(process_click) 132 | 133 | def print_percentages(self, key): 134 | def print_val(e): 135 | if e.name == key: 136 | x, y = android_phone._get_mouse_pos() 137 | p_x = x / android_phone.width 138 | p_y = y / android_phone.height 139 | print(p_x, p_y) 140 | 141 | try: 142 | keyboard.on_press(print_val) 143 | except ModuleNotFoundError: 144 | print("keyboard not imported (windows probs)") 145 | pass 146 | -------------------------------------------------------------------------------- /CardPrototyping/card_SendGifts/SendGifts.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | print(os.getcwd()) 4 | 5 | from CardPrototyping.GenericCard import GenericCardTemplate 6 | from CardPrototyping.card_ADB.instances_ADB import android_phone 7 | from ImageProcessing.ImgTools import img_col_similarity, update_img_from_details 8 | from ImageProcessing import MLPictureGen 9 | import numpy as np 10 | 11 | # path = '../PokemonGo/images/FriendGifting/' 12 | path = 'PokemonGo/images/FriendGifting/' 13 | gen = MLPictureGen.MLPictureGen() 14 | 15 | dbg_btn=np.array([0,0.1]) 16 | def open_gift_page(): 17 | print("============[ Checking gift can be opened ]===========") 18 | v = gen.test_image(path, 'open_gift_page') 19 | print("value: ", v) 20 | return v > 0.8 21 | 22 | 23 | def leave_page(): 24 | print("LEAVINNG PAGE") 25 | btn = np.array([0.5, 0.96]) 26 | android_phone.swipe(btn, btn, True) 27 | time.sleep(1) 28 | 29 | 30 | def gift_received(): 31 | print("============[ Checking if gift was received ]===========") 32 | v = gen.test_image(path, 'gift_received_profile') 33 | print("value: ", v) 34 | return v > 0.8 35 | 36 | 37 | def can_send(): 38 | print("============[ Checking if gift can be sent ]===========") 39 | v = gen.test_image(path, 'can_send_gift_profile') 40 | print("value: ", v) 41 | 42 | return v > 0.7 43 | 44 | 45 | def change_profile(): 46 | 47 | print("============[ NEXT PROFILE ]===========") 48 | android_phone.swipe(np.array([0.93518519, 0.86]), np.array([0.1537037, 0.86]), True, step_pixels=10, step_delay=0.02) 49 | time.sleep(2) 50 | pass 51 | 52 | 53 | def click_wabble_gift(): 54 | rand = np.array([0.5, 0.5]) 55 | print("Random Click") 56 | android_phone.swipe(rand, rand, True) 57 | time.sleep(3) 58 | 59 | 60 | def open_gift(): 61 | click_wabble_gift() 62 | print("Open Click") 63 | 64 | open = np.array([0.5, 0.86]) 65 | 66 | 67 | android_phone.swipe(open, open, True) 68 | time.sleep(2) 69 | print("Open Click") 70 | time.sleep(1) 71 | if open_gift_page(): 72 | print("GIFT LIMIT REACHED .....") 73 | leave_page() 74 | return False 75 | android_phone.swipe(open, open, True) 76 | time.sleep(0.3) 77 | android_phone.swipe(open, open, True) 78 | time.sleep(0.2) 79 | android_phone.swipe(open, open, True) 80 | time.sleep(0.2) 81 | android_phone.swipe(open, open, True) 82 | time.sleep(0.2) 83 | android_phone.swipe(open, open, True) 84 | time.sleep(5) 85 | return True 86 | 87 | 88 | def send_gift(): 89 | print("Send Click") 90 | send_button = np.array([0.20185185, 0.85]) 91 | android_phone.swipe(send_button, send_button, True) 92 | time.sleep(3) 93 | print("Gift Click") 94 | 95 | gift_button = np.array([0.5, 0.35]) 96 | android_phone.swipe(gift_button, gift_button, True) 97 | time.sleep(2) 98 | print("Send Confirm") 99 | send_confirm = np.array([0.5, 0.83]) 100 | android_phone.swipe(send_confirm, send_confirm, True) 101 | 102 | android_phone.swipe(send_confirm, send_confirm, True) 103 | time.sleep(5) 104 | 105 | 106 | step1 = (130, 450) 107 | step2 = (625, 1300) 108 | step3 = (620, 1160) 109 | step4 = (370, 800) 110 | step5 = (370, 730) 111 | extra_l_d = 2.2 112 | long_d = 1.8 113 | med_d = 1.3 114 | short_d = 0.7 115 | import time 116 | 117 | 118 | class SendGifts(GenericCardTemplate()): 119 | def __init__(self, name): 120 | super().__init__(self) 121 | android_phone.set_resolution() 122 | android_phone.set_full_screen('com.nianticlabs.pokemongo') 123 | self.name = name 124 | 125 | def print_click(self, *args, **kwargs): 126 | if kwargs['event'] != 4: 127 | return 128 | p = np.array([kwargs['x'], kwargs['y']]) 129 | t = np.array([android_phone.width, android_phone.height]) 130 | p_percent = p / t 131 | print(p_percent) 132 | 133 | def next_profile(self): 134 | android_phone.swipe() 135 | 136 | def calibrate(self): 137 | images_path = './PokemonGo/images/FriendGifting/' 138 | images = ['open_gift_page', 'gift_received_profile', 'can_send_gift_profile'] 139 | print("CALIBRATING:") 140 | print("EXPECTED TO BE ON PAGE WHERE GIFT IS RECIEVED FROM FRIEND AND IT WOBBLES") 141 | update_img_from_details(android_phone.latest_frame, images[1], images_path) 142 | print("CAPTURED...") 143 | print("CLICKING TO ACCEPT GIFT...") 144 | click_wabble_gift() 145 | time.sleep(2) 146 | print("EXPECTED TO BE ON PAGE WHERE YOU CAN OPEN THE GIFT...") 147 | update_img_from_details(android_phone.latest_frame, images[0], images_path) 148 | print("IMAGE CAPTURED... LEAVING PAGE TO PROFILE PAGE") 149 | leave_page() 150 | time.sleep(1) 151 | print("EXPECTING TO BE ON PROFILE PAGE...") 152 | print("EXPECTING GIFT IS NOT SENT (COLOURFUL)") 153 | update_img_from_details(android_phone.latest_frame, images[2], images_path) 154 | print("CALIBRATION COMPLETE...") 155 | 156 | def do_send_gifts(self): 157 | print("initiating transfer routine in 10s") 158 | time.sleep(1) 159 | limit_reached = False 160 | 161 | while True: 162 | if gift_received(): 163 | if limit_reached: 164 | leave_page() 165 | else: 166 | limit_reached = not open_gift() 167 | if can_send(): 168 | # break 169 | send_gift() 170 | change_profile() 171 | 172 | # print("initiating for: ") 173 | # for i in range(num_pokemon): 174 | # print(i / num_pokemon, '% left: ', num_pokemon - i) 175 | # 176 | # android_phone.swipe(step1, step1) 177 | # time.sleep(long_d) 178 | # android_phone.swipe(step2, step2) 179 | # time.sleep(short_d) 180 | # android_phone.swipe(step3, step3) 181 | # time.sleep(short_d) 182 | # android_phone.swipe(step4, step4) 183 | # time.sleep(med_d) 184 | # android_phone.swipe(step5, step5) 185 | # time.sleep(long_d) 186 | -------------------------------------------------------------------------------- /CardPrototyping/card_ADB/viewer.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import os 3 | import socket 4 | import struct 5 | import subprocess 6 | import sys 7 | from queue import Queue 8 | from time import sleep 9 | import av 10 | 11 | from CardPrototyping.card_ADB.control import ControlMixin 12 | from sys import platform 13 | 14 | if platform == "linux" or platform == "linux2": 15 | adb_path = '/usr/bin/adb' 16 | print(f"DETECTED LINUX OS adb path={adb_path}") 17 | 18 | elif platform == "darwin": 19 | adb_path = '/usr/local/bin/adb' 20 | print(f"DETECTED MAC OS adb path={adb_path}") 21 | 22 | elif platform == "win32": 23 | adb_path = 'C:\ProgramData\chocolatey\\bin\\adb' 24 | print(f"DETECTED WINDOWS OS adb path={adb_path}") 25 | 26 | logger = logging.getLogger(__name__) 27 | logging.basicConfig(stream=sys.stdout, level=logging.INFO, 28 | format='%(asctime)s.%(msecs)03d %(levelname)s:\t%(message)s', 29 | datefmt='%Y-%m-%d %H:%M:%S') 30 | 31 | 32 | class AndroidViewer(ControlMixin): 33 | video_socket = None 34 | control_socket = None 35 | resolution = None 36 | 37 | video_data_queue = Queue() 38 | 39 | def __init__(self, max_width=0, bitrate=8000000, max_fps=30, adb_path=adb_path, 40 | ip='127.0.0.1', port=8081): 41 | """ 42 | :param max_width: frame width that will be broadcast from android server 43 | :param bitrate: 44 | :param max_fps: 0 means not max fps. 45 | :param ip: android server IP 46 | :param adb_path: path to ADB 47 | :param port: android server port 48 | """ 49 | self.ip = ip 50 | self.port = port 51 | 52 | self.adb_path = adb_path 53 | 54 | assert self.deploy_server(max_width, bitrate, max_fps) 55 | 56 | self.codec = av.codec.CodecContext.create('h264', 'r') 57 | self.init_server_connection() 58 | 59 | def close_all_sockets(self): 60 | self.video_socket.__exit__() 61 | self.control_socket.__exit__() 62 | self.adb_push.terminate() 63 | self.shell.terminate() 64 | self.server.terminate() 65 | 66 | def receiver(self): 67 | """ 68 | Read h264 video data from video socket and put it in Queue. 69 | This method should work in separate thread since it's blocking. 70 | """ 71 | while True: 72 | raw_h264 = self.video_socket.recv(0x10000) 73 | if not raw_h264: 74 | continue 75 | 76 | self.video_data_queue.put(raw_h264) 77 | 78 | def init_server_connection(self): 79 | """ 80 | Connect to android server, there will be two sockets, video and control socket. 81 | This method will set: video_socket, control_socket, resolution variables 82 | """ 83 | logger.info("Connecting video socket") 84 | self.video_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 85 | self.video_socket.connect((self.ip, self.port)) 86 | 87 | dummy_byte = self.video_socket.recv(1) 88 | if not len(dummy_byte): 89 | raise ConnectionError("Did not receive Dummy Byte!") 90 | 91 | logger.info("Connecting control socket") 92 | self.control_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 93 | self.control_socket.connect((self.ip, self.port)) 94 | 95 | device_name = self.video_socket.recv(64).decode("utf-8") 96 | 97 | if not len(device_name): 98 | raise ConnectionError("Did not receive Device Name!") 99 | logger.info("Device Name: " + device_name) 100 | 101 | res = self.video_socket.recv(4) 102 | self.resolution = struct.unpack(">HH", res) 103 | logger.info("Screen resolution: %s", self.resolution) 104 | self.video_socket.setblocking(False) 105 | 106 | def deploy_server(self, max_width=1024, bitrate=8000000, max_fps=0): 107 | try: 108 | logger.info("Upload JAR...") 109 | 110 | server_root = os.path.abspath(os.path.dirname(__file__)) 111 | server_file_path = server_root + '/scrcpy-server.jar' 112 | self.adb_push = subprocess.Popen([self.adb_path, 'push', server_file_path, '/data/local/tmp/'], 113 | stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=server_root) 114 | self.adb_push_comm = ''.join([x.decode("utf-8") for x in self.adb_push.communicate() if x is not None]) 115 | 116 | if "error" in self.adb_push_comm: 117 | logger.critical("Is your device/emulator visible to ADB?") 118 | raise Exception(self.adb_push_comm) 119 | 120 | logger.info("Running server...") 121 | self.shell = subprocess.Popen( 122 | [self.adb_path, 'shell', 123 | 'CLASSPATH=/data/local/tmp/scrcpy-server.jar', 124 | 'app_process', '/', 'com.genymobile.scrcpy.Server 1.12.1 {} {} {} true - false true'.format( 125 | max_width, bitrate, max_fps)], 126 | cwd=server_root) 127 | sleep(1) 128 | 129 | logger.info("Forward server port...") 130 | self.server = subprocess.Popen( 131 | [self.adb_path, 'forward', 'tcp:8081', 'localabstract:scrcpy'], 132 | cwd=server_root) 133 | self.server.wait() 134 | logger.info('Server waiting') 135 | sleep(2) 136 | except FileNotFoundError: 137 | raise FileNotFoundError("Couldn't find ADB at path ADB_bin: " + str(self.adb_path)) 138 | 139 | return True 140 | 141 | def get_next_frames(self): 142 | """ 143 | Get raw h264 video, parse packets, decode each packet to frames and convert 144 | each frame to numpy array. 145 | :return: 146 | """ 147 | 148 | packets = [] 149 | 150 | try: 151 | raw_h264 = self.video_socket.recv(0x10000) 152 | packets = self.codec.parse(raw_h264) 153 | 154 | if not packets: 155 | return None 156 | 157 | except socket.error as e: 158 | return None 159 | 160 | if not packets: 161 | return None 162 | 163 | result_frames = [] 164 | 165 | for packet in packets: 166 | frames = self.codec.decode(packet) 167 | for frame in frames: 168 | result_frames.append(frame.to_ndarray(format="bgr24")) 169 | 170 | return result_frames or None 171 | -------------------------------------------------------------------------------- /CardPrototyping/card_ADB/ADB.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import signal 3 | import sys 4 | import threading 5 | import time 6 | import os 7 | import cv2 8 | import numpy as np 9 | import atexit 10 | from CardPrototyping.card_ADB.viewer import AndroidViewer 11 | from CardPrototyping.GenericCard import GenericCardTemplate 12 | from ImageProcessing.ImgTools import resize_img, crop_img 13 | from settings import SCREEN_SCALE_FACTOR 14 | from settings import NOTiFICATION_BAR_RESCALE 15 | 16 | logger = logging.getLogger(__name__) 17 | logging.basicConfig(stream=sys.stdout, level=logging.INFO, 18 | format='%(asctime)s.%(msecs)03d %(levelname)s:\t%(message)s', 19 | datefmt='%Y-%m-%d %H:%M:%S') 20 | 21 | 22 | class ADBManager(GenericCardTemplate()): 23 | def __init__(self): 24 | super().__init__() 25 | self.adjusted_resolution = None 26 | self.latest_frame = None 27 | self.notif_bar_height = np.array([0, 0]) 28 | logging.info('Bind methods generated') 29 | self.video_thread = None 30 | self.android = AndroidViewer() 31 | self.stop = True 32 | self.scale_factor = SCREEN_SCALE_FACTOR 33 | atexit.register(self._shutdown) 34 | try: 35 | signal.signal(signal.SIGINT, self._shutdown) 36 | signal.signal(signal.SIGTERM, self._shutdown) 37 | # signal.signal(signal.SIGKILL, self._shutdown) 38 | signal.signal(signal.SIGQUIT, self._shutdown) 39 | signal.signal(signal.SIGHUP, self._shutdown) 40 | except Exception as e: 41 | pass 42 | time.sleep(2) 43 | 44 | def set_resolution(self, res=np.array([1080, 1920])): 45 | # adb shell wm size reset 46 | # adb shell wm density resetpytho 47 | # adb shell wm size 1080x1920 48 | 49 | self.exec_adb_command(f'wm size ' + 'x'.join(res.astype(str))) 50 | if NOTiFICATION_BAR_RESCALE: 51 | time.sleep(1) 52 | notif_height = self.exec_adb_command( 53 | "dumpsys window windows| sed -n '/Window .*StatusBar.*:/,/Window .*:/p'| grep 'Requested' |grep h") 54 | 55 | h = int(notif_height.split('h=')[1].split(' ')[0])+1 56 | print("CROPPING OUT NOTIF HEIGHT :") 57 | print(h) 58 | self.notif_bar_height = np.array([0, h]) 59 | self.exec_adb_command(f'wm size ' + 'x'.join((res + self.notif_bar_height).astype(str))) 60 | 61 | self.adjusted_resolution = res 62 | time.sleep(4) 63 | 64 | def reset_resolution(self): 65 | self.exec_adb_command('wm size reset') 66 | 67 | def set_full_screen(self, app_ref='com.nianticlabs.pokemongo'): 68 | self.exec_adb_command(f'settings put global policy_control immersive.full={app_ref}') 69 | 70 | def exec_adb_command(self, cmd): 71 | r = os.popen(f'adb shell {cmd}') 72 | return r.read() 73 | 74 | def do_mouse_event(self, x=0, y=0, flags=0, **kwargs): 75 | 76 | pass 77 | 78 | def do_frame_update(self, img: np.ndarray): 79 | pass 80 | 81 | def hold(self, xy: np.ndarray, as_percent=True): 82 | if as_percent: 83 | xy = self.to_percent(xy) 84 | self.android.hold(*xy) 85 | pass 86 | 87 | def release(self, xy, as_percent=True): 88 | if as_percent: 89 | xy = self.to_percent(xy) 90 | self.android.release(*xy) 91 | 92 | def to_percent(self, xy): 93 | return np.array([self.width, self.height]) * xy 94 | 95 | def swipe(self, xy_from: np.ndarray, xy_to: np.ndarray, as_percent=True, step_pixels=5, step_delay=0.05): 96 | """ 97 | Swipe or click event 98 | (from==to -> click) 99 | :param xy_from: 100 | :param xy_to: 101 | :return: 102 | """ 103 | if as_percent: 104 | xy_from = self.to_percent(xy_from) 105 | xy_to = self.to_percent(xy_to) 106 | logging.info("Adb Swipe message Recieved: " + str(xy_from) + str(xy_to)) 107 | self.android.swipe(*xy_from, *xy_to, step_pixels=step_pixels, step_delay=step_delay) 108 | 109 | def _shutdown(self, *args): 110 | logging.info('Shutdown Signal Recieved: ', args) 111 | logging.info('Cleaning up') 112 | self.reset_resolution() 113 | 114 | self.stop = True 115 | self.android.close_all_sockets() 116 | logging.info("SHUTDOWN CALLED") 117 | logging.info("SLEEP COMPLETE") 118 | exit(0) 119 | return 120 | 121 | def _stop_all_threads(self): 122 | logging.info("STOPPING ALL THREADS") 123 | self.stop = True 124 | 125 | def _swipe(self, start_x, start_y, end_x, end_y): 126 | self.android.swipe(start_x, start_y, end_x, end_y) 127 | 128 | def _preprocess_frame(self, frame): 129 | xy = np.array([0, 0]) 130 | wh = np.flip(frame.shape)[1:] 131 | if NOTiFICATION_BAR_RESCALE: 132 | xy = self.notif_bar_height 133 | if self.adjusted_resolution is not None: 134 | wh = self.adjusted_resolution 135 | frame = crop_img(frame, *xy, *wh) 136 | # print(frame.shape) 137 | return frame 138 | 139 | def _special_opencv_thread(self, window): 140 | logging.info("Video starting on:" + str(window)) 141 | cv2.namedWindow(window) 142 | cv2.setMouseCallback(window, self.__sanitize_mouse_event) 143 | logging.info("Callbacks set") 144 | t = time.time() 145 | f = 0 146 | while not self.stop: 147 | 148 | dt = time.time() - t 149 | t = time.time() 150 | frames = self.android.get_next_frames() 151 | if frames is None: 152 | continue 153 | 154 | for frame in frames: 155 | f += 1 156 | 157 | self.latest_frame = self._preprocess_frame(frame) 158 | 159 | self._update_dim(self.latest_frame) 160 | self.do_frame_update(self.latest_frame) 161 | cv2.imshow(window, resize_img(self.latest_frame, self.scale_factor, True)) 162 | cv2.waitKey(1) 163 | if dt > 1: 164 | f = 0 165 | cv2.destroyWindow(window) 166 | cv2.waitKey(1) 167 | logging.info("Thread ended") 168 | 169 | def _update_dim(self, img): 170 | self.height = len(img) 171 | self.width = len(img[1]) 172 | 173 | def _get_window_dim(self): 174 | return np.array([self.width, self.height]) 175 | 176 | def __sanitize_mouse_event(self, event, x, y, flags, param): 177 | # logging.info(event, x, y, flags, param) 178 | self.mouse_x = x / self.scale_factor 179 | self.mouse_y = y / self.scale_factor 180 | kwargs = {'x': self.mouse_x, 'y': self.mouse_y, 'flags': flags, 'param': param, 'event': event} 181 | self.do_mouse_event(**kwargs) 182 | 183 | def _get_mouse_pos(self): 184 | return np.array([self.mouse_x, self.mouse_y]) 185 | 186 | def start_capture(self, screen_name): 187 | self.stop = False 188 | self.video_thread = threading.Thread(target=self._special_opencv_thread, 189 | args=[screen_name]) 190 | self.video_thread.daemon = True 191 | self.video_thread.start() 192 | 193 | # 194 | -------------------------------------------------------------------------------- /CardPrototyping/GenericCard.py: -------------------------------------------------------------------------------- 1 | import inspect 2 | import logging 3 | import sys 4 | import threading 5 | import time 6 | 7 | logger = logging.getLogger(__name__) 8 | logging.basicConfig(stream=sys.stdout, level=logging.INFO, 9 | format='%(asctime)s.%(msecs)03d %(levelname)s:\t%(message)s', 10 | datefmt='%Y-%m-%d %H:%M:%S') 11 | 12 | 13 | def GenericCardTemplate(): 14 | class GenericCard: 15 | """ 16 | A function calls a set of functions with latest args at a set time interval 17 | to create a bind_on function: 18 | create a function who's name starts with: do_ 19 | the functions generated for you will be: bind_on_... 20 | 21 | signature 22 | 23 | """ 24 | # functions to call is a dictionary hz:[functions] 25 | # list of methods bound with their functions to call at the relevant intervals 26 | # method gc_f_name: {args:most recent,functions_to_call: { hz: [functions]} 27 | __methods_bound = {} 28 | 29 | def __init__(self, *args, **kwargs): 30 | # get all class methods 31 | # logging.info('========= CREATING GENERIC CARD ===================') 32 | # logging.info(self.__class__) 33 | # logging.info(dir(self.__class__)) 34 | # logging.info(args) 35 | # logging.info(kwargs) 36 | # print('----------- ARGUMENTS DONE NOW GENERATING NEW METHODS ------------------') 37 | self.__bind_hooks(self.__get_child_methods(self.__class__)) 38 | 39 | @staticmethod 40 | def __bind(instance, func, as_name=None): 41 | """ 42 | Bind the function *func* to *instance*, with either provided gc_f_name *as_name* 43 | or the existing gc_f_name of *func*. The provided *func* should accept the 44 | instance as the first argument, i.e. "self". 45 | """ 46 | if as_name is None: 47 | as_name = func.__name__ 48 | bound_method = func.__get__(instance, instance.__class__) 49 | setattr(instance, as_name, bound_method) 50 | return bound_method 51 | 52 | @staticmethod 53 | def __get_child_methods(class_type): 54 | methods = inspect.getmembers(class_type, predicate=inspect.isfunction) 55 | # logging.info("ITERATING METHODS: ", methods) 56 | methods_child = [] 57 | for index, (gc_f_name, f) in enumerate(methods): 58 | # logging.info(index, gc_f_name, f) 59 | # logging.info(gc_f_name.startswith('_')) 60 | if not gc_f_name.startswith('do_'): 61 | continue 62 | methods_child.append((gc_f_name, f)) 63 | # logging.info("FINISHED GETTING ALL CHILD====================") 64 | return methods_child 65 | 66 | def __generic_bind_function_template(*args, **kwargs): 67 | def __generic_bind_function(self, f, hz=-1, *args, gc_f_name=None, **kwargs): 68 | """ 69 | Regitsters a function 70 | :param f: function to call with args 71 | :param hz: -1 is every call, >0 for any specified rate 72 | :return: 73 | """ 74 | # print("+========== GENERIC BIND FUNCTION ==================") 75 | if not (hz == -1 or hz > 0): 76 | raise Exception("specified hz invalid: ", hz) 77 | # logging.info("bindING A FUNCTION: ", f) 78 | # logging.info("arguments: ", f, hz, gc_f_name) 79 | # logging.info(self.__methods_bound) 80 | # print('1: ', self.__methods_bound) 81 | # print('2: ', f, hz, gc_f_name) 82 | if hz not in self.__methods_bound[gc_f_name]: 83 | self.__methods_bound[gc_f_name][hz] = [f] 84 | # print('3: ', self.__methods_bound) 85 | self.__start_call_thread(hz, gc_f_name) 86 | # print('threads called') 87 | else: 88 | self.__methods_bound[gc_f_name][hz].append(f) 89 | # print("3.2: ", self.__methods_bound) 90 | # print("+========== ==================") 91 | 92 | return __generic_bind_function 93 | 94 | def __generic_callback_template(self, *args, **kwargs): 95 | def __generic_callback(self, *args, gc_f_name=None, original_function=None, **kwargs): 96 | 97 | """ 98 | A generic callback function, each bound callback 99 | such as: 100 | sound_sensor_update(soundwave) 101 | will call each function bound to that one at -1hz (call on each update) 102 | after the function has executed. 103 | :param func_impl: 104 | :param args: 105 | :param kwargs: 106 | :return: 107 | """ 108 | if gc_f_name is None or original_function is None: 109 | raise Exception( 110 | "generic callback has no gc_f_name or original_methods problem generating default methods: ", 111 | gc_f_name) 112 | # store the latest arguments/kwargs fbind_on_frame_updateor the function. 113 | # print("recieved a callback from", gc_f_name) 114 | # print("updating arguments.") 115 | self.__methods_bound[gc_f_name]['args'] = args 116 | self.__methods_bound[gc_f_name]['kwargs'] = kwargs 117 | returned_args = [original_function(self, *args, **kwargs)] 118 | self.__methods_bound[gc_f_name]['returned_args'] = returned_args 119 | # print(self.__methods_bound) 120 | # execute every function that was bound to be executed at each call 121 | for f in self.__methods_bound[gc_f_name][-1]: 122 | # print("CALLING FUNCTION: ", args, kwargs) 123 | if len(returned_args) == 1 and returned_args[0] is None: 124 | f(*args, **kwargs) 125 | else: 126 | f(*returned_args) 127 | 128 | return __generic_callback 129 | 130 | def __bind_hooks(self, methods): 131 | """ 132 | bind every method (at the moment) 133 | with a bind_"method_name" function 134 | so the user can bind their callbacks to be called at specific rates 135 | or on each update 136 | :param methods: 137 | :return: 138 | """ 139 | # print("METHODS IDENTIFIED: ", methods) 140 | for gc_f_name, method in methods: 141 | new_method_name = gc_f_name + '_complete' 142 | # print("method generated: ", new_method_name) 143 | f = self.__generic_bind_function_template() 144 | f.__annotations__ = method.__annotations__ 145 | f.__kwdefaults__ = {'hz': -1, 'gc_f_name': gc_f_name} 146 | f = self.__bind(self, f, new_method_name) 147 | 148 | # print('_complete method signature: ', inspect.signature(f)) 149 | # add the gc_f_name to the current list of methods bound 150 | # print("overwriting do_ method: ", gc_f_name) 151 | self.__methods_bound[gc_f_name] = {'args': (), 'kwargs': {}, 'returned_args': [None], -1: []} 152 | # print("dictionary updated: ", self.__methods_bound[gc_f_name]) 153 | # overwrite bound function by user so we can perform calls to all hooked functions 154 | f = self.__generic_callback_template() 155 | # f.__defaults__.__setattr__('gc_f_name', gc_f_name) 156 | f.__kwdefaults__ = {'gc_f_name': gc_f_name, 'original_function': method} 157 | # print("set default args: ", f.__kwdefaults__) 158 | f.__annotations__ = method.__annotations__ 159 | # print("set default annotations: ", f.__annotations__) 160 | self.__bind(self, f, gc_f_name) 161 | # print("method bound to self.", ) 162 | # print("METHODS GENERATED DICT NEW DICT STRUCTURE FOR:", self.__class__) 163 | # print(self.__methods_bound) 164 | # print("==================") 165 | 166 | def __call_functions(self, hz, gc_f_name): 167 | """ 168 | Calls list of functions with latest arguments 169 | if returned args are not none (function is executed before calling the bound methods with arguments) 170 | then we call the bound methods with the returned arguments (processed) 171 | otherwise we call the bound methods with args and kwargs (unprocessed) 172 | :param f_list: 173 | :return: 174 | """ 175 | f_list = self.__methods_bound[gc_f_name][hz] 176 | # print(gc_f_name) 177 | # print(self.__methods_bound) 178 | original_f_args = self.__methods_bound[gc_f_name]['returned_args'] 179 | args = self.__methods_bound[gc_f_name]['args'] 180 | kwargs = self.__methods_bound[gc_f_name]['kwargs'] 181 | for f in f_list: 182 | if len(original_f_args) == 1 and original_f_args[0] is None: 183 | t = threading.Thread(target=f, args=args, kwargs=kwargs, daemon=True).start() 184 | else: 185 | t = threading.Thread(target=f, args=original_f_args, daemon=True).start() 186 | 187 | def __call(self, hz, gc_f_name): 188 | """ 189 | sends a call signal to all bound methods under the parent function. 190 | :param hz: call frequency 191 | :param gc_f_name: parent function name to which many methods are bound 192 | :return: 193 | """ 194 | while True: 195 | self.__call_functions(hz, gc_f_name) 196 | time.sleep(hz) 197 | 198 | def __start_call_thread(self, hz, gc_f_name): 199 | """ 200 | Starts the call thread for the relevant frequency of registered functions. 201 | each frequency has it's own thread where a sleep sleeps for that amount of time 202 | and calls all bound functions on wake. 203 | :param hz: interval to call functions (>0 204 | :return: 205 | """ 206 | t = threading.Thread(target=self.__call, args=(hz, gc_f_name), daemon=True).start() 207 | 208 | return GenericCard 209 | -------------------------------------------------------------------------------- /ImageProcessing/ImgTools.py: -------------------------------------------------------------------------------- 1 | # Purpose of this file is to manage a screenshot that has been taken, 2 | # make it easy to get a section of the specified section of the screenshot etc... 3 | import glob 4 | import json 5 | import math 6 | import os 7 | import sys 8 | import uuid 9 | from PIL import Image 10 | import cv2 11 | import matplotlib.pyplot as plt 12 | import numpy as np 13 | import scipy 14 | from scipy.ndimage.filters import maximum_filter 15 | from scipy.ndimage.morphology import generate_binary_structure, binary_erosion 16 | 17 | 18 | def crop_img(img, x, y, w, h, as_percentage=False): 19 | if as_percentage: 20 | t_h = len(img) 21 | t_w = len(img[0]) 22 | x = int(t_w * x) 23 | y = int(t_h * y) 24 | w = int(t_w * w) 25 | h = int(t_h * h) 26 | crop_img = img[y:y + h, x:x + w] 27 | return crop_img 28 | 29 | 30 | # def crop_img_percent(img, x, y, w, h): 31 | # return crop_img(img, p_x, p_y, p_w, p_h) 32 | 33 | 34 | def crop_img_two_coords(img, x1, y1, x2, y2, as_percentage=False): 35 | x = x1 36 | y = y1 37 | w = x2 - x1 38 | h = y2 - y1 39 | return crop_img(img, x, y, w, h, as_percentage) 40 | 41 | 42 | def save_img(img, name, with_uuid=False, format='.png', path='images/'): 43 | """ 44 | 45 | :param img: 46 | :param name: 47 | :param with_uuid: 48 | :return: 49 | """ 50 | if not os.path.exists(path): 51 | os.makedirs(path) 52 | if with_uuid: 53 | name += '_' + uuid.uuid4().__str__() 54 | name += format 55 | print("writing to: ", path + name) 56 | cv2.imwrite(path + name, img, ) 57 | 58 | 59 | def load_img(name): 60 | return cv2.imread(name) 61 | 62 | 63 | def resize_img(img, dim, percent=False): 64 | # print("resizeing") 65 | # print(img.shape,dim,percent) 66 | if percent: 67 | wh = np.array([img.shape[0], img.shape[1]]) * dim 68 | wh = np.round(wh).astype(int) 69 | dim = tuple(wh) 70 | # flip the dimension. for cv2 resize 71 | dim = tuple(np.flip(dim[:2])) 72 | n = cv2.resize(img, dim, interpolation=cv2.INTER_AREA) 73 | # print(n.shape) 74 | # print("----------------------------") 75 | return n 76 | 77 | 78 | def resize_images(img_list, dim): 79 | resized_arr = np.empty(shape=(len(img_list), *dim)) 80 | for i, m in enumerate(img_list): 81 | resized_arr[i] = resize_img(m, dim) 82 | return resized_arr 83 | 84 | 85 | def load_dir(file_regx, img_dim): 86 | filenames = glob.glob(file_regx) 87 | image_list = np.empty((len(filenames), *img_dim), dtype=np.uint8) 88 | for i, filename in enumerate(filenames): # assuming gif 89 | image_list[i] = load_img(filename).astype(np.uint8) 90 | print('loaded: ', image_list.shape) 91 | return image_list 92 | 93 | 94 | def show_img(img): 95 | plt.imshow(img) 96 | plt.show() 97 | 98 | 99 | def crop_center(img, x, y, width, height): 100 | return crop_img(img, int(x - width / 2), int(y - height / 2), width, height) 101 | 102 | 103 | def template_match_tfmodel(template, test_dim_np, preproces_func, predict_func, kx, ky): 104 | max_y, max_x = (np.array(template.shape) - np.array(test_dim_np))[:2] 105 | print(max_x, max_y) 106 | print(max_x * max_y) 107 | # check every k pixels 108 | max_x = math.floor(max_x / kx) 109 | max_y = math.floor(max_y / ky) 110 | X = np.empty((max_x * max_y, *test_dim_np), dtype=np.uint8) 111 | p = np.zeros((max_x * max_y, 2), dtype=np.uint8) 112 | crop_dim = np.flip(test_dim_np[:2]) 113 | print("crop dimensions: ", crop_dim) 114 | index = 0 115 | for i in range(max_x): 116 | for j in range(max_y): 117 | x = i * kx 118 | y = j * ky 119 | p[index][0] = j 120 | p[index][1] = i 121 | X[index] = crop_img(template, x, y, *crop_dim) 122 | index += 1 123 | 124 | X = preproces_func(X) 125 | probs = predict_func(X) 126 | pict = np.zeros((max_y, max_x)) 127 | for i, val in enumerate(probs): 128 | y, x = p[i] 129 | if (np.argmax(val) == 0): 130 | pict[y][x] = np.max(val) 131 | else: 132 | pict[y][x] = np.max(val) 133 | pict += np.min(pict) 134 | pict *= (1 / np.max(pict)) 135 | return pict 136 | 137 | 138 | def resize_bigger_to_smaller_img(img1, img2): 139 | if img1.shape == img2.shape: 140 | return img1, img2 141 | if np.sum(img1.shape) > np.sum(img2.shape): 142 | return resize_img(img1, img2.shape), img2 143 | else: 144 | return img1, resize_img(img2, img1.shape) 145 | 146 | 147 | def get_image_difference(image_1, image_2): 148 | first_image_hist = cv2.calcHist([image_1], [0], None, [256], [0, 256]) 149 | second_image_hist = cv2.calcHist([image_2], [0], None, [256], [0, 256]) 150 | 151 | img_hist_diff = cv2.compareHist(first_image_hist, second_image_hist, cv2.HISTCMP_BHATTACHARYYA) 152 | img_template_probability_match = \ 153 | cv2.matchTemplate(first_image_hist, second_image_hist, cv2.TM_CCOEFF_NORMED)[0][0] 154 | img_template_diff = 1 - img_template_probability_match 155 | 156 | # taking only 10% of histogram diff, since it's less accurate than template method 157 | commutative_image_diff = (img_hist_diff / 10) + img_template_diff 158 | return commutative_image_diff 159 | 160 | 161 | def find_circles(img, radius_range=np.array([0, 1]), area=np.array([0, 0, 0, 1]), as_percent=True): 162 | img2 = crop_img(img, *area, as_percentage=as_percent) 163 | # img2 = threshold(img2, np.array([200, 200, 200]), np.array([255, 255, 255])) 164 | 165 | gray = cv2.cvtColor(img2, cv2.COLOR_BGR2GRAY) 166 | show_img(gray) 167 | try: 168 | circles = cv2.HoughCircles(gray, cv2.HOUGH_GRADIENT, 1.2, 100)[0] 169 | except Exception as e: 170 | print("None Found") 171 | return [] 172 | min_r = radius_range[0] * img.shape[1] 173 | max_r = radius_range[1] * img.shape[1] 174 | 175 | circles = circles.astype(int) 176 | circles += np.array([area[0] * img.shape[1], area[1] * img.shape[0], 0]).astype(int) 177 | circles = circles.astype(int) 178 | for (x, y, r) in circles: 179 | # draw the circle in the output image, then draw a rectangle 180 | # corresponding to the center of the circle 181 | cv2.circle(img, (x, y), r, (255, 0, 0), 4) 182 | cv2.rectangle(img, (x - 5, y - 5), (x + 5, y + 5), (255, 128, 0), -1) 183 | show_img(img) 184 | print("IMAGE SHOWN: ",len(circles)) 185 | circles = circles[circles[:, 2] > min_r] 186 | circles = circles[circles[:, 2] < max_r] 187 | print(len(circles)) 188 | for c in circles: 189 | print(c) 190 | return circles 191 | 192 | def img_col_similarity(img1, img2): 193 | """ 194 | returns similarity of two image by color: 195 | using mse for now/ 196 | summ diff/total 197 | :param img1: 198 | :param img2: 199 | :return: 200 | """ 201 | # print(get_image_difference(img1,img2)) 202 | print("comp sim") 203 | print(img1.shape, img2.shape) 204 | img1, img2 = resize_bigger_to_smaller_img(img1, img2) 205 | print(img1.shape, img2.shape) 206 | err = np.sum((img1.astype("float") - img2.astype("float")) ** 2) 207 | err /= (255 * np.prod(img1.shape)) 208 | # # show_img(img1) 209 | # # show_img(img2) 210 | # img3 = cv2.subtract(img1, img2) 211 | # # print(img3[0]) 212 | # # show_img(img3) 213 | # tot = 125 * np.prod(img1.shape) 214 | # delta = np.sum(img3) 215 | print(1 - err) 216 | return 1 - err 217 | 218 | 219 | def update_img_from_details(img_update_from, img_name, path, format='.png'): 220 | img = img_update_from 221 | 222 | # show_img(img) 223 | 224 | details = json.loads(open(path + img_name + '.json', 'r').read()) 225 | img = crop_img(img, *details['xy'], *details['wh'], details['as_percentage']) 226 | save_img(img, img_name, format=format, path=path) 227 | 228 | 229 | def find_peaks(p_2d_arr, threshold): 230 | """ 231 | Finds all the maximas which are above a threshold on a 2d probability plane. 232 | :param p_2d_arr: 233 | :param threshold: 234 | :return: 235 | """ 236 | # make zero anything bellow threshold. 237 | p_2d_arr[p_2d_arr < threshold] = 0 238 | 239 | # define an 8-connected neighborhood 240 | neighborhood = generate_binary_structure(2, 2) 241 | 242 | # apply the local maximum filter; all pixel of maximal value 243 | # in their neighborhood are set to 1 244 | local_max = maximum_filter(p_2d_arr, footprint=neighborhood) == p_2d_arr 245 | # local_max is a mask that contains the peaks we are 246 | # looking for, but also the background. 247 | # In order to isolate the peaks we must remove the background from the mask. 248 | 249 | # we create the mask of the background 250 | background = (p_2d_arr == 0) 251 | 252 | # a little technicality: we must erode the background in order to 253 | # successfully subtract it form local_max, otherwise a line will 254 | # appear along the background border (artifact of the local maximum filter) 255 | eroded_background = binary_erosion(background, structure=neighborhood, border_value=1) 256 | 257 | # we obtain the final mask, containing only peaks, 258 | # by removing the background from the local_max mask (xor operation) 259 | detected_peaks = local_max ^ eroded_background 260 | 261 | return scipy.ndimage.measurements.label(detected_peaks) 262 | 263 | 264 | def threshold(img, threshold_lower, threshold_upper): 265 | gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) 266 | mask = cv2.inRange(img, threshold_lower, threshold_upper) 267 | mask_rgb = cv2.cvtColor(mask, cv2.COLOR_GRAY2BGR) 268 | return img & mask_rgb 269 | 270 | 271 | def template_match(small_img, large_img): 272 | w2, h2 = large_img.shape[0], large_img.shape[1] 273 | w, h = small_img.shape[0], small_img.shape[1] 274 | 275 | img = small_img.copy() 276 | method = cv2.TM_CCOEFF 277 | # Apply template Matching 278 | 279 | res = cv2.matchTemplate(small_img, large_img, cv2.TM_CCOEFF_NORMED) 280 | threshold = 0.8 281 | loc = np.where(res >= threshold) 282 | return res 283 | # # print(w,h) 284 | # # If the method is TM_SQDIFF or TM_SQDIFF_NORMED, take minimum 285 | # if method in [cv2.TM_SQDIFF, cv2.TM_SQDIFF_NORMED]: 286 | # top_left = min_loc 287 | # else: 288 | # top_left = max_loc 289 | # bottom_right = (top_left[0] + w, top_left[1] + h) 290 | # cv2.rectangle(img, top_left, bottom_right, 255, 2) 291 | # plt.subplot(121), plt.imshow(res, cmap='gray') 292 | # plt.title('Matching Result'), plt.xticks([]), plt.yticks([]) 293 | # plt.subplot(122), plt.imshow(img, cmap='gray') 294 | # plt.title('Detected Point'), plt.xticks([]), plt.yticks([]) 295 | # plt.show() 296 | # return min_val, max_val, np.array(max_loc) + np.array((w2 / 2, h2 / 2)) 297 | 298 | 299 | class Image: 300 | """ 301 | Image in this project is an image of some fictional/actual larger image 302 | we specify it's crop function (x,y,w,h) as a percentage of the larger image so it can b cropped out. 303 | The above is as a percentage 304 | 305 | The image has an associated json file to which the state is saved and loaded from. 306 | 307 | """ 308 | 309 | def __init__(self, crop_percent_dim=(0, 0, 1, 1), img=np.array([]), name='default', img_path='images/'): 310 | self.name = name 311 | self.img_path = img_path 312 | self.img = img 313 | self.crop_percent_dim = crop_percent_dim 314 | self.js_name = name 315 | 316 | def to_json(self): 317 | return json.dumps(self.__dict__) 318 | 319 | @staticmethod 320 | def load(js): 321 | return Image(**js) 322 | 323 | 324 | class TfImageFinder: 325 | def __init__(self, model, preprocessor, match_np_dim=(100, 150), divisor=(4, 4), threshold=0.8): 326 | """ 327 | 328 | :param model: 329 | :param preprocessor: 330 | :param match_np_dim: 331 | :param divisor: 332 | :param threshold: 333 | """ 334 | self.preprocessor = preprocessor 335 | self.model = model 336 | self.match_np_dim = np.array(match_np_dim) 337 | self.divisor = np.array(divisor) 338 | self.threshold = threshold 339 | 340 | def find_locations(self, test_img): 341 | pict = template_match_tfmodel(test_img, self.match_np_dim, self.preprocessor, self.model.predict, *self.divisor) 342 | pict_peaks = find_peaks(pict, self.threshold) 343 | print("===========================") 344 | peaks = np.where(pict_peaks[0] > self.threshold) 345 | peaks = np.array(peaks) 346 | peaks = peaks.T 347 | peaks *= self.divisor 348 | offset = self.match_np_dim / 2 349 | print(offset) 350 | peaks += offset.astype(int)[:-1] 351 | # show_img(test_img) 352 | # show_img(pict) 353 | # show_img(pict_peaks[0]) 354 | return pict, peaks 355 | 356 | 357 | def find_image_locations(model, test_img, match_np_dim=(100, 150), divisor=(10, 10), threshold=0.8): 358 | pass 359 | --------------------------------------------------------------------------------