天龙怀旧游戏python脚本

news2024/11/26 10:35:15

设置图:

游戏窗口最大化。

海贼洞这里定位你要回点的定位。

运行bat就行,脚本出错了还是会重新运行脚本,运行自动启动,end暂停脚本,home重新启动脚本

1.  我常用的是内挂回点脚本,

下面都是前台脚本,如果颜色点位没有区别,那么恭喜直接可以用,如果不能正常运作,那么颜色点位不一样,思路给你了,抓点抓色对应修改动手一下吧。

新建批处理 ng.bat

@echo off  
set "script_path=E:\soft\game\sleep\NG.py"  :: 替换为你的python.py脚本的实际路径  
set "max_wait=120"                             :: 设置等待时间为120秒(2分钟)  
timeout /t 5  
:loop  
    echo Checking python.py...  
    powershell -Command "Start-Process python -Verb RunAs -ArgumentList '""%script_path%"""' -Wait"  
    if %errorlevel% neq 0 (  
        echo python.py failed. Waiting %max_wait% seconds before retrying...  
        timeout /t %max_wait% >nul  
    ) else (  
        echo python.py executed successfully.  
    )  
goto :loop

新建python脚本 ng.py

# -*- coding: utf-8 -*-  
import pygetwindow as gw  
import pyautogui  
import time  
import random  
import threading  
from pynput.keyboard import Key,Listener  
  
running = True  
listener = None  
  
def perform_click(x,y,duration=0.2,delay_range=(0.3,0.4)):  
    pyautogui.moveTo(x,y,duration=duration)  
    delay = random.uniform(*delay_range)  
    time.sleep(delay)  
    pyautogui.mouseDown(x,y,button='left')  
    delay = random.uniform(*delay_range)  
    time.sleep(delay)  
    pyautogui.mouseUp(x,y,button='left')  
  
def on_press(key):  
    global running  
    if key == Key.home:  
        print("继续运行脚本")  
        running = True  
    elif key == Key.end:  
        print("暂停运行脚本")  
        running = False  
  
def start_listener():  
    global listener  
    with Listener(on_press=on_press) as listener:  
        listener.join()  
  
listener_thread = threading.Thread(target=start_listener,daemon=True)  
listener_thread.start()  
delay = random.uniform(2.3,2.5)
time.sleep(delay)  

while True:  
    if running:  

        color1 = pyautogui.pixel(2544,144)  #内挂
        if color1 == (255,243,49):  
            perform_click(2544,144,duration=0.5,delay_range=(0.3,0.5))  
            delay = random.uniform(0.5,1.0)
            time.sleep(delay)
            pyautogui.moveTo(1600,169, duration=0.2)

  
        color4 = pyautogui.pixel(1294,322)          #断线点1
        color5 = pyautogui.pixel(1177,335)          #断线点2
        if color4 == (255,242,99)  and color5 == (255,242,99)  :  
            delay = random.uniform(15.0,20.0)
            time.sleep(delay)
            perform_click(1344,356,duration=0.2,delay_range=(0.3,0.5))  
            delay = random.uniform(5.0,6.0)
            time.sleep(delay)


        color2 = pyautogui.pixel(1205,397)          #死亡判断点1
        color3 = pyautogui.pixel(1150,397)          #死亡判断点2
        if color2 == (37,37,37)  and      color3 == (37,37,37) :
            delay = random.uniform(200,210)
            time.sleep(delay)
            perform_click(1357,397,duration=0.2,delay_range=(0.3,0.5))  
            delay = random.uniform(5.0,6.0)
            time.sleep(delay)
            # 上面是人物死亡出鞘
            pyautogui.press('tab')
            delay = random.uniform(0.5,1.0)
            time.sleep(delay)
            perform_click(2448,326,duration=0.2,delay_range=(0.3,0.5))  
            pyautogui.mouseDown(2448,326,button='left')
            pyautogui.mouseUp(2448,326 ,button='left')    
            delay = random.uniform(0.04,0.05)
            time.sleep(delay)
            pyautogui.mouseDown(2448,326,button='left')
            pyautogui.mouseUp(2448,326,button='left')      
            delay = random.uniform(3,4)
            time.sleep(delay)
            pyautogui.press('tab')
            delay = random.uniform(0.5,1.0)
            time.sleep(delay)
            perform_click(73,351,duration=0.2,delay_range=(0.3,0.5))  
            delay = random.uniform(5,6)
            time.sleep(delay)
            #上面是走出地府
            delay = random.uniform(2.0,2.2)
            time.sleep(delay)
            perform_click(1299,1313,duration=0.2,delay_range=(0.3,0.5))              
            delay = random.uniform(0.5,1.0)
            time.sleep(delay)
            perform_click(1361,866,duration=0.2,delay_range=(0.3,0.5))     
            delay = random.uniform(0.5,1.0)
            time.sleep(delay)
            perform_click(1419,936,duration=0.2,delay_range=(0.3,0.5))             
            delay = random.uniform(0.5,1.0)
            time.sleep(delay)
            perform_click(1296,825,duration=0.2,delay_range=(0.3,0.5))       
            delay = random.uniform(8,9)
            time.sleep(delay)
            #上面是大理使用地彻符起飞

        color7799 = pyautogui.pixel(575,208)          #珍兽未关闭
        if color7799 == (248,196,88) :  
            delay = random.uniform(0.5,0.8)
            time.sleep(delay)
            perform_click(968,1383,duration=0.2,delay_range=(0.3,0.5))    
            delay = random.uniform(0.5,0.8)
            time.sleep(delay)


        color7788 = pyautogui.pixel(93,112)          #珍兽未出站
        if color7788 != (231,211,123) :  
            delay = random.uniform(0.3,0.5)
            time.sleep(delay)
            perform_click(968,1383,duration=0.2,delay_range=(0.3,0.5))    
            delay = random.uniform(0.5,0.8)
            time.sleep(delay)
       
        color77991 = pyautogui.pixel(575,208)          #珍兽未关闭
        if color77991 == (248,196,88) :  
            perform_click(191,505,duration=0.2,delay_range=(0.3,0.5))    
            delay = random.uniform(0.5,0.8)
            time.sleep(delay)
            perform_click(194,542,duration=0.2,delay_range=(0.3,0.5))    
            delay = random.uniform(3.5,4.0)
            time.sleep(delay)
            perform_click(968,1383,duration=0.2,delay_range=(0.3,0.5))    
            delay = random.uniform(0.5,0.8)
            time.sleep(delay)

  
    time.sleep(0.5)  # 
  
# 由于listener是一个daemon线程,它会在主线程结束时自动退出。因此,不需要显式停止它。

2.  打马活动脚本

新建批处理 dm.bat

@echo off  
set "script_path=E:\soft\game\sleep\DM.py"  :: 替换为你的python.py脚本的实际路径  
set "max_wait=120"                             :: 设置等待时间为120秒(2分钟)  
timeout /t 5  
:loop  
    echo Checking python.py...  
    powershell -Command "Start-Process python -Verb RunAs -ArgumentList '""%script_path%"""' -Wait"  
    if %errorlevel% neq 0 (  
        echo python.py failed. Waiting %max_wait% seconds before retrying...  
        timeout /t %max_wait% >nul  
    ) else (  
        echo python.py executed successfully.  
    )  
goto :loop

新建python脚本 dm.py

# -*- coding: utf-8 -*-  
import pygetwindow as gw  
import pyautogui  
import time  
import random  
import threading  
from pynput.keyboard import Key,Listener  
  
running = True  
listener = None  
  
def perform_click(x,y,duration=0.2,delay_range=(0.3,0.4)):  
    pyautogui.moveTo(x,y,duration=duration)  
    delay = random.uniform(*delay_range)  
    time.sleep(delay)  
    pyautogui.mouseDown(x,y,button='left')  
    delay = random.uniform(*delay_range)  
    time.sleep(delay)  
    pyautogui.mouseUp(x,y,button='left')  
  
def on_press(key):  
    global running  
    if key == Key.home:  
        print("继续运行脚本")  
        running = True  
    elif key == Key.end:  
        print("暂停运行脚本")  
        running = False  
  
def start_listener():  
    global listener  
    with Listener(on_press=on_press) as listener:  
        listener.join()  

listener_thread = threading.Thread(target=start_listener,daemon=True)  
listener_thread.start()  


while True:  
    if running:  

                    colordanshua1 = pyautogui.pixel(278,52)  #有血
                    colordanshua2 = pyautogui.pixel(453,58)  #是马贼
                    colordanshua3 = pyautogui.pixel(279,35)  #白怪
                    colordanshua33 = pyautogui.pixel(279,35)  #红怪
                    if colordanshua1 == (255,162,150)    and colordanshua3  != (155,153,152)      and  colordanshua2 == (205,195,196)     or  colordanshua33  == (155,1,1)     :
                        pyautogui.press('F2')  
                        delay = random.uniform(0.11,0.12)
                        time.sleep(delay)  
                    else:  
                        pyautogui.press('F1')        
                        delay = random.uniform(0.11,0.12)
                        time.sleep(delay)    

                    colordanshua1  = pyautogui.pixel(278,52)  #没血
                    if colordanshua1 != (255,162,150)      :
                        pyautogui.press('F1')  
                        delay = random.uniform(0.11,0.12)
                        time.sleep(delay)          
              
                    colordanshua1  = pyautogui.pixel(278,64)  #怒气
                    if colordanshua1 == (255,255,213)      :
                        pyautogui.press('F1')  
                        delay = random.uniform(0.11,0.12)
                        time.sleep(delay)          

                    colordanshuamb1 = pyautogui.pixel(1206,136)  #目标1
                    colordanshuamb2 = pyautogui.pixel(1360,216)  #目标5
                    if colordanshuamb1 == (1,1,1)  and  colordanshuamb2 ==  (1,1,1)    :
                        pyautogui.press('F1')  
                        delay = random.uniform(0.11,0.12)
                        time.sleep(delay)    
            
                    colordanshua3 = pyautogui.pixel(279,35)  #红怪
                    colordanshua21 = pyautogui.pixel(360,52)  #怪物大半血
                    colordanshua23 = pyautogui.pixel(1224,1344)  #F4技能好了
                    if    colordanshua3  == (155,1,1)    and  colordanshua21 == (255,162,150)  and    colordanshua23 != (33,28,19)   :
                        delay = random.uniform(0.20,0.22)
                        time.sleep(delay)  
                        pyautogui.press('F5')  
                        delay = random.uniform(0.20,0.22)
                        time.sleep(delay)  
                        pyautogui.press('F4')  
                        delay = random.uniform(0.20,0.22)
                        time.sleep(delay)  
                        pyautogui.press('F6')  
                        delay = random.uniform(0.20,0.22)
                        time.sleep(delay)  
            
                    colordanshua33 = pyautogui.pixel(279,35)  #红怪
                    colordanshua21 = pyautogui.pixel(360,52)  #怪物大半血
                    colordanshua22 = pyautogui.pixel(1188,1344)  #F3技能好了
                    if    colordanshua33  == (155,1,1)   and  colordanshua21 == (255,162,150)  and  colordanshua22 != (33,28,19)    :
                        delay = random.uniform(0.2,0.3)
                        time.sleep(delay)  
                        pyautogui.press('F5')  
                        delay = random.uniform(0.20,0.22)
                        time.sleep(delay)  
                        pyautogui.press('F3')  
                        delay = random.uniform(0.20,0.22)
                        time.sleep(delay)  
              
                    colorlan2 = pyautogui.pixel(104,63)   #  没蓝
                    if colorlan2 != (193,188,255) :
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    
                        pyautogui.press('F7')  #  吃蓝
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    
            
            
                    colorjiaxue13 = pyautogui.pixel(166,57)   #  没血
                    if colorjiaxue13  !=(255,162,150)  :
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    
                        pyautogui.press('F10')  # 吃血
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    
            
                    colorccc1 = pyautogui.pixel(93,112)   # 宝宝在
                    colorccc2 = pyautogui.pixel(180,100)   # 珍兽50%血        
                    if colorccc1 == (231,211,123)  and  colorccc2  != (255,162,150) :   # 宝宝加血
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    
                        pyautogui.press('F8')  # 
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    
            
                    colorccc11 = pyautogui.pixel(93,112)   # 宝宝在
                    colorccc21 = pyautogui.pixel(150,100)   # 珍兽30%血        
                    if colorccc11 == (231,211,123)  and  colorccc21  != (255,162,150) :   # 宝宝加血
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    
                        pyautogui.press('F9')  # 
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    

                    colorcccdz1 = pyautogui.pixel(3,175)   # 队友1在
                    colorcccdz2 = pyautogui.pixel(58,69)   # 我是队长
                    if   colorcccdz1  == (0,0,0)  and  colorcccdz2  == (219,31,10) :   # 给队长
                        delay =  random.uniform(3.21,3.22)
                        time.sleep(delay)    
                        pyautogui.moveTo(20,170, duration=0.2)
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    
                        pyautogui.mouseDown(20,170, button='left')
                        pyautogui.mouseUp(20,170, button='left')
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    
                        pyautogui.mouseDown(20,170, button='right')
                        pyautogui.mouseUp(20,170, button='right')
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    
                        pyautogui.moveTo(47,243, duration=0.2)
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    
                        pyautogui.mouseDown(47,243, button='left')
                        pyautogui.mouseUp(47,243, button='left')
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    

                    colorcccdz3 = pyautogui.pixel(1581,1382)   # 闪烁
                    if   colorcccdz3  == (49,41,32)  :   # 加队
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    
                        pyautogui.moveTo(1581,1382, duration=0.2)
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    
                        pyautogui.mouseDown(1581,1382, button='left')
                        pyautogui.mouseUp(1581,1382, button='left')
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    
                        pyautogui.moveTo(1563,836, duration=0.2)
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    
                        pyautogui.mouseDown(1563,836, button='left')
                        pyautogui.mouseUp(1563,836, button='left')
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    


                    colorcccdz11 = pyautogui.pixel(3,175)   # 队友1不在
                    colorcccdz21 = pyautogui.pixel(58,69)   # 我是队长
                    if   colorcccdz11  != (0,0,0)  and  colorcccdz21  == (219,31,10) :   # 解散队
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    
                        pyautogui.moveTo(37,62, duration=0.2)
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    
                        pyautogui.mouseDown(37,62, button='left')
                        pyautogui.mouseUp(37,62, button='left')
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    
                        pyautogui.mouseDown(37,62, button='right')
                        pyautogui.mouseUp(37,62, button='right')
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    
                        pyautogui.moveTo(62,71, duration=0.2)
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    
                        pyautogui.mouseDown(62,71, button='left')
                        pyautogui.mouseUp(62,71, button='left')
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    


    time.sleep(0.02)  # 
  
# 由于listener是一个daemon线程,它会在主线程结束时自动退出。因此,不需要显式停止它。

3.  副本打怪脚本

新建批处理 dg.bat

@echo off  
set "script_path=E:\soft\game\sleep\DG.py"  :: 替换为你的python.py脚本的实际路径  
set "max_wait=120"                             :: 设置等待时间为120秒(2分钟)  
timeout /t 5  
:loop  
    echo Checking python.py...  
    powershell -Command "Start-Process python -Verb RunAs -ArgumentList '""%script_path%"""' -Wait"  
    if %errorlevel% neq 0 (  
        echo python.py failed. Waiting %max_wait% seconds before retrying...  
        timeout /t %max_wait% >nul  
    ) else (  
        echo python.py executed successfully.  
    )  
goto :loop

新建python脚本 dg.py

# -*- coding: utf-8 -*-  
import pygetwindow as gw  
import pyautogui  
import time  
import random  
import threading  
from pynput.keyboard import Key,Listener  
  
running = True  
listener = None  
  
def perform_click(x,y,duration=0.2,delay_range=(0.3,0.4)):  
    pyautogui.moveTo(x,y,duration=duration)  
    delay = random.uniform(*delay_range)  
    time.sleep(delay)  
    pyautogui.mouseDown(x,y,button='left')  
    delay = random.uniform(*delay_range)  
    time.sleep(delay)  
    pyautogui.mouseUp(x,y,button='left')  

  
def on_press(key):  
    global running  
    if key == Key.home:  
        print("继续运行脚本")  
        running = True  
    elif key == Key.end:  
        print("暂停运行脚本")  
        running = False  
  
def start_listener():  
    global listener  
    with Listener(on_press=on_press) as listener:  
        listener.join()  
  
listener_thread = threading.Thread(target=start_listener,daemon=True)  
listener_thread.start()  


while True:  
    if running:  

        colordanshua1 = pyautogui.pixel(278,52)  #有血
        if colordanshua1 == (255,162,150)  :
            pyautogui.press('F2')  
            delay = random.uniform(0.11,0.12)
            time.sleep(delay)  
        else:  
            pyautogui.press('F1')  
            delay = random.uniform(0.11,0.12)
            time.sleep(delay)    

        colordanshuamb1 = pyautogui.pixel(1206,136)  #目标1
        colordanshuamb2 = pyautogui.pixel(1360,216)  #目标5
        if colordanshuamb1 == (1,1,1)  and  colordanshuamb2 ==  (1,1,1)    :
            pyautogui.press('F1')  
            delay = random.uniform(0.11,0.12)
            time.sleep(delay)    


        colordanshua3 = pyautogui.pixel(279,35)  #红怪
        colordanshua21 = pyautogui.pixel(360,52)  #怪物大半血
        colordanshua23 = pyautogui.pixel(1224,1344)  #F4技能好了
        if    colordanshua3  == (155,1,1)    and  colordanshua21 == (255,162,150)  and    colordanshua23 != (33,28,19)   :
            delay = random.uniform(0.2,0.3)
            time.sleep(delay)  
            pyautogui.press('F5')  
            delay = random.uniform(0.2,0.3)
            time.sleep(delay)  
            pyautogui.press('F4')  
            delay = random.uniform(0.2,0.3)
            time.sleep(delay)  
            pyautogui.press('F6')  
            delay = random.uniform(0.2,0.3)
            time.sleep(delay)  


        colordanshua211 = pyautogui.pixel(278,52)  #有血
        if colordanshua211 == (255,162,150)  :
            pyautogui.press('F2')  
            delay = random.uniform(0.11,0.12)
            time.sleep(delay)  
        else:  
            pyautogui.press('F1')  
            delay = random.uniform(0.11,0.12)
            time.sleep(delay)    


        colordanshua33 = pyautogui.pixel(279,35)  #红怪
        colordanshua21 = pyautogui.pixel(360,52)  #怪物大半血
        colordanshua22 = pyautogui.pixel(1188,1344)  #F3技能好了
        if    colordanshua33  == (155,1,1)   and  colordanshua21 == (255,162,150)  and  colordanshua22 != (33,28,19)    :
            delay = random.uniform(0.2,0.3)
            time.sleep(delay)  
            pyautogui.press('F5')  
            delay = random.uniform(0.2,0.3)
            time.sleep(delay)  
            pyautogui.press('F3')  
            delay = random.uniform(0.2,0.3)
            time.sleep(delay)  




        colorjiaxue1 = pyautogui.pixel(93,112)   # 宝宝在
        colorjiaxue2 = pyautogui.pixel(166,57)   #  没血
        colorjiaxue5 = pyautogui.pixel(1477,1298)   #  共生
        colorjiaxue6 = pyautogui.pixel(199,100)   # 宝宝满血
        if colorjiaxue1 == (231,211,123)    and colorjiaxue2 != (255,162,150)     and      colorjiaxue5  != (49,41,29)  and      colorjiaxue6  == (255,162,150) :
            delay =  random.uniform(0.21,0.22)
            time.sleep(delay)    
            perform_click(1477,1315,duration=0.2,delay_range=(0.3,0.5))  
            delay =  random.uniform(0.21,0.22)
            time.sleep(delay)    


        colorlan2 = pyautogui.pixel(104,63)   #  没蓝
        if colorlan2 != (193,188,255) :
            delay =  random.uniform(0.21,0.22)
            time.sleep(delay)    
            pyautogui.press('F7')  #  吃蓝
            delay =  random.uniform(0.21,0.22)
            time.sleep(delay)    



        colorjiaxue14 = pyautogui.pixel(93,112)   # 宝宝不在
        colorjiaxue13 = pyautogui.pixel(166,57)   #  没血
        if colorjiaxue13  !=(255,162,150)  and  colorjiaxue14  != (231,211,123):
            delay = random.uniform(0.2,0.3)
            time.sleep(delay)    
            pyautogui.press('F10')  # 吃血
            delay =  random.uniform(0.21,0.22)
            time.sleep(delay)    



        colorccc1 = pyautogui.pixel(93,112)   # 宝宝在
        colorccc2 = pyautogui.pixel(180,100)   # 珍兽30%血        
        if colorccc1 == (231,211,123)  and  colorccc2  != (255,162,150) :   # 宝宝加血
            delay =  random.uniform(0.21,0.22)
            time.sleep(delay)    
            pyautogui.press('F8')  # 
            delay =  random.uniform(0.21,0.22)
            time.sleep(delay)    

        colorccc11 = pyautogui.pixel(93,112)   # 宝宝在
        colorccc21 = pyautogui.pixel(150,100)   # 珍兽30%血        
        if colorccc11 == (231,211,123)  and  colorccc21  != (255,162,150) :   # 宝宝加血
            delay =  random.uniform(0.21,0.22)
            time.sleep(delay)    
            pyautogui.press('F9')  # 
            delay =  random.uniform(0.21,0.22)
            time.sleep(delay)    
  
    time.sleep(0.02)  # 
  
# 由于listener是一个daemon线程,它会在主线程结束时自动退出。因此,不需要显式停止它。

4.  摆摊(路中央)

1.  思路,先点击摆摊  不确认 然后轻功飞到中间位置,飞的过程中确认摆摊,手动也可以成功,但是考验手速,轻功位置看最上面的技能图

bat

@echo off  
set "script_path=E:\soft\game\sleep\baitan.py"  :: 替换为你的python.py脚本的实际路径  
set "max_wait=120"                             :: 设置等待时间为120秒(2分钟)  
timeout /t 5  
:loop  
    echo Checking python.py...  
    powershell -Command "Start-Process python -Verb RunAs -ArgumentList '""%script_path%"""' -Wait"  
    if %errorlevel% neq 0 (  
        echo python.py failed. Waiting %max_wait% seconds before retrying...  
        timeout /t %max_wait% >nul  
    ) else (  
        echo python.py executed successfully.  
    )  
goto :loop

python

# -*- coding: utf-8 -*-  
import pygetwindow as gw  
import pyautogui  
import time  
import random  
import threading  
from pynput.keyboard import Key,Listener  
  
running = True  
listener = None  
  
def perform_click(x,y,duration=0.2,delay_range=(0.3,0.4)):  
    pyautogui.moveTo(x,y,duration=duration)  
    delay = random.uniform(*delay_range)  
    time.sleep(delay)  
    pyautogui.mouseDown(x,y,button='left')  
    delay = random.uniform(*delay_range)  
    time.sleep(delay)  
    pyautogui.mouseUp(x,y,button='left')  

  
def on_press(key):  
    global running  
    if key == Key.home:  
        print("继续运行脚本")  
        running = True  
    elif key == Key.end:  
        print("暂停运行脚本")  
        running = False  
  
def start_listener():  
    global listener  
    with Listener(on_press=on_press) as listener:  
        listener.join()  
  
listener_thread = threading.Thread(target=start_listener,daemon=True)  
listener_thread.start()  


while True:  
    if running:  
                        delay =  random.uniform(2.1,2.2)
                        time.sleep(delay)    
                        pyautogui.moveTo(2249,1094, duration=0.2)  移动到背包摆摊
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    
                        pyautogui.mouseDown(2249,1094, button='left')   点击背包摆摊
                        pyautogui.mouseUp(2249,1094, button='left')  点击背包摆摊
                        delay =  random.uniform(0.21,0.22)
                        time.sleep(delay)    


                        colordanshua1 = pyautogui.pixel(1395,615)  
                        if colordanshua1 == (245,191,80)  :  #摆摊中间界面打开右上角黄色,说明此处可以摆摊
                               pyautogui.moveTo(1118,1279, duration=0.2)  #  移动到轻功
                               delay =  random.uniform(0.21,0.22)
                               time.sleep(delay)    
                               pyautogui.mouseDown(1118,1279, button='left') # 点击轻功
                               pyautogui.mouseUp(1118,1279, button='left')  # 点击轻功
                               delay =  random.uniform(0.21,0.22)
                               time.sleep(delay)    
                               delay = random.uniform(0.06,0.08)
                               time.sleep(delay)  
                               pyautogui.moveTo(897,640, duration=0.1) #  移动路中间摆摊
                               delay =  random.uniform(0.21,0.22)
                               time.sleep(delay)    
                               pyautogui.mouseDown(897,640, button='left') #点击路中间摆摊
                               pyautogui.mouseUp(897,640, button='left')
                               delay =  random.uniform(0.02,0.03)
                               time.sleep(delay)    
                               pyautogui.moveTo(1340,803, duration=0.1)  #移动到确认摆摊
                               delay =  random.uniform(0.02,0.03)
                               time.sleep(delay)    
                               pyautogui.mouseDown(1340,803, button='left') 点击确认摆摊
                               pyautogui.mouseUp(1340,803, button='left')
                               delay =  random.uniform(3.1,3.2)
                               time.sleep(delay)    

                        colordanshua2 = pyautogui.pixel(1395,615)  #摆摊
                        if colordanshua2 != (245,191,80)  :
                               delay =  random.uniform(3.1,3.2)
                               time.sleep(delay)    
  
    time.sleep(0.02)  # 
  
# 由于listener是一个daemon线程,它会在主线程结束时自动退出。因此,不需要显式停止它。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1669246.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【适用全主题】WordPress原创插件:弹窗通知插件 支持内容自定义

内容目录 一、详细介绍二、效果展示1.部分代码2.效果图展示 三、学习资料下载 一、详细介绍 适用于所有WordPress主题的弹窗插件 一款WordPress原创插件:弹窗通知插件 支持内容自定义 二、效果展示 1.部分代码 代码如下(示例)&#xff1…

Oracle如何收缩减小表空间大小

比如我们发现一个表空间占用比较大,但是空闲空间很大,想要减小表空间占用大小。查看表空间的情况 发现BETEST表空间占用大,但是剩余大小比较大,可以减小存储占用。 如果我们想减小到100MB,那么就登录其用户执行&#…

Python | Leetcode Python题解之第86题分隔链表

题目&#xff1a; 题解&#xff1a; class Solution:def partition(self, head: Optional[ListNode], x: int) -> Optional[ListNode]:sml_dummy, big_dummy ListNode(0), ListNode(0)sml, big sml_dummy, big_dummywhile head:if head.val < x:sml.next headsml sm…

IDEA及Maven配置代理及Maven中央仓库配置详解

一、配置代理 首先&#xff0c;需要本地开启代理入口&#xff0c;如图。 这个跟你使用代理软件有关。像我使用的是qv2ray。 其次&#xff0c;idea配置代理&#xff0c;如图。 1.1 idea配置代理 打开Settings&#xff0c;如图 1.2 maven配置代理 maven配置代理&#xff0c;修…

【JavaEE】Spring Boot 入门:快速构建你的第一个 Spring Boot 应用

目录 第一个SpringBoot程序介绍项目创建创建项目目录介绍输出Hello World 第一个SpringBoot程序 介绍 在学习SpringBoot之前, 我们先来认识⼀下Spring 我们看下Spring官⽅(https://spring.io/)的介绍 可以看到, Spring让Java程序更加快速, 简单和安全. Spring对于速度、简单…

Android 系统全局Bug日志监听

一、Android DropBox Android用来持续化存储系统数据的一个管理类&#xff0c;主要用于记录Android运行过程中&#xff0c;内核、系统j进程、用户进程等出现严重问题时的Log&#xff0c;可以认为它就是一个可持续存储系统级别的Logcat. 日志储存位置&#xff1a;/data/system…

Golang | Leetcode Golang题解之第86题分隔链表

题目&#xff1a; 题解&#xff1a; func partition(head *ListNode, x int) *ListNode {small : &ListNode{}smallHead : smalllarge : &ListNode{}largeHead : largefor head ! nil {if head.Val < x {small.Next headsmall small.Next} else {large.Next hea…

云计算第十二课

安装虚拟机 第一步新建虚拟机 选择自定义安装 下一步 选择稍后安装操作系统 选择系统类型和版本 选择虚拟机文件路径&#xff08;建议每台虚拟机单独存放并且路径不要有中文&#xff09;点击下一步 选择bios下一步 选择虚拟机处理器内核数量 默认硬盘或者自行调大硬盘 选择虚…

Dato for Mac v5.2.11激活版:掌握时间,掌控生活

在忙碌的生活中&#xff0c;您是否常常觉得时间不够用&#xff1f;Dato for Mac&#xff0c;您的时间管理专家&#xff0c;助您轻松掌控每一天。清晰的日历视图、个性化的提醒功能&#xff0c;让您的日程安排井井有条。无论是工作还是生活&#xff0c;Dato for Mac都能成为您的…

ONES 功能上新 | 近期产品新功能一览

支持在 ONES Project 中通过弹窗查看、编辑 ONES Wiki 页面。 应用场景&#xff1a; 当需要在 ONES Project 中查看 ONES Wiki 的页面内容时&#xff0c;可以直接点击工作项关联的 ONES Wiki 页面或项目文档组件中的页面&#xff0c;即可在 ONES Project 中通过弹窗查看 ONES W…

OCR技术在历史文献数字化中的革命性作用

随着数字化技术的不断发展&#xff0c;历史文献的数字化已成为保存和传播文化遗产的重要途径。其中&#xff0c;光学字符识别&#xff08;OCR&#xff09;技术在历史文献数字化中发挥了革命性的作用&#xff0c;为研究者提供了更广阔的研究空间&#xff0c;推动了历史学研究的发…

【C语言|数据结构】双向链表

文章目录 前言1、初步认识双向链表1.1 定义&#xff1a;1.2 结构1.3 节点的存储 2、双向链表的接口函数2.1 链表的节点的动态申请2.2 链表的初始化2.3 尾插2.4 头插2.5 头删2.5 尾删2.6 在pos节点后面添加数据2.6 删除pos节点 3、双向链表的实现&#xff1a; 前言 各位小伙伴大…

读人工智能时代与人类未来笔记01_重塑人类社会秩序

1. AlphaZero 1.1. 2017年年底&#xff0c;由谷歌旗下DeepMind公司开发的人工智能程序AlphaZero击败了当时世界上最强大的国际象棋程序Stockfish 1.1.1. AlphaZero对Stockfish的百场战绩是28胜72平0负&#xff0c;可以说获得了压倒性的胜利 1.1.2. …

嵌入式学习-中断控制系统

补充一下前面NVIC内嵌向量中断控制器的知识 中断 中断类型 中断控制 配置中断 优先级 分组问题 中断使能 NVIC相关库函数和作用 库函数 函数名 描述 NVIC_DeInit 将外设 NVIC 寄存器重设为初始值 NVIC_SCBDeInit 将外设 SCB 寄存器重设为初始值 NVIC_PriorityGroupCon…

C++ | Leetcode C++题解之第85题最大矩形

题目&#xff1a; 题解&#xff1a; class Solution { public:int maximalRectangle(vector<vector<char>>& matrix) {int m matrix.size();if (m 0) {return 0;}int n matrix[0].size();vector<vector<int>> left(m, vector<int>(n, 0)…

用 Python 从头开始​​编写线性回归

找到最佳拟合线的方法是使用梯度下降&#xff0c;我们将随机绘制一条线&#xff0c;计算该线的误差 计算误差 给定m和b&#xff0c;我们将计算直线的误差。Eeeor用sigma表示法表示 def compute_error_for_line_given_points(b, m, points):totalError 0for i in range(0, len…

职校智慧校园现状及问题分析

各大中职院校及高职院校是校园信息化的先行者和开拓者&#xff0c;很早就开始注重信息化基础设施建设和信息化人文素养的提升。在过去几年里&#xff0c;随着国家大力发展与扶植职校教育&#xff0c;学校投入相当的经费进行了校园信息通信网络、计算机等基础硬件设备建设&#…

AR系列路由器配置VLAN间通信

AR路由器是华为公司推出的企业级路由器产品系列&#xff0c;具有高可靠性、高性能和易管理等特点。AR 系列路由器提供的功能包括路由转发、安全接入、语音、视频、无线等多种业务&#xff0c;支持各种接入方式和协议&#xff0c;并且可以方便地进行扩展和升级。 实验拓扑图&…

打造清洁宜居家园保护自然生态环境,基于YOLOv5全系列【n/s/m/l/x】参数模型开发构建自然生态场景下违规违法垃圾倾倒检测识别系统

自然生态环境&#xff0c;作为我们人类赖以生存的家园&#xff0c;其健康与否直接关系到我们的生活质量。然而&#xff0c;近年来&#xff0c;一些不法分子为了个人私利&#xff0c;在河边、路边等公共区域肆意倾倒垃圾&#xff0c;严重破坏了环境的健康与平衡。这种行为不仅损…

【无标题】能效?性能?一个关于openssl speed速度测试的诡异问题。

问题描述 最近的某个软件用到了openssl&#xff0c;所以就想着测试一下速度。我的电脑是惠普的&#xff0c;CPU是AMD Ryzen 7 PRO 6850HS&#xff0c;系统是Win11。我使用openssl自带的speed测试加密/解密的速度&#xff0c;命令大致如下&#xff1a; openssl speed -evp aes…