├── LICENSE ├── S-WA-bot.py ├── __pycache__ └── pointer_action.cpython-311.pyc └── pointer_action.py /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2022, S Sidharth 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /S-WA-bot.py: -------------------------------------------------------------------------------- 1 | import pyautogui as pi 2 | from time import sleep 3 | from pointer_action import * 4 | 5 | #Whatsapp auto boardcast bot designed by S Sidharth 6 | 7 | class action(): 8 | def __init__(self,x ,y): 9 | self.x=x 10 | self.y=y 11 | sleep(.005) 12 | def movement(self): 13 | pi.moveTo(x=self.x, y=self.y ,duration=.001) 14 | def mouse_click(self): 15 | pi.click(x=self.x, y=self.y) 16 | 17 | 18 | def text_paste(paste): 19 | pi.typewrite(paste) 20 | 21 | 22 | 23 | action1=action(905, 747) 24 | action1.movement() 25 | action1.mouse_click() 26 | 27 | action2=action(708, 107) 28 | action2.movement() 29 | action2.mouse_click() 30 | 31 | 32 | #here to start loop 33 | 34 | 35 | group_name="S-WA-bot" 36 | text_paste(group_name) #search group name 37 | 38 | sleep(1) 39 | 40 | action3=action(748, 230) 41 | action3.movement() 42 | action3.mouse_click() 43 | 44 | action4=action(1066, 499) 45 | action4.movement() 46 | action4.mouse_click() 47 | 48 | sleep(1) 49 | 50 | new_chat="http://wa.me/+919496225620" 51 | text_paste(new_chat) 52 | 53 | 54 | 55 | sleep(1) 56 | action5=action(1325, 490) #send hyperlink 57 | action5.movement() 58 | action5.mouse_click() 59 | 60 | 61 | sleep(3) 62 | 63 | action6=action(1152, 421) #open link 64 | action6.movement() 65 | action6.mouse_click() 66 | sleep(2) 67 | action7=action(238, 256) #open chat in web 68 | action7.movement() 69 | action7.mouse_click() 70 | sleep(1) 71 | action8=action(988, 488) #open paper clip 72 | action8.movement() 73 | action8.mouse_click() 74 | sleep(1) 75 | action9=action(988, 432) #open gallery 76 | action9.movement() 77 | action9.mouse_click() 78 | sleep(1) 79 | action10=action(1094, 167) #select picture 80 | action10.movement() 81 | action10.mouse_click() 82 | sleep(1) 83 | action11=action(1120, 446) #open picture 84 | action11.movement() 85 | action11.mouse_click() 86 | sleep(1) 87 | action12=action(1358, 496) #picture/video send 88 | action12.movement() 89 | action12.mouse_click() 90 | sleep(1) 91 | action13=action(988, 488) #open paper clip 92 | action13.movement() 93 | action13.mouse_click() 94 | sleep(1) 95 | action14=action(988, 432) #open gallery 96 | action14.movement() 97 | action14.mouse_click() 98 | sleep(1) 99 | action15=action(1215, 161) #select video 100 | action15.movement() 101 | action15.mouse_click() 102 | sleep(1) 103 | action11=action(1120, 446) #open button 104 | action11.movement() 105 | action11.mouse_click() 106 | sleep(5) 107 | action16=action(1358, 496) #picture/video send 108 | action16.movement() 109 | action16.mouse_click() 110 | sleep(1) -------------------------------------------------------------------------------- /__pycache__/pointer_action.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/callmesidhu/Python-GUI-automation/772ef1b5da0e877a8a4dbd4be6f035784d787232/__pycache__/pointer_action.cpython-311.pyc -------------------------------------------------------------------------------- /pointer_action.py: -------------------------------------------------------------------------------- 1 | import pyautogui as pi 2 | from time import sleep 3 | 4 | sleep(5) 5 | 6 | #To find pointer target 7 | 8 | def pointer_position(): 9 | pointer_live_position=pi.position() 10 | print(pointer_live_position) 11 | 12 | pointer_position() 13 | --------------------------------------------------------------------------------