读取界面信息以及文本分割按键精灵

// 查找到好友发信息
Import “shanhai.lua”
Dim Path,Ret_Txt,ii
ii = 0
path = “/sdcard/MobileAnjian/anjian.txt”

Dim 话术="/sdcard/MobileAnjian/ceshi.txt"//话术页面
TracePrint File.Read(话术)
Dim fx_hh1=“2-”
Dim fx_hh2=“3-”
Do
Call File.Write(path, shanhai.GetUIXml())
If Dir.Exist(path) = 1 Then
Ret_Txt = File.Read(path)'读取文本文件内容返回到Ret_Txt变量中了
TracePrint “已读取”
TracePrint File.Read(path) '严密一些
End If
For i = 1 To 8’分析的是一页中的好友
Dim Fx_str1=“com.ss.android.tuchong:id/follow_name”
Dim Fx_srr2=“text”
Dim Fx_srr3=“bounds”
Dim Ret_Int1
TracePrint Ret_Int1
Dim Str_len=len(Fx_str1)'获取字符串长度
Dim Ret_Ret=Ret_Int1+Str_len
Dim HaoYou1=Wbfx(Ret_Ret,Fx_str1, Fx_srr2)
TracePrint “好友:”& HaoYou1
//Fx_str1=“android:id/text1”
Fx_srr2 = “bounds”
Dim ZhuoBiao=Wbfx(Ret_Ret,Fx_str1, Fx_srr3)
TracePrint “好友坐标:”&ZhuoBiao
TracePrint InStr (2,ZhuoBiao,"]")
Dim zb_int=InStr (2,ZhuoBiao,"]")-2
dim Zb_Ret = Mid(ZhuoBiao, 2, zb_int)
Dim xy=split(Zb_Ret,",")
Dim X=XY(0),y=xy(1)
TracePrint x,y
If HaoYou1 = HaoYou1 Then
TracePrint “在这里”
Tap x, y
Delay 60000
End If
Next
Delay 2000
KeyPress 93’下一页
Ret_Txt = “”
Loop

Function Wbfx(Ret_Ret,Fx_srr1, Fx_srr2)
Dim YH=""""
// TracePrint YH
Ret_Int1=InStr (Ret_Ret,Ret_Txt, Fx_str1)
// TracePrint Ret_Int1
dim Ret_Int2=InStrRev (Ret_Txt,Fx_srr2,Ret_Int1)
// TracePrint Ret_Int2
dim Ret_Int3=InStr (Ret_Int2,Ret_Txt, YH)+1’查引号
// TracePrint Ret_Int3
dim Ret_Int4=InStr (Ret_Int3,Ret_Txt, YH)'查引号
// TracePrint Ret_Int4
Dim Chai=Ret_Int4-Ret_Int3’差
Dim Ret_str=mid(Ret_Txt,Ret_Int3,Chai)
// TracePrint Ret_str
Wbfx = Ret_str
End Function

Call 发送信息()
Sub 发送信息()
Delay 2000
Tap 359, 67
Delay 2000
Tap 467,922
Delay 2000
Tap 113,922
InputText 第一条(fx_hh1, fx_hh2)
Delay 2000
Tap 467,922
Delay 2000
InputText 第二条(fx_hh1, fx_hh2)
Delay 2000
Tap 467,922
Do
Dim intX,intY
FindPic 0,0,0,0,“Attachment:fensi.png”,“000000”,0,0.9,intX,intY
If intX > -1 And intY > -1 Then
Exit Do
End If
KeyPress “Back”

Loop

End Sub

Function 第一条(fx_hh1,fx_hh2)//文字分割思路
dim hua_0=Len( File.Read(话术))
Dim hua_00=File.Read(话术)
Dim hua_1=InStr(1,hua_00,fx_hh1)
Dim hua_2=InStr(hua_1,hua_00,fx_hh2)
Dim zuobiao_1=mid(hua_00,3,hua_1-3)
第一条 = zuobiao_1

End Function
Function 第二条(fx_hh1,fx_hh2)
dim hua_0=Len( File.Read(话术))
Dim hua_00=File.Read(话术)
Dim hua_1=InStr(1,hua_00,fx_hh1)
Dim hua_2=InStr(hua_1,hua_00,fx_hh2)
Dim zuobiao_2=mid(hua_00,hua_1+2,hua_2-hua_1-2)
第二条=zuobiao_2
End Function
Function 第三条(fx_hh1,fx_hh2)
dim hua_0=Len( File.Read(话术))
Dim hua_00=File.Read(话术)
Dim hua_1=InStr(1,hua_00,fx_hh1)
Dim hua_2=InStr(hua_1,hua_00,fx_hh2)
Dim zuobiao_3=mid(hua_00,hua_2+2,hua_0-hua_2)
第三条=zuobiao_3
End Function

Function sj(cs1,cs2)'随机数
Dim MyValue
Randomize
MyValue = Int(((cs2-cs1+1) * Rnd()) + cs1)
sj= MyValue
End Function

你可能感兴趣的:(读取界面信息以及文本分割按键精灵)