Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ButtonConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <WindowsConstants.au3>
- #Region ### START Koda GUI section ### Form=
- $Form1 = GUICreate("Market Tool v.04", 360, 400, 192, 124)
- $Button1 = GUICtrlCreateButton("Вставить API key", 10, 10, 150, 25)
- $Button2 = GUICtrlCreateButton("Держать Online", 10, 50, 150, 25)
- $Label1 = GUICtrlCreateLabel("API Key: ???", 180, 15, 300, 100)
- $Label2 = GUICtrlCreateLabel("Status: Offline", 180, 55, 300, 100)
- $Label3 = GUICtrlCreateLabel("Нечего передавать / принимать", 180, 95, 300, 100)
- $Label4 = GUICtrlCreateLabel("Нечего передавать / принимать", 180, 135, 300, 100)
- $Button3 = GUICtrlCreateButton("Открыть market.csgo.com", 10, 90, 150, 25)
- $Button4 = GUICtrlCreateButton("Открыть market.dota2.net", 10, 130, 150, 25)
- $Button5 = GUICtrlCreateButton("Создать API key", 10, 170, 150, 25)
- $Button6 = GUICtrlCreateButton("Как создать API key", 10, 210, 150, 25)
- $Button7 = GUICtrlCreateButton("Включить", 10, 250, 150, 25)
- $Label5 = GUICtrlCreateLabel("Автозапуск при старте Windows", 180, 255, 300, 25)
- $Label6 = GUICtrlCreateLabel("Программа написана не штатными кодерами, а одним из сотрудников ТП. Прошу простить, если что-то у вас работает не так.", 20, 300, 300, 100)
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- $https = "https://market.csgo.com/api/v2/ping?key="
- $httpstadadota = "https://market.dota2.net/api/v2/items?key="
- $httpstadacsgo = "https://market.csgo.com/api/v2/items?key="
- $apikey = IniRead ( "settings.ini", "General", "API", "Enter API key" )
- GUICtrlSetData($Label1, "API Key:" &$apikey )
- pingit()
- tadacsgo()
- tadadota()
- checkautostart()
- AdlibRegister("pingit", 120000)
- AdlibRegister("tadadota", 120000)
- AdlibRegister("tadacsgo", 60000)
- AdlibRegister("checkautostart", 50000)
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- Case $Button1
- SetApiKey()
- Case $Button2
- pingit()
- AdlibRegister("pingit", 120000)
- Case $Button3
- ShellExecute("https://market.csgo.com/sell")
- Case $Button4
- ShellExecute('https://market.dota2.net/sell')
- Case $Button5
- ShellExecute('https://market.csgo.com/docs-v2')
- Case $Button6
- ShellExecute('https://imgur.com/a/Y0RVfBC')
- Case $Button7
- onoffautostart()
- EndSwitch
- WEnd
- Func Gooffline()
- InetRead("https://market.csgo.com/api/v2/go-offline?key=wTCSe9Tu0tXZ9Fjqu16ZWfMrq97imV1")
- EndFunc
- func pingit()
- $apikey = IniRead ( "settings.ini", "General", "API", "Enter API key" )
- $https = "https://market.csgo.com/api/v2/ping?key="
- $fullrequest = $https&$apikey
- $SRead = BinaryToString(InetRead($fullrequest))
- If StringInStr($SRead, "success") Then
- GUICtrlSetData($Label2, "Status: Online")
- Elseif StringInStr($SRead, "Bad KEY") Then
- GUICtrlSetData($Label2, "Status: Bad key")
- Else
- GUICtrlSetData($Label2, "Status: Error")
- EndIf
- EndFunc
- Func SetApiKey()
- $apikey = InputBox("Введите свой ключ API маркета","Введите свой ключ API маркета")
- IniWrite( "settings.ini", "General", "API", $apikey )
- GUICtrlSetData($Label1, "API Key:" &$apikey )
- pingit()
- EndFunc
- ;Func Testrequest()
- ;$apikey = IniRead ( "settings.ini", "General", "API", "default" )
- ;$https = "https://market.csgo.com/api/v2/ping?key="
- ;$fullrequest = $https&$apikey
- ; MsgBox(0,"Title",$fullrequest, 10)
- ;EndFunc
- ;Это сделано для тестов всякой ерунды.
- Func tadadota()
- $apikey = IniRead ( "settings.ini", "General", "API", "No key" )
- $fullrequest2 = $httpstadadota&$apikey
- $SRead2 = BinaryToString(InetRead($fullrequest2))
- $status4 = 'status":"4'
- $status2 = 'status":"2'
- If StringInStr($SRead2, $status4) Then
- SoundPlay("buydota2.mp3")
- GUICtrlSetData($Label4, "<- ЗАБИРАЙ ПРЕДМЕТЫ!" )
- ElseIf StringInStr($SRead2, $status2) Then
- SoundPlay("selldota2.mp3")
- GUICtrlSetData($Label4, "<- ПЕРЕДАЙ ПРЕДМЕТЫ!" )
- Else
- GUICtrlSetData($Label4, "Нечего передавать / принимать" )
- EndIf
- EndFunc
- Func tadacsgo()
- $apikey = IniRead ( "settings.ini", "General", "API", "No key" )
- $fullrequest3 = $httpstadacsgo&$apikey
- $SRead3 = BinaryToString(InetRead($fullrequest3))
- $status4 = 'status":"4'
- $status2 = 'status":"2'
- If StringInStr($SRead3, $status4) Then
- GUICtrlSetData($Label3, "<- ЗАБИРАЙ ПРЕДМЕТЫ!" )
- ElseIf StringInStr($SRead3, $status2) Then
- SoundPlay("sellcsgo.mp3")
- GUICtrlSetData($Label3, "<- ПЕРЕДАЙ ПРЕДМЕТЫ!" )
- Else
- GUICtrlSetData($Label3, "Нечего передавать / принимать" )
- EndIf
- EndFunc
- Func checkautostart()
- If FileExists(@StartupDir & "\" & "MarketTool.lnk") Then
- GUICtrlSetData($Button7, "Выключить")
- Else
- GUICtrlSetData($Button7, "Включить" )
- EndIf
- EndFunc
- func onoffautostart()
- If FileExists(@StartupDir & "\" & "MarketTool.lnk") Then
- FileDelete(@StartupDir & "\" & "MarketTool.lnk" )
- GUICtrlSetData($Button7, "Включить")
- Else
- FileCreateShortcut (@ScriptFullPath, @StartupDir & "\" & "MarketTool.lnk",@SW_MINIMIZE)
- GUICtrlSetData($Button7, "Выключить")
- EndIf
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement