找回密码
 加入
搜索
查看: 8565|回复: 15

[AU3基础] 帮我把这个按键精灵的脚本改成autoit的脚本。

  [复制链接]
发表于 2012-2-14 23:12:40 | 显示全部楼层 |阅读模式
i=48
Delay 300
KeyDown 18,1
Delay 300
KeyPress 68,1
Delay 300
KeyUp 18,1
Delay 300
SayString "http://www.xxx.com/xxx/xxx.php"
Delay 300
KeyPress 13,1
Delay 3000
While i<=90
    MoveTo 185,487
    IfColor 185,487,ccffff,0
        Delay 1000
        LeftClick 1
    Else
        Delay 15000
        IfColor 185,487,ccffff,0
            LeftClick 1
        Else
            VBSCall RunApp("C:\WINDOWS\Media\ringin.wav")
            MessageBox i
            KeyPress 123,1
        EndIf
    EndIf
    KeyPress i 1
    Delay 1000
    KeyPress 13,1
    Delay 5000
    MoveTo 569,473
    Delay 1000
    IfColor 569,473,e3e3e5,0
        LeftClick 1
        Delay 5000
    Else
        Delay 15000
        IfColor 569,473,e3e3e5,0
            LeftClick 1
            Delay 5000
        Else
            VBSCall RunApp("C:\WINDOWS\Media\ringin.wav")
            MessageBox i
            KeyPress 123,1
        EndIf
    EndIf
    i=i+1
    While i>=58 and i<=64
        i=65
    EndWhile
EndWhile
VBSCall RunApp("C:\WINDOWS\Media\ringin.wav")
MessageBox over
发表于 2012-2-15 01:10:07 | 显示全部楼层
楼主这语气似乎不大好吧,凭什么呀

评分

参与人数 6金钱 +70 收起 理由
wei999 + 10
papapa314 + 20
user3000 + 10
nmgwddj + 10
komaau3 + 10

查看全部评分

 楼主| 发表于 2012-2-15 07:29:09 | 显示全部楼层
那我自已改一改试试吧,有什么不行的地方再上来问。
第一个问题就是
msg()怎么把ascii的数字改成对应的字母或数字呢?
比如ascii值为58
则msg() 弹出来对话框如何把相应字母显示对来呢?
 楼主| 发表于 2012-2-15 09:58:44 | 显示全部楼层
While i>=58 and i<=64
这个在autoit怎么写呢?
 楼主| 发表于 2012-2-15 10:36:41 | 显示全部楼层
基本上是改完了,就差这个$i了,定义的是ASCII值,可是send的时候出错了,应该是位数是三位,前面应该有个0,而我的是二位的,我又不会改。郁闷了。
        $i = 48
                $searchx = 185
            $searchprex = 21
                $searchy = 487
                $confirmx = 569
                $confirmy = 473
                Sleep(5000)
        Send("!d")
        Sleep(10)
        Send("http://www.xxx.com/xxx/xxx.php")
        Sleep(10)
        Send("{ENTER}")
        Sleep(3000)
                While $i < 91
                    MouseMove($searchx, $searchy)
                        If PixelGetColor($searchx, $searchy) = '0xFFFFCC' Then
                           Sleep(1000)
                           MouseClick("left")
                        Else
                           Sleep(15000)
                           If PixelGetColor($searchx, $searchy) = '0xFFFFCC' Then
                              Sleep(15000)
                                  MouseClick("left")
                           Else
                                  SoundPlay("C:\WINDOWS\Media\ringin.wav")
                           MsgBox($i)
                           ;KeyPress 123,1
                           EndIf
                        EndIf
                        Send("{ASC $i}")
                        Sleep(1000)
                        Send("{ENTER}")
                        Sleep(5000)
                        MouseMove($confirmx, $confirmy)
                        Sleep(1000)
                        If PixelGetColor($confirmx, $confirmy) = '0xE5E3E3' Then
                           MouseClick("left")
                           Sleep(5000)
                        Else
                           Sleep(15000)
                           If PixelGetColor($confirmx, $confirmy) = '0xE5E3E3' Then
                              MouseClick("left")
                              Sleep(5000)
                           Else
                                  SoundPlay("C:\WINDOWS\Media\ringin.wav")
                                  MsgBox($i)
                                  ;KeyPress 123,1
                           EndIf
                        EndIf
                 $i += 1
                    While $i>=58 and $i<=64
                           $i = 65
                        WEnd
                 WEnd
                 SoundPlay("C:\WINDOWS\Media\ringin.wav")
                 MsgBox("OVER")
                 
发表于 2012-2-15 10:43:12 | 显示全部楼层
MsgBox($i) 不是这么用的
msgbox(0,"标题","内容","超时时间")
msgbox(0,$i,$i,10)
 楼主| 发表于 2012-2-15 10:45:46 | 显示全部楼层
MsgBox($i) 不是这么用的
msgbox(0,"标题","内容","超时时间")
msgbox(0,$i,$i,10)
骗子 发表于 2012-2-15 10:43


我刚测试没通过,这个地方改完了,就差那个ASCII 就是最开始定义的$i位数问题了。
 楼主| 发表于 2012-2-15 10:47:19 | 显示全部楼层
msgbox(0,"标题","内容","超时时间")
但是这个只能msgbox出来ASCII的数值,而对应的字母是什么还没搞定。
 楼主| 发表于 2012-2-15 10:50:23 | 显示全部楼层
在line1 和 line30有点问题。郁闷,实在不会改了。
发表于 2012-2-15 10:52:42 | 显示全部楼层
回复 7# sex123
不懂,为什么要发送ASCII码
直接发送按键不就得了
Send("{S 30}") ;发送30个字符"S"
 楼主| 发表于 2012-2-15 11:04:36 | 显示全部楼层
回复  sex123
不懂,为什么要发送ASCII码
直接发送按键不就得了
Send("{S 30}") ;发送30个字符"S"
骗子 发表于 2012-2-15 10:52


你仔细看代码就明白了,我穷举法,第一次send a
第二次 send b
第三次 send c
直至 send z
所以用到ASCII一个数值一个数值地$i += 1
 楼主| 发表于 2012-2-15 11:12:41 | 显示全部楼层
我改成数组,还是不对,我郁闷了。
        Local $a[3]=[0,0,0],$b
            $i = 48
                $b=StringFormat('%03d\n',$a[0]&$a[1]&$a[2]+$i)
                $i = 48
                $searchx = 185
            $searchprex = 21
                $searchy = 487
                $confirmx = 569
                $confirmy = 473
                Sleep(5000)
        Send("!d")
        Sleep(10)
        Send("http://www.xxx.net/bbs/search.php")
        Sleep(10)
        Send("{ENTER}")
        Sleep(3000)
                While $i < 91
                    MouseMove($searchx, $searchy)
                        If PixelGetColor($searchx, $searchy) = '0xFFFFCC' Then
                           Sleep(1000)
                           MouseClick("left")
                        Else
                           Sleep(15000)
                           If PixelGetColor($searchx, $searchy) = '0xFFFFCC' Then
                              Sleep(15000)
                                  MouseClick("left")
                           Else
                                  SoundPlay("C:\WINDOWS\Media\ringin.wav")
                           MsgBox(0,0,$i)
                           ExitLoop
                           EndIf
                        EndIf
                        $b=StringFormat('%03d\n',$a[0]&$a[1]&$a[2]+$i)
                        Send("{ASC $b}")
                        Sleep(1000)
                        Send("{ENTER}")
                        Sleep(5000)
                        MouseMove($confirmx, $confirmy)
                        Sleep(1000)
                        If PixelGetColor($confirmx, $confirmy) = '0xE5E3E3' Then
                           MouseClick("left")
                           Sleep(5000)
                        Else
                           Sleep(15000)
                           If PixelGetColor($confirmx, $confirmy) = '0xE5E3E3' Then
                              MouseClick("left")
                              Sleep(5000)
                           Else
                                  SoundPlay("C:\WINDOWS\Media\ringin.wav")
                           MsgBox(0,"",$i)
                           ExitLoop
                           EndIf
                        EndIf
                 $i += 1
                    While $i>=58 and $i<=64
                           $i = 65
                        WEnd
                 WEnd
                 If $i = 65 Then
                    SoundPlay("C:\WINDOWS\Media\ringin.wav")
                    MsgBox(0,"","OVER")
                 EndIf
                           
                           
发表于 2012-2-15 11:25:06 | 显示全部楼层

Send("#r")
WinWaitActive("运行")
Send("notepad.exe{Enter}")
WinWaitActive("[CLASS:Notepad]")
For $i = 65 To 90
    $text = Chr($i)
        Send ($text)
        Send (@CR) ;换行
Next
 楼主| 发表于 2012-2-15 11:30:27 | 显示全部楼层
$text = Chr($i)
        Send ($text)
原来这样子的呀,我回去试试。
 楼主| 发表于 2012-2-15 12:50:43 | 显示全部楼层
谢谢,问题解决了。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-30 21:35 , Processed in 0.091741 second(s), 27 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表