欢乐跳瓶python辅助程序(在夜神模拟器上实际运行)

本人写的一个关于欢乐跳瓶的作弊程序,在夜神模拟器上运行的,主要拿canny写的。

如果是跳一跳其实就更容易了,因为欢乐跳瓶的界面较跳一跳来说噪声相对要多不少。

完整可运行代码下载请移步 https://download.csdn.net/download/kuroyukineko/10494650

下面贴一下大致PPT的内容和代码。



下面是纯代码,如果需要上机运行的话还需要几个匹配的模版,在下载里都打了包,这里就不贴了。

# bottle_flip_cheat
# by Kuroyukineko 2018.03.09
# Noxplayer(1280*720)_BottleFlip

import sys
import time
import math
import win32gui
import win32ui
import win32api
import win32con
import numpy as np
import cv2
import matplotlib.pyplot as plt

def beginDetect(hwnd, window_hw_para):
	
	filename = "begindetect.jpg"
	
	pic_capture(hwnd, filename)
	#read image
	img_origin = cv2.imread(filename)
	img_cut_gray = cv2.cvtColor(img_origin, cv2.COLOR_BGR2GRAY)
	#template
	template = cv2.imread("beginTemplate.jpg", 0)
	template1 = cv2.imread("beginTemplate.jpg", 0)
	#w, h = template.shape[::-1]
	res = cv2.matchTemplate(img_cut_gray,template,cv2.TM_CCOEFF_NORMED) 
	res1 = cv2.matchTemplate(img_cut_gray,template1,cv2.TM_CCOEFF_NORMED)
	threshold = 0.6 
	loc = np.where( res >= threshold)	
	loc1 = np.where( res1 >= threshold)	
	
	if len(loc[0]) != 0 or len(loc1[0]) != 0:
		mouse_move(window_hw_para['left'] + 280, 
		window_hw_para['top'] + 500)
		mouse_click(0.5) #jump
		time.sleep(1)
	cv2.destroyAllWindows() 
	
def ready_game():
	#player locate the game window
	print ("Please move the cursor on game window 
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值