Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Non repetitive mouse click
#2
Don't put this in your loop if it is only supposed to happen once.
        #TARGET ENEMY <<< THIS IS WHAT I NEED TO ONLY RUN ONE TIME>>>>
        if pyautogui.pixel (1096,127) [0] == 16:
            click(1096,127) 
These are getting called each time the loop executes.
        if pyautogui.pixel (1351, 1267) [0] == 251:
        if pyautogui.pixel (1452, 1271) [0] == 158
        if pyautogui.pixel (1351, 1267) [0] == 251:
If the associated code blocks don't execute it means the pixel[0] != 251 or 158.
Sartre likes this post
Reply


Messages In This Thread
Non repetitive mouse click - by Sartre - Apr-21-2023, 04:12 PM
RE: Non repetitive mouse click - by deanhystad - Apr-21-2023, 04:19 PM
RE: Non repetitive mouse click - by Sartre - Apr-21-2023, 04:27 PM
RE: Non repetitive mouse click - by Sartre - Apr-21-2023, 04:32 PM
RE: Non repetitive mouse click - by Sartre - Apr-22-2023, 03:05 PM
RE: Non repetitive mouse click - by deanhystad - Apr-22-2023, 06:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  how to mouse click a specific item in pygame? Frankduc 5 1,794 May-03-2022, 06:22 PM
Last Post: Frankduc
  How to script repetitive tasks in dynaform using python BenneGrus 0 1,370 Dec-22-2021, 08:36 AM
Last Post: BenneGrus
  Move mouse and click in particular position biprabu 3 2,546 Sep-01-2020, 08:23 PM
Last Post: deanhystad
  Slide show with mouse click pausing aantono 1 2,256 Jan-28-2020, 04:25 AM
Last Post: Larz60+
  mouse 0.7.0 - mouse polling hate 125-1000hz penahuse 1 2,573 Dec-06-2019, 09:51 PM
Last Post: Larz60+
  Why is left mouse click not working? yeto 3 6,289 Jul-15-2019, 05:23 AM
Last Post: Yoriz
  How to get mouse coordinates on click and release OhNoSegFaultAgain 1 3,031 May-17-2019, 06:56 PM
Last Post: buran
  Python catch mouse click in pure text, no graphics samtal 7 7,423 Sep-10-2018, 03:02 PM
Last Post: samtal
  Mouse click movements? [UPDATED] minnaadel 3 3,600 Mar-31-2018, 05:15 PM
Last Post: woooee
  How to trigger a function by clicking the left mouse click? HelloBoyz 1 9,502 Jun-29-2017, 09:43 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020