按键精灵PC端脚本
定义变量的时候不需要定义类型 ,由于是易语言,变量名可以是中文
文本路径 = 'C:\Users\Administrator\Desktop\1.txt'//改成自己的文本路径
Text = Plugin.File.ReadFileEx(文本路径)
MyArray = Split(Text, '|')//以行为单位分拆,已数组形式存放
//RunApp '电脑的文件路径' 如下面的打开浏览器
call RunApp ('C:\Users\Administrator\Desktop\2345加速浏览器.lnk')
Delay 200
Hwnd = Plugin.Window.Foreground() //获得当前窗口的句柄
//Hwnd = Plugin.Window.MousePoint()//获得鼠标指向窗口句柄
delay 200
Call Plugin.Window.Max(Hwnd) //最大化窗口
Delay 200
Dim a //创建一个新变量
a = 0
//UBOUND 函数返回一个数组的最大下标
If UBound(MyArray)>=0 Then //then前面if的条件
For i=0 to UBound(MyArray)-1
//下面这句是得到文本内容
TracePrint '第 ' & i + 1 & ' 行文本内容为:' & Cstr(MyArray(i))
MoveTo 550,74//点击网页某个地方.自己获取坐标
Delay 10
LeftClick 1
Delay 1000
MoveTo 805,642 //弹出对话窗,输入框的坐标.自己获取
Delay 10
LeftClick 1
Delay 500
KeyDown 17, 1
KeyPress 65, 1
KeyUp 17, 1
SayString MyArray(i)//输入
Delay 500
KeyPress 9,2
Delay 10
KeyPress 13,1
Delay 1000
If i - a >= 20 Then
MoveTo 29,1056 //点击网页某个地方.自己获取坐标
Delay 10
LeftClick 1
Delay 1000
MoveTo 111,551//弹出对话窗,输入框的坐标.自己获取
Delay 10
LeftClick 1
Delay 1500
a = i
End If //结束if语句
//i Mod 80表示:i模80取余数(i%80=i/80的余数)
If i Mod 80 = 0 and i<>0 Then //i<>0 表示:i 不等于 0
Delay 5500000
Call Lib.系统.结束进程('2345Explorer.exe') //关闭所有关于这个的进程
Delay 3000
RunApp 'C:\Users\Administrator\Desktop\2345加速浏览器.lnk'
End If
Next
End If
---------------------------------
Text1 = Plugin.File.ReadFileEx('C:\Users\Administrator\Desktop\1.txt')
Text2 = Plugin.File.ReadFileEx('C:\Users\Administrator\Desktop\2.txt')
MyArray1 = Split(Text1, '|')//以行为单位分拆
MyArray2 = Split(Text2, '|')//以行为单位分拆
//RunApp '电脑的文件路径'
call RunApp ('C:\Users\Administrator\AppData\Local\Google\Chrome\Application\chrome.exe')
Delay 200
Hwnd = Plugin.Window.Foreground() //获得当前窗口的句柄
//Hwnd = Plugin.Window.MousePoint()//获得鼠标指向窗口句柄
delay 200
Call Plugin.Window.Max(Hwnd) //最大化窗口
Delay 200
For i = 0 To 19
KeyDown 17, 1
KeyPress 84, 1
KeyUp 17, 1
Delay 500
SayString MyArray1(i) & '/dadadadada'
KeyPress 'Enter', 1
Delay 4000
KeyPress 'Tab', 2
Delay 10
SayString'admin'//输入账号
Delay 500
KeyPress 'Tab', 1
Delay 500
SayString'ckxytea!@'//输入密码
//遇到waitkey暂停指令 需要任意按一下键盘 才继续执行
key = 0
Do Until key = 13 //循环必须找到 key=回车键 才继续执行
key = WaitKey()
Loop
KeyPress 'Enter', 1
Delay 8000
MoveTo 16,222//模块位置 自己获取
Delay 500
LeftClick 1
Delay 2000
KeyPress 9, 7
Delay 500
KeyDown 13, 1
Delay 3000
For i1 = 0 To 19
If i1 = i Then
i1=i+1
End If
MoveTo 1500,160
Delay 500
LeftClick 1
Delay 500
KeyPress 9, 1
Delay 500
KeyDown 13, 1
Delay 3000
KeyPress 9, 2
Delay 500
SayString 'http://'& MyArray1(i1)
Delay 500
KeyPress 9, 1
Delay 500
SayString MyArray2(i1)
Delay 500
KeyPress 9, 7
Delay 500
KeyPress 39, 1
Delay 500
KeyPress 13, 1
Delay 3000
Next
Next