谁有2d桌球瞄准器1.8

3086人阅读
&&&&&&& 平时不怎么玩游戏,有时消遣就玩玩QQ里的2D桌球,但是玩的次数少,不能像骨灰级玩家一样百发百中,肿么办呢?于是某天突发奇想,决定自己也来做个“外挂”。说是外挂,其实只是一个瞄准器,毕竟外挂是修改别人的软件,有点违法的意思,况且自己还没有能力去那么做,所以自己还是弄个瞄准器,做做弊,过下小瘾,同时也提高一下自己的编程能力。
&&&&&& 2D桌球斯洛克的界面如下:
&&&&& 起初(也就是半年前),自己尝试做一个瞄准器的初始版本,用C#做,想法很简单:
&&&&& Step1.把鼠标移到洞口,获取鼠标位置;
&&&&& Step2.将鼠标放到要击打的球的圆心上,获取鼠标当前位置
&&&&& Step3.根据进球时三点共线的原则按照球的半径自动将鼠标移动到准确的击球点。
&&&&& 示意图如下:
&&&&& 于是当初就按照这个想法做了,开始给自己做了个C#版,调用Windows API中的GetDesktopWindow,GetWindowDC,SetCursorPos三个函数,经过简单的数学运算,就基本实现了功能。代码如下:
using System.D
using System.Windows.F
using System.W
using System.Runtime.InteropS
namespace TaiqiuGua
public partial class Form1 : Form
const int ra=25;
[DllImport(&user32.dll&)]
static extern IntPtr GetDesktopWindow();
[DllImport(&user32.dll&)]
static extern IntPtr GetWindowDC(IntPtr hWnd);
[DllImport(&user32.dll&)]
static extern bool SetCursorPos(int X, int Y);
public Form1()
InitializeComponent();
Point startP;
Point endP;
private void Form1_KeyDown(object sender, KeyEventArgs e)
switch(e.KeyData)
case Keys.F1:
startP=Control.MouseP
case Keys.F2:
endP = Control.MouseP
case Keys.D1:
int x1 = (int)(endP.X + ra * ((endP.X - startP.X) / Math.Sqrt((endP.X - startP.X) * (endP.X - startP.X) + (endP.Y - startP.Y) * (endP.Y - startP.Y))));
int y1 = (int)(endP.Y + ra * ((endP.Y - startP.Y) / Math.Sqrt((endP.X - startP.X) * (endP.X - startP.X) + (endP.Y - startP.Y) * (endP.Y - startP.Y))));
SetCursorPos(x1, y1);
case Keys.D2:
int x2 = (int)(endP.X - ra * ((-endP.X + startP.X) / Math.Sqrt((-endP.X + startP.X) * (-endP.X + startP.X) + (endP.Y - startP.Y) * (endP.Y - startP.Y))));
int y2 = (int)(endP.Y + ra * ((endP.Y - startP.Y) / Math.Sqrt((-endP.X + startP.X) * (-endP.X + startP.X) + (endP.Y - startP.Y) * (endP.Y - startP.Y))));
SetCursorPos(x2, y2);
case Keys.D3:
int x3 = (int)(endP.X + ra * ((endP.X - startP.X) / Math.Sqrt((endP.X - startP.X) * (endP.X - startP.X) + (-endP.Y + startP.Y) * (-endP.Y + startP.Y))));
int y3 = (int)(endP.Y - ra * ((-endP.Y + startP.Y) / Math.Sqrt((endP.X - startP.X) * (endP.X - startP.X) + (-endP.Y + startP.Y) * (-endP.Y + startP.Y))));
SetCursorPos(x3, y3);
case Keys.D4:
int x4 = (int)(endP.X - ra * ((-endP.X + startP.X) / Math.Sqrt((-endP.X + startP.X) * (-endP.X + startP.X) + (-endP.Y + startP.Y) * (-endP.Y + startP.Y))));
int y4 = (int)(endP.Y - ra * ((-endP.Y + startP.Y) / Math.Sqrt((-endP.X + startP.X) * (-endP.X + startP.X) + (-endP.Y + startP.Y) * (-endP.Y + startP.Y))));
SetCursorPos(x4, y4);
GC.Collect();
&&&&& 使用时,只需要激活瞄准器窗口,按F1,F2获取鼠标位置,再根据洞口位置分别选按1、2、3、4数字键就行。
&&&&& 经过N次试验,成功率还挺高,只是有时候手动放置鼠标到被击打球圆心会出现误差,导致击球不准,当然,后来我赢了很多场比赛(嘿嘿,有点不道德!)。
&&&&& 再后来,又用C写了一遍,给同学用了。代码如下:
#include &windows.h&
#include &math.h&
int ra=26;
int flag=0;
POINT startP,endP;
int x5,y5,x2,y2,x3,y3,x4,y4;
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,PSTR szCmdLine, int iCmdShow)
static TCHAR szAppName[] = TEXT (&GUA&) ;
wndclass.style = CS_HREDRAW | CS_VREDRAW ;
wndclass.lpfnWndProc = WndP
wndclass.cbClsExtra = 0 ;
wndclass.cbWndExtra = 0 ;
wndclass.hInstance = hI
wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ;
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;
wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;
wndclass.lpszMenuName = NULL ;
wndclass.lpszClassName = szAppN
if (!RegisterClass (&wndclass))
MessageBox ( NULL, TEXT (&Program requires Windows NT!&),
szAppName, MB_ICONERROR) ;
return 0 ;
hwnd = CreateWindow (szAppName, TEXT (&Programmed By DC&),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, hInstance, NULL) ;
ShowWindow (hwnd, iCmdShow) ;
SetForegroundWindow(hwnd);
MoveWindow(hwnd,100,100,200,200,TRUE);
UpdateWindow (hwnd) ;
while (GetMessage (&msg, NULL, 0, 0))
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
return msg.wP
void Draw(HWND hwnd,LPCSTR lpString)
PAINTSTRUCT
hdc = BeginPaint (hwnd, &ps) ;
GetClientRect (hwnd, &rect) ;
DrawText (hdc, lpString, -1, &rect,
DT_SINGLELINE | DT_CENTER | DT_VCENTER) ;
EndPaint (hwnd, &ps) ;
ReleaseDC(hwnd,hdc);
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam,LPARAM lParam)
PAINTSTRUCT
switch (message)
case WM_CREATE:
return 0 ;
case WM_PAINT :
return 0 ;
case WM_KEYDOWN:
switch (wParam)
case VK_F1:
GetCursorPos(&startP);
InvalidateRect (hwnd, NULL, TRUE) ;
Draw(hwnd,&第1点已锁定!&);
case VK_F2:
GetCursorPos(&endP);
InvalidateRect (hwnd, NULL, TRUE) ;
Draw(hwnd,&第2点已锁定!&);
case 0x31:
x5 = (int)(endP.x + ra * ((endP.x - startP.x) / sqrt((endP.x - startP.x) * (endP.x - startP.x) + (endP.y - startP.y) * (endP.y - startP.y))));
y5 = (int)(endP.y + ra * ((endP.y - startP.y) / sqrt((endP.x - startP.x) * (endP.x - startP.x) + (endP.y - startP.y) * (endP.y - startP.y))));
SetCursorPos(x5, y5);
case 0x32:
x2 = (int)(endP.x - ra * ((-endP.x + startP.x) / sqrt((-endP.x + startP.x) * (-endP.x + startP.x) + (endP.y - startP.y) * (endP.y - startP.y))));
y2 = (int)(endP.y + ra * ((endP.y - startP.y) / sqrt((-endP.x + startP.x) * (-endP.x + startP.x) + (endP.y - startP.y) * (endP.y - startP.y))));
SetCursorPos(x2, y2);
case 0x33:
x3 = (int)(endP.x + ra * ((endP.x - startP.x) / sqrt((endP.x - startP.x) * (endP.x - startP.x) + (-endP.y + startP.y) * (-endP.y + startP.y))));
y3 = (int)(endP.y - ra * ((-endP.y + startP.y) / sqrt((endP.x - startP.x) * (endP.x - startP.x) + (-endP.y + startP.y) * (-endP.y + startP.y))));
SetCursorPos(x3, y3);
case 0x34:
x4 = (int)(endP.x - ra * ((-endP.x + startP.x) / sqrt((-endP.x + startP.x) * (-endP.x + startP.x) + (-endP.y + startP.y) * (-endP.y + startP.y))));
y4 = (int)(endP.y - ra * ((-endP.y + startP.y) / sqrt((-endP.x + startP.x) * (-endP.x + startP.x) + (-endP.y + startP.y) * (-endP.y + startP.y))));
SetCursorPos(x4, y4);
case WM_SIZE :
if(flag==1)
Draw(hwnd,&第1点已锁定!&);
else if(flag==2)
Draw(hwnd,&第2点已锁定!&);
{InvalidateRect (hwnd, NULL, TRUE) ; }
return 0 ;
case WM_KILLFOCUS:
InvalidateRect (hwnd, NULL, TRUE) ;
hdc = BeginPaint (hwnd, &ps) ;
GetClientRect (hwnd, &rc) ;
hBrush = CreateSolidBrush ( RGB(255,0,0) ) ;
FillRect (hdc, &rc, hBrush) ;
EndPaint (hwnd, &ps) ;
ReleaseDC(hwnd,hdc);
DeleteObject (hBrush) ;
case WM_SETFOCUS:
InvalidateRect (hwnd, NULL, TRUE) ;
if(flag==1)
Draw(hwnd,&第1点已锁定!&);
else if(flag==2)
Draw(hwnd,&第2点已锁定!&);
case WM_DESTROY :
PostQuitMessage (0) ;
return 0 ;
return DefWindowProc(hwnd, message, wParam, lParam) ;
&&&&& 但是问题还存在,就是手动找圆心太麻烦,一般用触摸板比鼠标方便,但是仍然很不智能,于是一直想着用图像处理的方法去自动找圆心。
&&&&& 这几天在做数模,经常用到Matlab,刚做了一道要处理图像的题,正好想起这个问题来,于是,搁置的瞄准器继续开始完善了。
&&&&& 很快就有了思路,通过C#截图,然后Matlab进行图像滤波,灰度化,二值化以及边缘提取,然后进行圆曲线拟合,最后找到圆心,返回到C#中使用,代替手动找点。
&&&&& 首先,我用Matlab写了个函数:
function [x,y]=findcenter()
%close all,clear,clc
format short
a=imread('E:\360data\重要数据\桌面\test.bmp');
b=rgb2gray(a);%转化为灰度图像
%imshow(b)
b=filter2(fspecial('average',1),b)/255;
%b=medfilt2(b);%中值滤波
level=graythresh(b);%自动获取灰度图片的阈值
c=im2bw(b,level);%二值化
%imshow(c)
bw=edge(c,'canny');
bw1=~%取反,黑变白,白变黑
%imshow(bw1)
%imshow(bw1)
[yf,xf]=find(bw1==0);
xmin=min(xf);
xmax=max(xf);
ymin=min(yf);
ymax=max(yf);
%cirPx=[(xmax-xmin)/2;(xmax-xmin)/2;xmax]
%cirPy=[(ymax-ymin)/2;(ymax-ymin)/2]
%fitellipse(cirPx,cirPy)
centerX=(xmax+xmin)/2;
centerY=(ymax+ymin)/2;
ra=(ymax-ymin)/2;
x=centerX;y=centerY;
%x=0:size(bw1,2);
%degree=[0:0.01:pi*2];
%degree=[0:0.01:pi*2];
%plot(ra*cos(degree)+centerX,ra*sin(degree)+centerY,'r-');
%plot(centerX,centerY,'r+');
&&&&&&& 然后用Matlab2010b里的deploytool导出.net能使用的程序集dll文件(不知道为什么malab2009b在build时出现.net framework相关的错误),通过C#添加引用,调用其返回的参数,成功完成自动拾取圆心。
改进后代码如下:
using System.D
using System.Windows.F
using System.W
using System.Runtime.InteropS
using MathWorks.MATLAB.NET.A
using MathWorks.MATLAB.NET.U
namespace TaiqiuGua
public partial class Form1 : Form
const int ra=25;
[DllImport(&user32.dll&)]
static extern IntPtr GetDesktopWindow();
[DllImport(&user32.dll&)]
static extern IntPtr GetWindowDC(IntPtr hWnd);
[DllImport(&user32.dll&)]
static extern bool SetCursorPos(int X, int Y);
public Form1()
InitializeComponent();
Point startP,startP1;
Point endP,endP1;
private void Form1_KeyDown(object sender, KeyEventArgs e)
switch(e.KeyData)
case Keys.F1:
startP=Control.MouseP
case Keys.F5:
endP = Control.MouseP
case Keys.F2:
startP1 = Control.MouseP
case Keys.F3:
endP1 = Control.MouseP
case Keys.D1:
int x1 = (int)(endP.X + ra * ((endP.X - startP.X) / Math.Sqrt((endP.X - startP.X) * (endP.X - startP.X) + (endP.Y - startP.Y) * (endP.Y - startP.Y))));
int y1 = (int)(endP.Y + ra * ((endP.Y - startP.Y) / Math.Sqrt((endP.X - startP.X) * (endP.X - startP.X) + (endP.Y - startP.Y) * (endP.Y - startP.Y))));
SetCursorPos(x1, y1);
case Keys.D2:
int x2 = (int)(endP.X - ra * ((-endP.X + startP.X) / Math.Sqrt((-endP.X + startP.X) * (-endP.X + startP.X) + (endP.Y - startP.Y) * (endP.Y - startP.Y))));
int y2 = (int)(endP.Y + ra * ((endP.Y - startP.Y) / Math.Sqrt((-endP.X + startP.X) * (-endP.X + startP.X) + (endP.Y - startP.Y) * (endP.Y - startP.Y))));
SetCursorPos(x2, y2);
case Keys.D3:
int x3 = (int)(endP.X + ra * ((endP.X - startP.X) / Math.Sqrt((endP.X - startP.X) * (endP.X - startP.X) + (-endP.Y + startP.Y) * (-endP.Y + startP.Y))));
int y3 = (int)(endP.Y - ra * ((-endP.Y + startP.Y) / Math.Sqrt((endP.X - startP.X) * (endP.X - startP.X) + (-endP.Y + startP.Y) * (-endP.Y + startP.Y))));
SetCursorPos(x3, y3);
case Keys.D4:
int x4 = (int)(endP.X - ra * ((-endP.X + startP.X) / Math.Sqrt((-endP.X + startP.X) * (-endP.X + startP.X) + (-endP.Y + startP.Y) * (-endP.Y + startP.Y))));
int y4 = (int)(endP.Y - ra * ((-endP.Y + startP.Y) / Math.Sqrt((-endP.X + startP.X) * (-endP.X + startP.X) + (-endP.Y + startP.Y) * (-endP.Y + startP.Y))));
SetCursorPos(x4, y4);
case Keys.F4:
//Graphics g1 = pictureBox1.CreateGraphics();
//g1.CopyFromScreen(startP1.X,startP1.Y,0,0,new Size(endP1.X-startP1.X,endP1.Y-startP1.Y));
int w=endP1.X - startP1.X;
int h=endP1.Y - startP1.Y;
Bitmap bmSave = new Bitmap(w,h);
Graphics g=Graphics.FromImage(bmSave);
g.CopyFromScreen(startP1.X,startP1.Y,0,0,new Size(w,h),CopyPixelOperation.SourceCopy);
bmSave.Save(@&E:\360data\重要数据\桌面\test.bmp&);
g.Dispose();
//g1.Dispose();
bmSave.Dispose();
findcenter.Class1 f = new findcenter.Class1();
MWArray centerx = f.findcenter();
MWArray centery = f.findy();
double[,] x = (double[,])centerx.ToArray();
double[,] y = (double[,])centery.ToArray();
SetCursorPos((int)(x[0, 0] + startP1.X), (int)(y[0, 0] + startP1.Y));
//int [] d=center.D
//int x=int.Parse((center[1, 1]).ToString());
//int y= int.Parse((center[1, 2]).ToString());
//MessageBox.Show((y[0,0]).ToString());
f.Dispose();
GC.Collect();
private void Form1_Activated(object sender, EventArgs e)
//this.BackColor = Color.R
private void Form1_Deactivate(object sender, EventArgs e)
//this.BackColor = Color.B
&&&&& 经试验,成功率也很高,偶尔出现不准(估计是边缘提取和计算精度的问题),但是大多数偏差可以手动修正。
&&&& 到此为止,改进版全部完成。希望以后继续改进,更加智能化。
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:325977次
积分:5464
积分:5464
排名:第1717名
原创:173篇
转载:73篇
译文:18篇
评论:328条
(14)(3)(4)(3)(2)(1)(1)(1)(3)(3)(2)(1)(2)(2)(3)(1)(1)(1)(2)(13)(2)(7)(5)(11)(16)(8)(7)(13)(17)(6)(39)(12)(23)(25)(1)(1)(1)(1)(3)(2)(1)求一款QQ游戏2D桌球瞄准器_百度知道
求一款QQ游戏2D桌球瞄准器
com 谢谢了 先发10分 能用再追加~~~!!带线路的 就是落点都标出来 有墨镜破解版也行 要现在能用 能够免费的~~发邮箱@qq
提问者采纳
&&&nbsp?◇只需要两块钱&W&A&&迅雷狗狗搜索&&&四个键可以调整鼠标上下左右位置.S&QQ桌球弧线&nbsp?◇上下滚动鼠标滚轮,永久可用;&nbsp.实诚人网店&送QQ桌球刷分器&QQ2D桌球瞄准器终极版1;&nbsp://b;不比魔镜差淘宝搜索&nbsp.8&&nbsp.&游戏骂人精灵&系卖家辛苦整理&nbsp?◇可以;右键瞄准的2D桌球显线路瞄准器&整个压缩包22;桌球瞄准显走线&/zhidao/pic/item/e92419dad33a4c086e061d95f7&)◆如何调节力度;点击下图看看效果(小店有瞄准器的详细介绍;2元里面包含了打弧球的简单教程&nbsp?◇用键盘&(只卖两元;&nbsp.baidu,淘宝交易&&nbsp.jpg" esrc="http。◆如何微调击球点?◇本程序里面有补丁&nbsp、刷分的方法视频&&nbsp,包学会)<img class="ikqb_img" src="&nbsp,可以调整击球初始力度://b;不管游戏怎么更新都可以用◆买这个有什么优惠.hiphotos.7M&nbsp://b.com/zhidao/wh%3D450%2C600/sign=cc6e92419dad33a4c086e061d95f7bb免费版&nbsp
其他类似问题
qq游戏的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁谁有QQ桌球瞄准器破解版?_百度知道
谁有QQ桌球瞄准器破解版?
有的朋友留言
提问者采纳
com/search?search=QQ%E6%A1%8C%E7%90%83%E7%9E%84%E5%87%86%E5%99%A8%E7%A0%B4%E8%A7%A3%E7%89%88&id=1这个是楼上的破解器.com/search。下来最好杀下毒!://www.gougou.gougou。是讯雷的?search=QQ%E6%A1%8C%E7%90%83%E7%9E%84%E5%87%86%E5%99%A8%E7%A0%B4%E8%A7%A3%E7%89%88&id=1" target="_blank">http://wwwhttp<a href="http
您可能关注的推广回答者:
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁您的位置:&-&-> -& 智能QQ桌球瞄准器 8.29
同类周下载排行
软件授权:免费版 
软件大小:47KB
人气指数:
软件语言:简体中文
软件评级:
运行环境:Winxp/vista/win7/win8/
更新时间: 7:33:45
出 品 人:&&
软件合集:
  智能QQ桌球瞄准器
  1.桌球的游戏背景需设置成绿色,游戏窗口要设置成最大化,且不要在设置里面钩选阴影、2D球体、深度等参数!
  2.将鼠标移动至目标球附近机器人会自动锁定之并计算相应方位的瞄准点
  3.快捷键
  ALT+D / ALT+F 自动将鼠标移至瞄准点
  ALT+S / ALT+H 显示或隐藏瞄准器
  4.瞄准器适用于QQ2D桌球中的斯诺克、8球、9球
  5.瞄准是根据鼠标和目标球方位智能计算的,如果瞄准方位不是自己想要的可以移动鼠标重新按快捷键瞄准。进球后几连环的字幕会影响机器人对字幕中的球的计算,所以等字幕消失后才可以精确计算被字幕影响的球
  6.瞄准器采用浮点计算,精确度超过95%,大角度和长距离同时出现的情况下击球会放大误差,有时无法进洞可能是因为使用者用力过猛或者击球时不小心鼠标移位。瞄准器只是战术武器,若要赢球个人战略同样重要
  7.如果在Vista/Win7系统中玩时不要使用Aero主题,请使用基本经典主题,否则瞄准可能存在误差
  8.更多智能这里没有必要全部说明,请自行尝试体验。
  9.如果有任何功能上的问题请与我们联系,我们将在第一时间升级。
热门软件推荐
热门安卓应用推荐
牛华网推荐

我要回帖

更多关于 2d桌球瞄准器1.8 的文章

 

随机推荐