Advertisement
Guest User

Untitled

a guest
May 11th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 5.42 KB | None | 0 0
  1. #include <ButtonConstants.au3>
  2. #include <GUIConstantsEx.au3>
  3. #include <WindowsConstants.au3>
  4. #Region ### START Koda GUI section ### Form=
  5. $Form1 = GUICreate("Market Tool v.04", 360, 400, 192, 124)
  6. $Button1 = GUICtrlCreateButton("Вставить API key", 10, 10, 150, 25)
  7. $Button2 = GUICtrlCreateButton("Держать Online", 10, 50, 150, 25)
  8. $Label1 = GUICtrlCreateLabel("API Key: ???", 180, 15, 300, 100)
  9. $Label2 = GUICtrlCreateLabel("Status: Offline", 180, 55, 300, 100)
  10.  
  11. $Label3 = GUICtrlCreateLabel("Нечего передавать / принимать", 180, 95, 300, 100)
  12. $Label4 = GUICtrlCreateLabel("Нечего передавать / принимать", 180, 135, 300, 100)
  13.  
  14. $Button3 = GUICtrlCreateButton("Открыть market.csgo.com", 10, 90, 150, 25)
  15. $Button4 = GUICtrlCreateButton("Открыть market.dota2.net", 10, 130, 150, 25)
  16. $Button5 = GUICtrlCreateButton("Создать API key", 10, 170, 150, 25)
  17. $Button6 = GUICtrlCreateButton("Как создать API key", 10, 210, 150, 25)
  18. $Button7 = GUICtrlCreateButton("Включить", 10, 250, 150, 25)
  19. $Label5 = GUICtrlCreateLabel("Автозапуск при старте Windows", 180, 255, 300, 25)
  20. $Label6 = GUICtrlCreateLabel("Программа написана не штатными кодерами, а одним из сотрудников ТП. Прошу простить, если что-то у вас работает не так.", 20, 300, 300, 100)
  21.  
  22. GUISetState(@SW_SHOW)
  23. #EndRegion ### END Koda GUI section ###
  24.  
  25. $https = "https://market.csgo.com/api/v2/ping?key="
  26. $httpstadadota = "https://market.dota2.net/api/v2/items?key="
  27. $httpstadacsgo = "https://market.csgo.com/api/v2/items?key="
  28.  
  29. $apikey = IniRead ( "settings.ini", "General", "API", "Enter API key" )
  30. GUICtrlSetData($Label1, "API Key:" &$apikey )
  31. pingit()
  32. tadacsgo()
  33. tadadota()
  34. checkautostart()
  35. AdlibRegister("pingit",  120000)
  36. AdlibRegister("tadadota",  120000)
  37. AdlibRegister("tadacsgo",  60000)
  38. AdlibRegister("checkautostart",  50000)
  39.  
  40. While 1
  41.     $nMsg = GUIGetMsg()
  42.     Switch $nMsg
  43.         Case $GUI_EVENT_CLOSE
  44.             Exit
  45.  
  46.          Case $Button1
  47.          SetApiKey()
  48.  
  49.          Case $Button2
  50.          pingit()
  51.          AdlibRegister("pingit",  120000)
  52.  
  53.          Case $Button3
  54.          ShellExecute("https://market.csgo.com/sell")
  55.  
  56.          Case $Button4
  57.          ShellExecute('https://market.dota2.net/sell')
  58.  
  59.          Case $Button5
  60.          ShellExecute('https://market.csgo.com/docs-v2')
  61.  
  62.          Case $Button6
  63.          ShellExecute('https://imgur.com/a/Y0RVfBC')
  64.  
  65.  
  66.          Case $Button7
  67.           onoffautostart()
  68.  
  69.  
  70.  
  71.    EndSwitch
  72. WEnd
  73.  
  74.  
  75. Func Gooffline()
  76.    InetRead("https://market.csgo.com/api/v2/go-offline?key=wTCSe9Tu0tXZ9Fjqu16ZWfMrq97imV1")
  77.  
  78. EndFunc
  79.  
  80. func pingit()
  81.             $apikey = IniRead ( "settings.ini", "General", "API", "Enter API key" )
  82.             $https = "https://market.csgo.com/api/v2/ping?key="
  83.             $fullrequest = $https&$apikey
  84.             $SRead = BinaryToString(InetRead($fullrequest))
  85.             If StringInStr($SRead, "success") Then
  86.             GUICtrlSetData($Label2, "Status: Online")
  87.             Elseif StringInStr($SRead, "Bad KEY") Then
  88.             GUICtrlSetData($Label2, "Status: Bad key")
  89.         Else
  90.             GUICtrlSetData($Label2, "Status: Error")
  91.          EndIf
  92.  
  93. EndFunc
  94.  
  95.  
  96. Func SetApiKey()
  97.    $apikey = InputBox("Введите свой ключ API маркета","Введите свой ключ API маркета")
  98.    IniWrite( "settings.ini", "General", "API", $apikey )
  99.    GUICtrlSetData($Label1, "API Key:" &$apikey )
  100.    pingit()
  101. EndFunc
  102.  
  103. ;Func Testrequest()
  104. ;$apikey = IniRead ( "settings.ini", "General", "API", "default" )
  105. ;$https = "https://market.csgo.com/api/v2/ping?key="
  106. ;$fullrequest = $https&$apikey
  107. ;  MsgBox(0,"Title",$fullrequest, 10)
  108. ;EndFunc
  109. ;Это сделано для тестов всякой ерунды.
  110.  
  111. Func tadadota()
  112.    $apikey = IniRead ( "settings.ini", "General", "API", "No key" )
  113.    $fullrequest2 = $httpstadadota&$apikey
  114.    $SRead2 = BinaryToString(InetRead($fullrequest2))
  115.    $status4 = 'status":"4'
  116.    $status2 = 'status":"2'
  117.             If StringInStr($SRead2, $status4) Then
  118.         SoundPlay("buydota2.mp3")
  119.         GUICtrlSetData($Label4, "<- ЗАБИРАЙ ПРЕДМЕТЫ!" )
  120.      ElseIf StringInStr($SRead2, $status2) Then
  121.         SoundPlay("selldota2.mp3")
  122.         GUICtrlSetData($Label4, "<- ПЕРЕДАЙ ПРЕДМЕТЫ!" )
  123.      Else
  124.         GUICtrlSetData($Label4, "Нечего передавать / принимать" )
  125.         EndIf
  126.  EndFunc
  127.  
  128. Func tadacsgo()
  129.     $apikey = IniRead ( "settings.ini", "General", "API", "No key" )
  130.     $fullrequest3 = $httpstadacsgo&$apikey
  131.     $SRead3 = BinaryToString(InetRead($fullrequest3))
  132.     $status4 = 'status":"4'
  133.     $status2 = 'status":"2'
  134.             If StringInStr($SRead3, $status4) Then
  135.             GUICtrlSetData($Label3, "<- ЗАБИРАЙ ПРЕДМЕТЫ!" )
  136.         ElseIf StringInStr($SRead3, $status2) Then
  137.         SoundPlay("sellcsgo.mp3")
  138.         GUICtrlSetData($Label3, "<- ПЕРЕДАЙ ПРЕДМЕТЫ!" )
  139.         Else
  140.         GUICtrlSetData($Label3, "Нечего передавать / принимать" )
  141.         EndIf
  142. EndFunc
  143.  
  144. Func checkautostart()
  145. If FileExists(@StartupDir & "\" & "MarketTool.lnk") Then
  146. GUICtrlSetData($Button7, "Выключить")
  147. Else
  148. GUICtrlSetData($Button7, "Включить" )
  149. EndIf
  150. EndFunc
  151.  
  152. func onoffautostart()
  153. If FileExists(@StartupDir & "\" & "MarketTool.lnk") Then
  154. FileDelete(@StartupDir & "\" & "MarketTool.lnk" )
  155. GUICtrlSetData($Button7, "Включить")
  156. Else
  157. FileCreateShortcut (@ScriptFullPath, @StartupDir & "\" & "MarketTool.lnk",@SW_MINIMIZE)
  158. GUICtrlSetData($Button7, "Выключить")
  159. EndIf
  160. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement