按鍵精靈腳本

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"


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