标题: [数值计算] [已解决]批处理如何快速处理坐标 [打印本页]
作者: mstsc 时间: 2012-8-22 17:21 标题: [已解决]批处理如何快速处理坐标
本帖最后由 mstsc 于 2012-8-24 14:01 编辑
- MoveTo 457, 635
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
复制代码
从右下角坐标457.635到左上角340.575,图样是5横6纵。
要从457.635到340.575(一共30个空)要一个一个的用鼠标点,最好每次都点在中心处。
我自己算的横坐标依次减24,纵坐标依次减15,基本上能达到每个空都点到。
请帮忙计算出每个空的横纵坐标值。
作者: mstsc 时间: 2012-8-22 22:38
怎么没人回答呢?
是我说的不够详细吗?
作者: bhsx 时间: 2012-8-23 05:04
- echo off&for /l %%x in (457,-24,340) do for /l %%y in (635,-15,575) do echo %%x,%%y
复制代码
作者: CrLf 时间: 2012-8-23 11:06
怎么看着像按键精灵的vbs脚本?
作者: mstsc 时间: 2012-8-23 16:52
恩 就是按键精灵的
作者: mstsc 时间: 2012-8-23 17:03
回复 3# bhsx
请问我怎么样使- MoveTo 457, 635
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
复制代码
最后输出的成这样呢?- MoveTo 457, 635
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 433, 635
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 409, 635
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 385, 635
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 361, 635
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 340, 635
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 457, 620
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 433, 620
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 409, 620
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 385, 620
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 361, 620
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 340, 620
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 457, 605
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 433, 605
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 409, 605
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 385, 605
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 361, 605
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 340, 605
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 457, 590
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 433, 590
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 409, 590
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 385, 590
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 361, 590
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 340, 590
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 457, 575
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 433, 575
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 409, 575
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 385, 575
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 361, 575
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
- MoveTo 340, 575
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- MoveTo 216, 696
- Delay 777
- LeftClick 1
复制代码
作者: CrLf 时间: 2012-8-23 17:58
前面的对象怎么定义我就不管啦- x1 = 457
- y1 = 635
- x2 = 340
- y2 = 575
-
- For i=x1 To x2 Step Int((x2-x1)/5)
- For j=y1 To y2 Step Int((y2-y1)/6)
- Delay 6800
- RightDown 1
- Delay 186
- RightClick 1
- Next
- Next
复制代码
作者: mstsc 时间: 2012-8-24 09:52
回复 7# CrLf
请问怎么把答案导出呢?
到2.txt
作者: mstsc 时间: 2012-8-24 09:54
回复 3# bhsx
请问还能详细点的帮我解决一下问题不?
作者: apang 时间: 2012-8-24 12:19
顶楼代码为1.txt,最后输出2.txt- @echo off
- (for /l %%a in (635 -15 575) do (
- for /l %%b in (457 -24 337) do (
- set flag=
- for /f "delims=" %%c in (1.txt) do (
- if not defined flag (
- set flag=1
- if %%b equ 337 (echo MoveTo 340, %%a
- ) else echo MoveTo %%b, %%a
- ) else echo %%c
- ))))>2.txt
复制代码
作者: mstsc 时间: 2012-8-24 13:53
在这里特别感谢3楼和7楼的帮助。谢谢
作者: mstsc 时间: 2012-8-25 18:59
回复 10# apang
你好,
@echo off
(for /l %%a in (635 -15 575) do (
for /l %%b in (457 -24 337) do (
set flag=
for /f "delims=" %%c in (1.txt) do (
if not defined flag (
set flag=1
if %%b equ 337 (echo MoveTo 340, %%a
) else echo MoveTo %%b, %%a
) else echo %%c
))))>2.txt
这个有点问题:
for /l %%a in (635 -15 575) do ( =》这里的数值给的不对的话,就的不到想要的结果
for /l %%b in (457 -24 337) do ( =》有什么可以改进的吗? 比如:(212 -21 120) 这个就只能的到4行,可我想的到5行。
还有能帮忙把这段代码每行都给个注释可以不?
作者: mstsc 时间: 2012-8-25 19:00
回复 7# CrLf
怎么就石沉大海了呢?
作者: apang 时间: 2012-8-25 21:43
回复 12# mstsc
不懂什么意思,for /l %%a in (212 -21 120) do echo %%a 可显示212、191、170、149、128共5个数(5行),而不是4行
若要显示6行,将终止数120改小一点,大致是:终止数=起始数+步长*(行数-1)
作者: mstsc 时间: 2012-8-25 22:03
回复 14# apang
我写错了 是 212 -21 130 只能的到4行
请问 你能把你那段代码标上注释吗?
作者: mstsc 时间: 2012-8-28 18:43
回复 14# apang
能帮忙说一下吗
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |