按键精灵脚本

1电脑版读取文件脚本

Dim path 

path = "C:/Users/Administrator/Desktop/accounts"





//直接读取文件到变量,文件的每一行在变量中以|分隔

Text = Plugin.File.ReadFileEx(path)

MessageBox "Text" & text 
TracePrint Text   //只是调试状态才显示

 
 
 
 
 
 //打开文件,循环读取每一行
 
Dim fileHandle

fileHandle = Plugin.File.OpenFile(path)
  
 i=0  
 Dim arrays(9) ,fileline   //定义数组
 
    Do While true

   fileline = Plugin.File.ReadLine(fileHandle)

    TracePrint  fileline

   
  // MessageBox "fileline " & fileline
   
   
   If ( fileline="" )then 
  
  
    Call Plugin.File.CloseFile(fileHandle)  //一定要关闭,不关闭无法读取文件
  
   Exit Do
  
  
   Else 
   arrays(i)=fileline
   i=i+1 
   
   End If
Loop





TracePrint UBound(arrays)


Delay  8000

//遍历数组


For j=0 To UBound(arrays) step 1



TracePrint  arrays(j)


Next






2.安卓版模拟手机操作脚本

Import "ShanHai.lua"


//浮窗锁定并且在右侧0.5的位置
SetControlBarPos 0.5,1


//清理app数据

//Tap 1088, 620


//Delay 2000
//Tap 221, 666

//Delay 2000



//Dim intX1,intY1
//FindPic 0,0,0,0,"Attachment:今日头条.png","000000",0,0.9,intX1,intY1
//If intX1 > -1 And intY1 > -1 Then
//    TracePrint intX1
//    TracePrint intY1
    
//    Touch intX1+10, 254,2000
    //Else 

//    TracePrint  "未找到"
//End If

//Delay 3000

//Tap 970, 484

//Dim intConfirmX,intConfirmY
//FindPic 0,0,0,0,"Attachment:确认.png","000000",0,0.9,intConfirmX,intConfirmY
//If intConfirmX > -1 And intConfirmY > -1 Then
//    TracePrint intConfirmX
//    TracePrint intConfirmY
    
//    Touch 839, 453, 2000
    
    //Else 

    //TracePrint  "未找到"
    //Touch 839, 453, 2000
//End If




//Delay 2000 



//KeyPress "Back"

//Delay 1000

//KeyPress "Back"

//Delay 1000

//KeyPress "Back"

//Delay 1000
//ShanHai.AppClean("com.ss.android.article.news")
 

Delay 2000
 

RunApp "com.ss.android.article.news"


 




Delay 12000



//TracePrint sys.GetFront()




Dim plusX_,plusY_
FindPic 0,0,0,0,"Attachment:加号.png","000000",0,0.9,plusX_,plusY_
If plusX_ > -1 And plusY_ > -1 Then
    TracePrint plusX_
    TracePrint plusY_
    
    
    Tap plusX_, plusY_
Else 
    Tap 49,20
    TracePrint  "未找到+号"
End If


Delay 2000



//删除标题


//Touch 116, 44, 1000


//Delay 1000


//For k = 1 To 60 Step 1
    
//tap 162, 436
//Delay 1000


//变量rColor需要预先定义。如果您还没有定义该变量,请取消下面一行的注释
//Dim rColor
//rColor = GetPixelColor(147, 200)


//TracePrint "这个点的颜色为:"&rColor


//If rColor <> "CCCCCC" Then 



//Exit For

//End If


    
//Next


//Delay  1000


//完成
//Touch 116, 44, 1000


//Delay 1000
//点击X号
//Touch 51, 21, 1000


//Delay 1000



Dim width=GetScreenX()


dim height = GetScreenY()


TracePrint   width

TracePrint  height







For j = 1 To 60 Step 1
//点击加号

Dim plusX,plusY
FindPic 0,0,0,0,"Attachment:加号.png","000000",0,0.9,plusX,plusY
If plusX > -1 And plusY > -1 Then
    TracePrint plusX
    TracePrint plusY
    
    
    Tap plusX, plusY
Else 
    Tap 49,20
    TracePrint  "未找到+号"
End If







Delay 1000




///循环添加频道



For i = 1 To 1 Step 1








    
    call  addRecommend() 
     TracePrint   "第",j,"个频道"
    
Next





Delay 1000
//保存


Dim intX,intY
FindPic 0,0,0,0,"Attachment:保存.png","000000",0,0.9,intX,intY
If intX > -1 And intY > -1 Then
    TracePrint intX
    TracePrint intY
    Tap intX,intY
    Delay 1000
    
Else 
   TracePrint    "未找到"    
    
End If


Next


Sub addRecommend()


Dim intX,intY
FindPic 0,0,0,0,"Attachment:频道推荐.png","000000",0,0.9,intX,intY
If intX > -1 And intY > -1 Then
    TracePrint intX
    TracePrint intY
    
    Tap intX+62, intY
    
    Delay 1000
Else 
   TracePrint    "未找到"
    
End If


End Sub














Tap 98, 605


Delay 2000



For i = 1 To 5 Step 1
    
    call slide() 
     TracePrint i
    
Next





KillApp "com.ss.android.article.news"






/////滑动屏幕下拉
Sub slide()
Dim i=1
TouchDown 1100,300,i
TouchMove 200,300,i,1500
TouchUp i

End sub

//KeyPress "PageDown"


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章