Jump to content

Why this code suddenly stopped after ~2 days of running?


Recommended Posts

 

#RequireAdmin
#include <Array.au3>
#include <Excel.au3>
Opt('TrayIconDebug',1)

Global $rq=[['a',6,'b'],['i',7,'ji']]

Global $num = InputBox('At?','1',1,'','','',Default,Default,90)-1
$prx = _Excel_Open(False,False,False)
$pt = _Excel_BookOpen($prx,@ScriptDir&'\q.xlsx')
Global $qResult = _Excel_RangeRead($pt), $time
_Excel_BookClose($pt)
_Excel_Close($prx)
Local $prx = ['MyAutoIt3_Green','MyAutoIt3_Yellow','MyAutoIt3_Blue','MyAutoIt3_Red']
If $num < 4 Then TraySetIcon(StringReplace(@AutoItExe,'AutoIt3.exe','Icons\'&$prx[$num]&'.ico'))
Global $pt = [1,3,4,6,7,9,10,13,17,20,22,25,27,31,34,38,40,42,45,47,51,52,56,57,59,61,64,67,70,73,79,84,87,89,92,95,97,99,104,109,114]
Global $prx = [0,'8.4.66.114:8080','3.1.2.20:8080','8.2.2.2:8080','5.13.20.16:8080','46.25.28.1:8080']

While 1
With ObjCreate("winhttp.winhttprequest.5.1")                                    ; Part 1. Getting
    If $prx[0] = 1 Then .SetProxy($num?2:1,$prx[$num])
    .Open("POST", 'https://api.ftfgj.ir/v1/co')
    .SetRequestHeader("Content-Type", 'application/x-www-form-urlencoded')
    .SetRequestHeader("Connection", 'Keep-Alive')
    .SetRequestHeader("User-Agent", 'okhttp/3.10.0')
    .SetTimeouts(30000,60000,30000,40000)
    Do
        Sleep(2000)
        $time = TimerInit()
        .Send($rq[$num][0])
        If @error Or .Status <> 200 Then ContinueLoop
        Global $act=StringRegExp(.ResponseText,'(?<=tions":")[^"]*',1), $qId=StringRegExp(.ResponseText,'(?<="id":)\d+',3)
        If @error Or UBound($qId) < 2 Then ContinueLoop
        Global $rnk=StringRegExp(.ResponseText,'(?<="vtgte":")[^"]*',1), $scr=StringRegExp(.ResponseText,'(?<="cfxe":")[^"]*',1)
        Global $ans=_ArraySearch($qResult,$qId[1])
    Until @error = 0 And .Status = 200 And $ans >= 0
    $ans = -1 * $qResult[$ans][2]
EndWith

If $scr[0] = 0 And @HOUR = 0 Then Exit                                          ; Part 2. Checking
If @MIN*90+@SEC < 13 Then MouseMove(@HOUR,Random(9,99))
If $act[0] < Random(4,9) Then
    TrayTip($num+1,'Low estion = '&$act[0],10,16)
    Sleep(90000)
    ContinueLoop
ElseIf $rnk[0] <= $rq[$num][1] Then ;And $rq[$num][1] < 10 And $rq[$num][1] > 1 Then
    With ObjCreate("winhttp.winhttprequest.5.1")
        .Open("GET", 'https://api.xryxutj.ir/v1/cops', False)
        .SetRequestHeader("User-Agent", 'okhttp/3.10.0')
        .SetTimeouts(20000,40000,20000,20000)
        Do
            Sleep(200)
            .Send()
        Until @error = 0 And .Status = 200
        Global $abv=StringRegExp(.ResponseText,'\d+(?=","xtdge":"'&$rq[$num][1]-2&')',1), $blw=StringRegExp(.ResponseText,'\d+(?=","rcfhxe":"'&$rq[$num][1]&')',1)
    EndWith
EndIf

With ObjCreate("winhttp.winhttprequest.5.1")                                    ; Part 3. finishing
    If $prx[0] = 1 Then .SetProxy($num?2:1,$prx[$num])
    .Open("POST", 'https://api.gtxhx.ir/v1/bcoer')
    .SetRequestHeader("Content-Type", 'application/json; charset=utf-8')
    .SetRequestHeader("Connection", 'Keep-Alive')
    .SetRequestHeader("Accept-Encoding", 'gzip')
    .SetRequestHeader("User-Agent", 'okhttp/3.10.0')
    .SetTimeouts(30000,60000,30000,30000)
    Edit(_ArraySearch($pt,Mod($qId[1]+$num,99+7*$num),Mod(@WDAY+2,7))<0?$ans:Mod($ans+Mod(@SEC,3),4)+1)
    If Random(1,300,1) = 9 Then Edit(0)
    Sleep(($rnk[0]<16?Random(900,6000)-50*$rnk[0]:Random(500,3000))-0.7*TimerDiff($time))
    Do
        Sleep(300)
        .Send($rq[$num][2])
    Until @error = 0 And .Status = 200
    Sleep($rnk[0]<16?1400-10*$rnk[0]:1200)
    If $rnk[0]<=$rq[$num][1] And 7*$scr[0]>5*$abv[0]+2*$blw[0] Then Sleep($abv[0]-$scr[0]+TimerDiff($time)/2+4000)
    Sleep(($rq[$num][1]-$rnk[0])*Random(9000,30000))
EndWith
WEnd

Func Edit($tmp)
    $rq[$num][2] = StringRegExpReplace($rq[$num][2],'(?<="qiobhikd":")[^"]*',$qId[1],1)
    $rq[$num][2] = StringRegExpReplace($rq[$num][2],'(?<="atcudxuj":")[^"]*',$tmp,1)
    $rq[$num][2] = StringRegExpReplace($rq[$num][2],'(?<="tehe":")[^"]*',$tmp?'utdc':'bujp',1)
EndFunc

 

And NO, it was not exited around 00:00 to 00:59

Edited by HamidZaeri
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...