A python code to post comments / Messages automatically.
Sending Love messages to your partner can be very effective. But as we always don't have that much time to do so, also as I was learning Python and I love making robots I thought to make an automated (semi automated actually) robotic comment or messaging system for my girl friend.
Sending Love messages to your partner can be very effective. But as we always don't have that much time to do so, also as I was learning Python and I love making robots I thought to make an automated (semi automated actually) robotic comment or messaging system for my girl friend.
Things must need:
- A computer with python3 installed. Download from here. Make sure to add python to your environment variable path. Just check the box that tells you to do so.
- pyautgui library. Open up Command prompt or Powershell then type
pip install pyautogui
pyautogui does the work of typing automatically, it is a GUI (Graphical User Interface) library kind of like tkinter but not as good as tkinter. But for this message automation task it is better than tkinter.
The Code:
Then download the code from here or copy from below. It is recommended to download the code from the link as zip file to avoid difficulties.
""" ***Sending Automated messages or Comments**** | |
Warning: DO NOT USE THIS FOR VIOLATION | |
I will NOt hold responsibilites if something wrong is done using this code | |
""" | |
""" | |
by: Ashraf Minhaj | |
mail: ashraf_minhaj@yahoo.com | |
blog: http://ashrafminhajfb.blogspot.com | |
python version: python3.7.1 | |
""" | |
import pyautogui | |
from time import sleep | |
from random import randint | |
x = 50 #how many messages or comments you want to send | |
def name(): | |
"""generates random names""" | |
nameList = ["Baby", "Shona", "Honey", "Jaan", "Wifey"] #list of names (change according to your requirement) | |
rand_name = nameList[randint(0, len(nameList) - 1)] #traverse names randomly for n, from 0 to (n-1) | |
return rand_name #return the random name it just generated | |
while True: #forever loop | |
pyautogui.typewrite(f"I love you {name()}") #type message | |
sleep(.600) #A bit delay of 600 ms | |
pyautogui.typewrite("\n") #New line, here 'Enter' to send text | |
sleep(2) #delay of 2 seconds | |
x = x - 1 #decrement x value by 1 | |
if x == 0: | |
break #get out of the loop and finish |
That's it now you can run the code from command prompt. Here's an advice. Don't use Ide/idle to do code, this will kill your ability and quality. Use an editor to code then run from command prompt. To run a python code from command prompt or powershell:
- Copy the path of the python code/script
- Open up Cmd (Command Prompt) / Powershell
- Type python followed by the copied path (watch the video above for better understanding)
Thats it, now after running the code put the cursor in a where you want the comment/ message to be typed. You'll see the magic.
This comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by the author.
Delete