Что нового

[Ошибки] Бот для игры в контакте ТЮРЯГА

CreatiK

Новичок
Сообщения
93
Репутация
4
Уже давно пытаюсь создать бот для него и вот что получилось:
1-Очень большой код-хочу чтобы вы мне помогли убрать лишнее из него.
2-Программа медленная - ущу решение
Хочу реализовать в этом боте
1- Умное хождение за сигами (Не соберает если их нет , и соберает имитируя человека - Заход , если нет - не соберает)
2- Сохранение настроек...

Ну так как в коде есть ошибки с начало их исправим а потом за реализацую новых параметров бота


Вот сам код
Код:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <TreeViewConstants.au3>
#include <ButtonConstants.au3>

Opt('MustDeclareVars', 1)
Opt('TrayIconDebug', 1)

_Main()

Func _Main()
	Local $dvor, $proxod, $podogrev,$money,$sigaret,$prib1,$prib2,$prib3
	Local $msg,$rating,$energy,$diamond
	Global  $Host,$File,$URL,$PostData,$oHTTP,$Response,$sUser,$Auth
	Global $hGUI, $Input, $Button, $nMsg, $sMoney
	Global $b1,$b2,$b3,$b4,$b5,$b6,$b7
	Global $k1,$k2,$k3,$k4,$k5,$k6,$k7
	Global $v1,$v2,$v3,$v4,$v5,$v6,$v7

	GUICreate("Бот для Тюряги", 400, 379)
	GUICtrlCreatePic(@ScriptDir &"\extra\logo.jpg", 0, 0, 201, 379,$SS_BITMAP )
	GuiCtrlSetState(-1,$GUI_DISABLE)
	$dvor = GUICtrlCreateButton("Собрать папиросы во Дворе", 210, 290, 170, 20)
	$proxod = GUICtrlCreateButton("Cобрать все в Проходной", 10, 286, 145, 32, $BS_BITMAP)
	GUICtrlSetImage(-1,@ScriptDir &"\extra\prib.bmp",0)
	GUICtrlSetTip($money,"Показывает инфу о Сигаретах,Энергии и т.д.")
	GUICtrlSetCursor(-1, 0)
	$podogrev = GUICtrlCreateButton("Coбрать все Подогревы", 210, 340, 170, 20)
	$sigaret = GUICtrlCreateInput('', 10, 194, 80, 15, BitOR($ES_READONLY, $ES_CENTER))
	$energy = GUICtrlCreateInput('', 10, 218, 80, 15, BitOR($ES_READONLY, $ES_CENTER))
	$rating = GUICtrlCreateInput('', 10, 243, 80, 15, BitOR($ES_READONLY, $ES_CENTER))
	$diamond = GUICtrlCreateInput('', 10, 267, 80, 15, BitOR($ES_READONLY, $ES_CENTER))
	$prib1 = GUICtrlCreateInput('', 10, 355, 33, 15, BitOR($ES_READONLY, $ES_CENTER))
	$prib2 = GUICtrlCreateInput('', 67, 355, 33, 15, BitOR($ES_READONLY, $ES_CENTER))
	$prib3 = GUICtrlCreateInput('', 123, 355, 33, 15, BitOR($ES_READONLY, $ES_CENTER))
	$money = GUICtrlCreateButton('Получить', 50, 165, 100, 25, $BS_BITMAP)
	GUICtrlSetImage(-1,@ScriptDir &"\extra\pol.bmp",0)
	GUICtrlSetTip($money,"Показывает инфу о Сигаретах,Энергии и т.д.")
	GUICtrlSetCursor(-1, 0)
	
	$sUser = InputBox('ID пользователя', 'Введите ID пользователя', '572929**', '',  360, 120)
	$Auth = InputBox('Auth пользователя', 'Введите Auth пользователя', 'f91bca177f94e848e4d763332fbfd***', '',  360, 120)
	GuiCtrlCreateTab(200, 0, 200, 260)
	GuiCtrlCreateTabItem("Бутырка")
	GUICtrlCreatePic(@ScriptDir &"\extra\logo1.gif", 200, 21, 200, 360,$SS_BITMAP )
	GuiCtrlSetState(-0,$GUI_DISABLE)
	$b1 = GuiCtrlCreateButton("Задание №1", 210, 50)
	$b2 = GuiCtrlCreateButton("Задание №2", 210, 80)
	$b3 = GuiCtrlCreateButton("Задание №3", 210, 110)
	$b4 = GuiCtrlCreateButton("Задание №4", 210, 140)
	$b5 = GuiCtrlCreateButton("Задание №5", 210, 170)
	$b6 = GuiCtrlCreateButton("Задание №6", 210, 200)
	$b7 = GuiCtrlCreateButton("Задание №7", 210, 230)
	GuiCtrlCreateTabItem("Кресты")
	GUICtrlCreatePic(@ScriptDir &"\extra\logo2.gif", 200, 21, 200, 360,$SS_BITMAP )
	GuiCtrlSetState(-1,$GUI_DISABLE)
	$k1 = GuiCtrlCreateButton("Задание №1", 210, 50)
	$k2 = GuiCtrlCreateButton("Задание №2", 210, 80)
	$k3 = GuiCtrlCreateButton("Задание №3", 210, 110)
	$k4 = GuiCtrlCreateButton("Задание №4", 210, 140)
	$k5 = GuiCtrlCreateButton("Задание №5", 210, 170)
	$k6 = GuiCtrlCreateButton("Задание №6", 210, 200)
	$k7 = GuiCtrlCreateButton("Задание №7", 210, 230)
	GuiCtrlCreateTabItem("В.Централ")
	GUICtrlCreatePic(@ScriptDir &"\extra\logo1.gif", 200, 21, 200, 360,$SS_BITMAP )
	GuiCtrlSetState(-1,$GUI_DISABLE)
	$v1 = GuiCtrlCreateButton("Задание №1", 210, 50)
	$v2 = GuiCtrlCreateButton("Задание №2", 210, 80)
	$v3 = GuiCtrlCreateButton("Задание №3", 210, 110)
	$v4 = GuiCtrlCreateButton("Задание №4", 210, 140)
	$v5 = GuiCtrlCreateButton("Задание №5", 210, 170)
	$v6 = GuiCtrlCreateButton("Задание №6", 210, 200)
	GuiCtrlSetState(-1,$GUI_DISABLE)
	GUICtrlSetTip($v6,"Скоро...")
	$v7 = GuiCtrlCreateButton("Задание №7", 210, 230)
	GuiCtrlSetState(-1,$GUI_DISABLE)
	GUICtrlSetTip($v7,"Скоро...")
	GuiCtrlCreateTabItem("")
	GUISetState(@SW_SHOW)
	TCPStartup()
	While 1
		$msg = GUIGetMsg()


		Select
			Case $msg = $GUI_EVENT_CLOSE
				ExitLoop
			Case $msg = $money
				GUISetState(@SW_DISABLE)
				GUICtrlSetData($sigaret & $rating & $diamond & $energy, '')
				$sMoney = _My_Func()
				If $sMoney <> -1 Then
					GUICtrlSetData($sigaret, $sMoney)
				Else
					GUICtrlSetData($sigaret, 'Ошибка')
				EndIf
				$sMoney = _My_Func1()
				If $sMoney <> -1 Then
					GUICtrlSetData($rating, $sMoney)
				Else
					GUICtrlSetData($rating, 'Ошибка')
				EndIf				
				GUISetState(@SW_ENABLE)
				$sMoney = _My_Func2()
				If $sMoney <> -1 Then
					GUICtrlSetData($diamond, $sMoney)
				Else
					GUICtrlSetData($diamond, 'Ошибка')
				EndIf
				$sMoney = _My_Func3()
				If $sMoney <> -1 Then
					GUICtrlSetData($energy, $sMoney)
				Else
					GUICtrlSetData($energy, 'Ошибка')
				EndIf
				$sMoney = _My_Func4()
				If $sMoney <> -1 Then
					GUICtrlSetData($prib1, $sMoney)
				Else
					GUICtrlSetData($prib1, 'Ошибка')
				EndIf	
				$sMoney = _My_Func5()
				If $sMoney <> -1 Then
					GUICtrlSetData($prib2, $sMoney)
				Else
					GUICtrlSetData($prib2, 'Ошибка')
				EndIf	
				$sMoney = _My_Func6()
				If $sMoney <> -1 Then
					GUICtrlSetData($prib3, $sMoney)
				Else
					GUICtrlSetData($prib3, 'Ошибка')
				EndIf					
				GUISetState(@SW_ENABLE)
				GUISetState(@SW_ENABLE)
			Case $msg = $b1
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "city=1&key="& $Auth &"&action%5Ftype=3&method=doCityAction&sig=838d1b18e8010910aee8df39131206b1&user="&$sUser&"&action%5Fid=1" 
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $b2
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "user="&$sUser&"&city=1&sig=5cdf461b8f5c359b4ca715cde7cb3275&action%5Fid=2&key="& $Auth &"&action%5Ftype=3&method=doCityAction" 
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $b3
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "city=1&action%5Fid=3&sig=84b2a05fc1de3218cd6d83e0d2464bca&method=doCityAction&key="& $Auth &"&user="&$sUser&"&action%5Ftype=3" 
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $b4
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "city=1&action%5Fid=4&sig=8d465274186e26236d5254a61c59e090&method=doCityAction&key="& $Auth &"&user="&$sUser&"&action%5Ftype=3" 
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $b5
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "city=1&sig=66da86540fd2fb4c67a68a52c9a56c39&key="& $Auth &"&action%5Ftype=3&action%5Fid=5&user="&$sUser&"&method=doCityAction" 
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $b6
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "user="&$sUser&"&city=1&action%5Fid=6&key="& $Auth &"&sig=8822eb384d135df7e93cd2eadbe5d4cc&action%5Ftype=3&method=doCityAction" 
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $b7
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "city=1&action%5Fid=7&action%5Ftype=3&sig=f645a1f80cd76fe8d5cc2c86745af5a4&key="& $Auth &"&user="&$sUser&"&method=doCityAction" 
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $k1
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "action%5Ftype=3&method=doCityAction&action%5Fid=1&key="& $Auth &"&sig=5c66cf52daeaec0dc4644c7928e54a4f&city=2&user="&$sUser&"" 
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $k2
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "action%5Ftype=3&method=doCityAction&action%5Fid=2&key="& $Auth &"&sig=94a6c5da1659020a1b9980e8e3929785&city=2&user="&$sUser&"" 
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $k3
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "action%5Ftype=3&method=doCityAction&action%5Fid=3&key="& $Auth &"&sig=e73c45ea0ea474a384da6c6d1b4041a4&city=2&user="&$sUser&"" 
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $k4
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "action%5Ftype=3&method=doCityAction&action%5Fid=4&key="& $Auth &"&sig=13e1599c8adf4c0737442ade663747ec&city=2&user="&$sUser&"" 
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $k5
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "city=2&user="&$sUser&"&action%5Fid=5&action%5Ftype=3&key="& $Auth &"&sig=ca7b8ce0708b87b98aac59b65d7be77f&method=doCityAction" 
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $k6
				$Host = "109.234.156.250"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "city=2&user="&$sUser&"&action%5Ftype=3&key="& $Auth &"&action%5Fid=6&sig=6b8864635b1462d3d7ea19db4db75927&method=doCityAction" 
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $k7
				
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "city=1&action%5Fid=7&action%5Ftype=3&sig=f645a1f80cd76fe8d5cc2c86745af5a4&key="& $Auth &"&user="&$sUser&"&method=doCityAction" 
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $v1
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "method=doCityAction&user="&$sUser&"&key="& $Auth &"&city=3&action%5Ftype=3&sig=1069ec0e304758b43442620abc1358d3&action%5Fid=1" 
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $v2
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "method=doCityAction&user="&$sUser&"&key="& $Auth &"&city=3&action%5Ftype=3&sig=7f269e62e22efa131854208f42ef44e1&action%5Fid=2" 
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $v3
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "method=doCityAction&user="&$sUser&"&key="& $Auth &"&city=3&action%5Ftype=3&sig=c777fdc264d9b23d0c2ea9be1bc68fe5&action%5Fid=3" 
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $v4
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "method=doCityAction&user="&$sUser&"&key="& $Auth &"&city=3&action%5Ftype=3&sig=7e7897d923dee2a9102de232382b3d49&action%5Fid=4" 
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $v5
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "method=doCityAction&user="&$sUser&"&key="& $Auth &"&city=3&action%5Ftype=3&sig=537f770dac1c6f055e64a527e12bf8c2&action%5Fid=5" 
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $v6
				$Host = "109.234.156.250"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "method=doCityAction&user="&$sUser&"&key="& $Auth &"&city=3&action%5Ftype=3&sig=c777fdc264d9b23d0c2ea9be1bc68fe5&action%5Fid=3"  
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $v7
			Case $msg = $dvor
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?office"
				$URL = "http://" & $Host & $File
				$PostData   = "sig=a2c4397152d04569f6cd2d1002db7648&key="& $Auth &"&getidea=1&user="&$sUser&"&method=office"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Бот", "Сигареты собранны")
			Case $msg = $podogrev
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?useAllPresents"
				$URL = "http://" & $Host & $File
				$PostData   = "user="&$sUser&"&key="& $Auth &"&sig=3d61df9647e743e02dd8ddc847b00f1f&method=useAllPresents" 
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Подогрывы собраны")
			Case $msg = $proxod
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Подогрывы собраны")
		EndSelect
	WEnd

	GUIDelete()

	Exit
EndFunc  ;==>_Main
;~ Иинформация о сигаретах
Func _My_Func()
    Local $Response, $sMessage
    Local $Host = '109.234.155.196'
    If Not Ping($Host) Then Return -1
    Local $File = '/prison/universal.php?getInfo'
    Local $URL = 'http://' & $Host & $File
    Local $PostData = "sig=5064ea55b0c410563fe3bd4dd23cd5c8&key="& $Auth &"&user="&$sUser&"&method=getInfo"
    Local $oHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1')
    $oHTTP.Open('POST', $URL)
    $oHTTP.setTimeouts(5000, 5000, 10000, 10000)
    $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    Execute('$oHTTP.Send($PostData)')
    If (@error) Or ($oHTTP.Status <> 200) Then
        Return -1
    Else
        $oHTTP.WaitForResponse
        $Response = $oHTTP.ResponseText
        If Not $Response Then Return -1
    EndIf

    $sMessage = StringRegExpReplace($Response, '(?s).*?<money>(\d+)</money>?.*', '\1')
    If Not $sMessage Then Return -1
    Return $sMessage
EndFunc   ;==>_My_Func
;~ Иинформация о энергии
Func _My_Func1()
    Local $Response, $sMessage
    Local $Host = '109.234.155.196'
    If Not Ping($Host) Then Return -1
    Local $File = '/prison/universal.php?getInfo'
    Local $URL = 'http://' & $Host & $File
    Local $PostData = "sig=5064ea55b0c410563fe3bd4dd23cd5c8&key="& $Auth &"&user="&$sUser&"&method=getInfo"
    Local $oHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1')
    $oHTTP.Open('POST', $URL)
    $oHTTP.setTimeouts(5000, 5000, 10000, 10000)
    $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    Execute('$oHTTP.Send($PostData)')
    If (@error) Or ($oHTTP.Status <> 200) Then
        Return -1
    Else
        $oHTTP.WaitForResponse
        $Response = $oHTTP.ResponseText
        If Not $Response Then Return -1
    EndIf

	$sMessage = StringRegExpReplace($Response, '(?s).*?<energy>(\d+)</energy>?.*', '\1')
    If Not $sMessage Then Return -1
    Return $sMessage
EndFunc   ;==>_My_Func
;~ Иинформация о рублях
Func _My_Func2()
    Local $Response, $sMessage
    Local $Host = '109.234.155.196'
    If Not Ping($Host) Then Return -1
    Local $File = '/prison/universal.php?getInfo'
    Local $URL = 'http://' & $Host & $File
    Local $PostData = "sig=5064ea55b0c410563fe3bd4dd23cd5c8&key="& $Auth &"&user="&$sUser&"&method=getInfo"
    Local $oHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1')
    $oHTTP.Open('POST', $URL)
    $oHTTP.setTimeouts(5000, 5000, 10000, 10000)
    $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    Execute('$oHTTP.Send($PostData)')
    If (@error) Or ($oHTTP.Status <> 200) Then
        Return -1
    Else
        $oHTTP.WaitForResponse
        $Response = $oHTTP.ResponseText
        If Not $Response Then Return -1
    EndIf

	$sMessage = StringRegExpReplace($Response, '(?s).*?<diamond>(\d+)</diamond>?.*', '\1')
    If Not $sMessage Then Return -1
    Return $sMessage
EndFunc   ;==>_My_Func
;~ Иинформация о рейтинга
Func _My_Func3()
    Local $Response, $sMessage
    Local $Host = '109.234.155.196'
    If Not Ping($Host) Then Return -1
    Local $File = '/prison/universal.php?getInfo'
    Local $URL = 'http://' & $Host & $File
    Local $PostData = "sig=5064ea55b0c410563fe3bd4dd23cd5c8&key="& $Auth &"&user="&$sUser&"&method=getInfo"
    Local $oHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1')
    $oHTTP.Open('POST', $URL)
    $oHTTP.setTimeouts(5000, 5000, 10000, 10000)
    $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    Execute('$oHTTP.Send($PostData)')
    If (@error) Or ($oHTTP.Status <> 200) Then
        Return -1
    Else
        $oHTTP.WaitForResponse
        $Response = $oHTTP.ResponseText
        If Not $Response Then Return -1
    EndIf

	$sMessage = StringRegExpReplace($Response, '(?s).*?<rating>(\d+)</rating>?.*', '\1')
    If Not $sMessage Then Return -1
    Return $sMessage
EndFunc   ;==>_My_Func
;~ Иинформация о сборе сигарет в проходной
Func _My_Func4()
    Local $Response, $sMessage
    Local $Host = '109.234.155.196'
    If Not Ping($Host) Then Return -1
    Local $File = '/prison/universal.php?getAllBuildingsRewardsInfo'
    Local $URL = 'http://' & $Host & $File
    Local $PostData = "sig=f6b93aab695ecb7332184064e3058760&user="&$sUser&"&key="& $Auth &"&method=getAllBuildingsRewardsInfo"
    Local $oHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1')
    $oHTTP.Open('POST', $URL)
    $oHTTP.setTimeouts(5000, 5000, 10000, 10000)
    $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    Execute('$oHTTP.Send($PostData)')
    If (@error) Or ($oHTTP.Status <> 200) Then
        Return -1
    Else
        $oHTTP.WaitForResponse
        $Response = $oHTTP.ResponseText
        If Not $Response Then Return -1
    EndIf

	$sMessage = StringRegExpReplace($Response, '(?s).*?<money>(\d+)</money>?.*', '\1')
    If Not $sMessage Then Return -1
    Return $sMessage
EndFunc   ;==>_My_Func
;~ Иинформация о сборе рейтинга в проходной
Func _My_Func5()
    Local $Response, $sMessage
    Local $Host = '109.234.155.196'
    If Not Ping($Host) Then Return -1
    Local $File = '/prison/universal.php?getAllBuildingsRewardsInfo'
    Local $URL = 'http://' & $Host & $File
    Local $PostData = "sig=f6b93aab695ecb7332184064e3058760&user="&$sUser&"&key="& $Auth &"&method=getAllBuildingsRewardsInfo"
    Local $oHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1')
    $oHTTP.Open('POST', $URL)
    $oHTTP.setTimeouts(5000, 5000, 10000, 10000)
    $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    Execute('$oHTTP.Send($PostData)')
    If (@error) Or ($oHTTP.Status <> 200) Then
        Return -1
    Else
        $oHTTP.WaitForResponse
        $Response = $oHTTP.ResponseText
        If Not $Response Then Return -1
    EndIf

	$sMessage = StringRegExpReplace($Response, '(?s).*?<rating>(\d+)</rating>?.*', '\1')
    If Not $sMessage Then Return -1
    Return $sMessage
EndFunc   ;==>_My_Func
;~ Иинформация о сборе Уважение в проходной
Func _My_Func6()
    Local $Response, $sMessage
    Local $Host = '109.234.155.196'
    If Not Ping($Host) Then Return -1
    Local $File = '/prison/universal.php?getAllBuildingsRewardsInfo'
    Local $URL = 'http://' & $Host & $File
    Local $PostData = "sig=f6b93aab695ecb7332184064e3058760&user="&$sUser&"&key="& $Auth &"&method=getAllBuildingsRewardsInfo"
    Local $oHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1')
    $oHTTP.Open('POST', $URL)
    $oHTTP.setTimeouts(5000, 5000, 10000, 10000)
    $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    Execute('$oHTTP.Send($PostData)')
    If (@error) Or ($oHTTP.Status <> 200) Then
        Return -1
    Else
        $oHTTP.WaitForResponse
        $Response = $oHTTP.ResponseText
        If Not $Response Then Return -1
    EndIf

	$sMessage = StringRegExpReplace($Response, '(?s).*?<love>(\d+)</love>?.*', '\1')
    If Not $sMessage Then Return -1
    Return $sMessage
EndFunc   ;==>_My_Func


Вот еще выложил исходники) буду рад помощи
 

JaG

Новичок
Сообщения
17
Репутация
0
Стукни в асю 275540 =) Начал делать бота на основе твоего, ток получше и кода меньше =) :IL_AutoIt_1:
 
Автор
C

CreatiK

Новичок
Сообщения
93
Репутация
4
Ну че кто нибудь может оптимизировать код и убрать лишнее если я что то лишнее написал
 

Guezt

Продвинутый
Сообщения
335
Репутация
82
Можно вынести сохранение ID и Key в файл вот так например:
Код:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <TreeViewConstants.au3>
#include <ButtonConstants.au3>

Opt('MustDeclareVars', 1)
Opt('TrayIconDebug', 1)

    Global  $Host,$File,$URL,$PostData,$oHTTP,$Response,$sUser,$Auth
	Global $hGUI, $Input, $Button, $nMsg, $sMoney
	Global $b1,$b2,$b3,$b4,$b5,$b6,$b7
	Global $k1,$k2,$k3,$k4,$k5,$k6,$k7
	Global $v1,$v2,$v3,$v4,$v5,$v6,$v7

if FileExists(@ScriptDir&'\settings.ini') Then
		$sUser = IniRead(@ScriptDir&'\settings.ini','USER','id','')
		$Auth  = IniRead(@ScriptDir&'\settings.ini','USER','Auth','')
	Else
		_SetUserInfo()
		$sUser = IniRead(@ScriptDir&'\settings.ini','USER','id','')
		$Auth  = IniRead(@ScriptDir&'\settings.ini','USER','Auth','')
	EndIf

_Main()



Func _Main()
	Local $dvor, $proxod, $podogrev,$money,$sigaret,$prib1,$prib2,$prib3
	Local $msg,$rating,$energy,$diamond


	GUICreate("Бот для Тюряги", 400, 379)
	GUICtrlCreatePic(@ScriptDir &"\extra\logo.jpg", 0, 0, 201, 379,$SS_BITMAP )
	GuiCtrlSetState(-1,$GUI_DISABLE)
	$dvor = GUICtrlCreateButton("Собрать папиросы во Дворе", 210, 290, 170, 20)
	$proxod = GUICtrlCreateButton("Cобрать все в Проходной", 10, 286, 145, 32, $BS_BITMAP)
	GUICtrlSetImage(-1,@ScriptDir &"\extra\prib.bmp",0)
	GUICtrlSetTip($money,"Показывает инфу о Сигаретах,Энергии и т.д.")
	GUICtrlSetCursor(-1, 0)
	$podogrev = GUICtrlCreateButton("Coбрать все Подогревы", 210, 340, 170, 20)
	$sigaret = GUICtrlCreateInput('', 10, 194, 80, 15, BitOR($ES_READONLY, $ES_CENTER))
	$energy = GUICtrlCreateInput('', 10, 218, 80, 15, BitOR($ES_READONLY, $ES_CENTER))
	$rating = GUICtrlCreateInput('', 10, 243, 80, 15, BitOR($ES_READONLY, $ES_CENTER))
	$diamond = GUICtrlCreateInput('', 10, 267, 80, 15, BitOR($ES_READONLY, $ES_CENTER))
	$prib1 = GUICtrlCreateInput('', 10, 355, 33, 15, BitOR($ES_READONLY, $ES_CENTER))
	$prib2 = GUICtrlCreateInput('', 67, 355, 33, 15, BitOR($ES_READONLY, $ES_CENTER))
	$prib3 = GUICtrlCreateInput('', 123, 355, 33, 15, BitOR($ES_READONLY, $ES_CENTER))
	$money = GUICtrlCreateButton('Получить', 50, 165, 100, 25, $BS_BITMAP)
	GUICtrlSetImage(-1,@ScriptDir &"\extra\pol.bmp",0)
	GUICtrlSetTip($money,"Показывает инфу о Сигаретах,Энергии и т.д.")
	GUICtrlSetCursor(-1, 0)


	GuiCtrlCreateTab(200, 0, 200, 260)
	GuiCtrlCreateTabItem("Бутырка")
	GUICtrlCreatePic(@ScriptDir &"\extra\logo1.gif", 200, 21, 200, 360,$SS_BITMAP )
	GuiCtrlSetState(-0,$GUI_DISABLE)
	$b1 = GuiCtrlCreateButton("Задание №1", 210, 50)
	$b2 = GuiCtrlCreateButton("Задание №2", 210, 80)
	$b3 = GuiCtrlCreateButton("Задание №3", 210, 110)
	$b4 = GuiCtrlCreateButton("Задание №4", 210, 140)
	$b5 = GuiCtrlCreateButton("Задание №5", 210, 170)
	$b6 = GuiCtrlCreateButton("Задание №6", 210, 200)
	$b7 = GuiCtrlCreateButton("Задание №7", 210, 230)
	GuiCtrlCreateTabItem("Кресты")
	GUICtrlCreatePic(@ScriptDir &"\extra\logo2.gif", 200, 21, 200, 360,$SS_BITMAP )
	GuiCtrlSetState(-1,$GUI_DISABLE)
	$k1 = GuiCtrlCreateButton("Задание №1", 210, 50)
	$k2 = GuiCtrlCreateButton("Задание №2", 210, 80)
	$k3 = GuiCtrlCreateButton("Задание №3", 210, 110)
	$k4 = GuiCtrlCreateButton("Задание №4", 210, 140)
	$k5 = GuiCtrlCreateButton("Задание №5", 210, 170)
	$k6 = GuiCtrlCreateButton("Задание №6", 210, 200)
	$k7 = GuiCtrlCreateButton("Задание №7", 210, 230)
	GuiCtrlCreateTabItem("В.Централ")
	GUICtrlCreatePic(@ScriptDir &"\extra\logo1.gif", 200, 21, 200, 360,$SS_BITMAP )
	GuiCtrlSetState(-1,$GUI_DISABLE)
	$v1 = GuiCtrlCreateButton("Задание №1", 210, 50)
	$v2 = GuiCtrlCreateButton("Задание №2", 210, 80)
	$v3 = GuiCtrlCreateButton("Задание №3", 210, 110)
	$v4 = GuiCtrlCreateButton("Задание №4", 210, 140)
	$v5 = GuiCtrlCreateButton("Задание №5", 210, 170)
	$v6 = GuiCtrlCreateButton("Задание №6", 210, 200)
	GuiCtrlSetState(-1,$GUI_DISABLE)
	GUICtrlSetTip($v6,"Скоро...")
	$v7 = GuiCtrlCreateButton("Задание №7", 210, 230)
	GuiCtrlSetState(-1,$GUI_DISABLE)
	GUICtrlSetTip($v7,"Скоро...")
	GuiCtrlCreateTabItem("")
	GUISetState(@SW_SHOW)
	TCPStartup()
	While 1
		$msg = GUIGetMsg()


		Select
			Case $msg = $GUI_EVENT_CLOSE
				ExitLoop
			Case $msg = $money
				GUISetState(@SW_DISABLE)
				GUICtrlSetData($sigaret & $rating & $diamond & $energy, '')
				$sMoney = _My_Func()
				If $sMoney <> -1 Then
					GUICtrlSetData($sigaret, $sMoney)
				Else
					GUICtrlSetData($sigaret, 'Ошибка')
				EndIf
				$sMoney = _My_Func1()
				If $sMoney <> -1 Then
					GUICtrlSetData($rating, $sMoney)
				Else
					GUICtrlSetData($rating, 'Ошибка')
				EndIf
				GUISetState(@SW_ENABLE)
				$sMoney = _My_Func2()
				If $sMoney <> -1 Then
					GUICtrlSetData($diamond, $sMoney)
				Else
					GUICtrlSetData($diamond, 'Ошибка')
				EndIf
				$sMoney = _My_Func3()
				If $sMoney <> -1 Then
					GUICtrlSetData($energy, $sMoney)
				Else
					GUICtrlSetData($energy, 'Ошибка')
				EndIf
				$sMoney = _My_Func4()
				If $sMoney <> -1 Then
					GUICtrlSetData($prib1, $sMoney)
				Else
					GUICtrlSetData($prib1, 'Ошибка')
				EndIf
				$sMoney = _My_Func5()
				If $sMoney <> -1 Then
					GUICtrlSetData($prib2, $sMoney)
				Else
					GUICtrlSetData($prib2, 'Ошибка')
				EndIf
				$sMoney = _My_Func6()
				If $sMoney <> -1 Then
					GUICtrlSetData($prib3, $sMoney)
				Else
					GUICtrlSetData($prib3, 'Ошибка')
				EndIf
				GUISetState(@SW_ENABLE)
				GUISetState(@SW_ENABLE)
			Case $msg = $b1
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "city=1&key="& $Auth &"&action%5Ftype=3&method=doCityAction&sig=838d1b18e8010910aee8df39131206b1&user="&$sUser&"&action%5Fid=1"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $b2
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "user="&$sUser&"&city=1&sig=5cdf461b8f5c359b4ca715cde7cb3275&action%5Fid=2&key="& $Auth &"&action%5Ftype=3&method=doCityAction"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $b3
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "city=1&action%5Fid=3&sig=84b2a05fc1de3218cd6d83e0d2464bca&method=doCityAction&key="& $Auth &"&user="&$sUser&"&action%5Ftype=3"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $b4
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "city=1&action%5Fid=4&sig=8d465274186e26236d5254a61c59e090&method=doCityAction&key="& $Auth &"&user="&$sUser&"&action%5Ftype=3"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $b5
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "city=1&sig=66da86540fd2fb4c67a68a52c9a56c39&key="& $Auth &"&action%5Ftype=3&action%5Fid=5&user="&$sUser&"&method=doCityAction"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $b6
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "user="&$sUser&"&city=1&action%5Fid=6&key="& $Auth &"&sig=8822eb384d135df7e93cd2eadbe5d4cc&action%5Ftype=3&method=doCityAction"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $b7
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "city=1&action%5Fid=7&action%5Ftype=3&sig=f645a1f80cd76fe8d5cc2c86745af5a4&key="& $Auth &"&user="&$sUser&"&method=doCityAction"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $k1
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "action%5Ftype=3&method=doCityAction&action%5Fid=1&key="& $Auth &"&sig=5c66cf52daeaec0dc4644c7928e54a4f&city=2&user="&$sUser&""
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $k2
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "action%5Ftype=3&method=doCityAction&action%5Fid=2&key="& $Auth &"&sig=94a6c5da1659020a1b9980e8e3929785&city=2&user="&$sUser&""
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $k3
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "action%5Ftype=3&method=doCityAction&action%5Fid=3&key="& $Auth &"&sig=e73c45ea0ea474a384da6c6d1b4041a4&city=2&user="&$sUser&""
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $k4
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "action%5Ftype=3&method=doCityAction&action%5Fid=4&key="& $Auth &"&sig=13e1599c8adf4c0737442ade663747ec&city=2&user="&$sUser&""
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $k5
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "city=2&user="&$sUser&"&action%5Fid=5&action%5Ftype=3&key="& $Auth &"&sig=ca7b8ce0708b87b98aac59b65d7be77f&method=doCityAction"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $k6
				$Host = "109.234.156.250"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "city=2&user="&$sUser&"&action%5Ftype=3&key="& $Auth &"&action%5Fid=6&sig=6b8864635b1462d3d7ea19db4db75927&method=doCityAction"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $k7

				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "city=1&action%5Fid=7&action%5Ftype=3&sig=f645a1f80cd76fe8d5cc2c86745af5a4&key="& $Auth &"&user="&$sUser&"&method=doCityAction"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $v1
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "method=doCityAction&user="&$sUser&"&key="& $Auth &"&city=3&action%5Ftype=3&sig=1069ec0e304758b43442620abc1358d3&action%5Fid=1"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $v2
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "method=doCityAction&user="&$sUser&"&key="& $Auth &"&city=3&action%5Ftype=3&sig=7f269e62e22efa131854208f42ef44e1&action%5Fid=2"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $v3
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "method=doCityAction&user="&$sUser&"&key="& $Auth &"&city=3&action%5Ftype=3&sig=c777fdc264d9b23d0c2ea9be1bc68fe5&action%5Fid=3"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $v4
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "method=doCityAction&user="&$sUser&"&key="& $Auth &"&city=3&action%5Ftype=3&sig=7e7897d923dee2a9102de232382b3d49&action%5Fid=4"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $v5
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "method=doCityAction&user="&$sUser&"&key="& $Auth &"&city=3&action%5Ftype=3&sig=537f770dac1c6f055e64a527e12bf8c2&action%5Fid=5"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $v6
				$Host = "109.234.156.250"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "method=doCityAction&user="&$sUser&"&key="& $Auth &"&city=3&action%5Ftype=3&sig=c777fdc264d9b23d0c2ea9be1bc68fe5&action%5Fid=3"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $v7
			Case $msg = $dvor
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?office"
				$URL = "http://" & $Host & $File
				$PostData   = "sig=a2c4397152d04569f6cd2d1002db7648&key="& $Auth &"&getidea=1&user="&$sUser&"&method=office"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Бот", "Сигареты собранны")
			Case $msg = $podogrev
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?useAllPresents"
				$URL = "http://" & $Host & $File
				$PostData   = "user="&$sUser&"&key="& $Auth &"&sig=3d61df9647e743e02dd8ddc847b00f1f&method=useAllPresents"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Подогрывы собраны")
			Case $msg = $proxod
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?getAllBuildingsRewards"
				$URL = "http://" & $Host & $File
				$PostData   = "key="& $Auth &"&user="&$sUser&"&sig=2092bf53b9d4e1ab2abc15e7980c0915&method=getAllBuildingsRewards"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Подогрывы собраны")
		EndSelect
	WEnd

	GUIDelete()

	Exit
EndFunc  ;==>_Main
;~ Иинформация о сигаретах
Func _My_Func()
    Local $Response, $sMessage
    Local $Host = '109.234.156.250'
    If Not Ping($Host) Then Return -1
    Local $File = '/prison/universal.php?getInfo'
    Local $URL = 'http://' & $Host & $File
    Local $PostData = "sig=5064ea55b0c410563fe3bd4dd23cd5c8&key="& $Auth &"&user="&$sUser&"&method=getInfo"
    Local $oHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1')
    $oHTTP.Open('POST', $URL)
    $oHTTP.setTimeouts(5000, 5000, 10000, 10000)
    $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    Execute('$oHTTP.Send($PostData)')
    If (@error) Or ($oHTTP.Status <> 200) Then
        Return -1
    Else
        $oHTTP.WaitForResponse
        $Response = $oHTTP.ResponseText
        If Not $Response Then Return -1
    EndIf

    $sMessage = StringRegExpReplace($Response, '(?s).*?<money>(\d+)</money>?.*', '\1')
    If Not $sMessage Then Return -1
    Return $sMessage
EndFunc   ;==>_My_Func
;~ Иинформация о энергии
Func _My_Func1()
    Local $Response, $sMessage
    Local $Host = '109.234.155.196'
    If Not Ping($Host) Then Return -1
    Local $File = '/prison/universal.php?getInfo'
    Local $URL = 'http://' & $Host & $File
    Local $PostData = "sig=5064ea55b0c410563fe3bd4dd23cd5c8&key="& $Auth &"&user="&$sUser&"&method=getInfo"
    Local $oHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1')
    $oHTTP.Open('POST', $URL)
    $oHTTP.setTimeouts(5000, 5000, 10000, 10000)
    $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    Execute('$oHTTP.Send($PostData)')
    If (@error) Or ($oHTTP.Status <> 200) Then
        Return -1
    Else
        $oHTTP.WaitForResponse
        $Response = $oHTTP.ResponseText
        If Not $Response Then Return -1
    EndIf

	$sMessage = StringRegExpReplace($Response, '(?s).*?<energy>(\d+)</energy>?.*', '\1')
    If Not $sMessage Then Return -1
    Return $sMessage
EndFunc   ;==>_My_Func
;~ Иинформация о рублях
Func _My_Func2()
    Local $Response, $sMessage
    Local $Host = '109.234.155.196'
    If Not Ping($Host) Then Return -1
    Local $File = '/prison/universal.php?getInfo'
    Local $URL = 'http://' & $Host & $File
    Local $PostData = "sig=5064ea55b0c410563fe3bd4dd23cd5c8&key="& $Auth &"&user="&$sUser&"&method=getInfo"
    Local $oHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1')
    $oHTTP.Open('POST', $URL)
    $oHTTP.setTimeouts(5000, 5000, 10000, 10000)
    $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    Execute('$oHTTP.Send($PostData)')
    If (@error) Or ($oHTTP.Status <> 200) Then
        Return -1
    Else
        $oHTTP.WaitForResponse
        $Response = $oHTTP.ResponseText
        If Not $Response Then Return -1
    EndIf

	$sMessage = StringRegExpReplace($Response, '(?s).*?<diamond>(\d+)</diamond>?.*', '\1')
    If Not $sMessage Then Return -1
    Return $sMessage
EndFunc   ;==>_My_Func
;~ Иинформация о рейтинга
Func _My_Func3()
    Local $Response, $sMessage
    Local $Host = '109.234.155.196'
    If Not Ping($Host) Then Return -1
    Local $File = '/prison/universal.php?getInfo'
    Local $URL = 'http://' & $Host & $File
    Local $PostData = "sig=5064ea55b0c410563fe3bd4dd23cd5c8&key="& $Auth &"&user="&$sUser&"&method=getInfo"
    Local $oHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1')
    $oHTTP.Open('POST', $URL)
    $oHTTP.setTimeouts(5000, 5000, 10000, 10000)
    $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    Execute('$oHTTP.Send($PostData)')
    If (@error) Or ($oHTTP.Status <> 200) Then
        Return -1
    Else
        $oHTTP.WaitForResponse
        $Response = $oHTTP.ResponseText
        If Not $Response Then Return -1
    EndIf

	$sMessage = StringRegExpReplace($Response, '(?s).*?<rating>(\d+)</rating>?.*', '\1')
    If Not $sMessage Then Return -1
    Return $sMessage
EndFunc   ;==>_My_Func
;~ Иинформация о сборе сигарет в проходной
Func _My_Func4()
    Local $Response, $sMessage
    Local $Host = '109.234.155.196'
    If Not Ping($Host) Then Return -1
    Local $File = '/prison/universal.php?getAllBuildingsRewardsInfo'
    Local $URL = 'http://' & $Host & $File
    Local $PostData = "sig=f6b93aab695ecb7332184064e3058760&user="&$sUser&"&key="& $Auth &"&method=getAllBuildingsRewardsInfo"
    Local $oHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1')
    $oHTTP.Open('POST', $URL)
    $oHTTP.setTimeouts(5000, 5000, 10000, 10000)
    $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    Execute('$oHTTP.Send($PostData)')
    If (@error) Or ($oHTTP.Status <> 200) Then
        Return -1
    Else
        $oHTTP.WaitForResponse
        $Response = $oHTTP.ResponseText
        If Not $Response Then Return -1
    EndIf

	$sMessage = StringRegExpReplace($Response, '(?s).*?<money>(\d+)</money>?.*', '\1')
    If Not $sMessage Then Return -1
    Return $sMessage
EndFunc   ;==>_My_Func
;~ Иинформация о сборе рейтинга в проходной
Func _My_Func5()
    Local $Response, $sMessage
    Local $Host = '109.234.155.196'
    If Not Ping($Host) Then Return -1
    Local $File = '/prison/universal.php?getAllBuildingsRewardsInfo'
    Local $URL = 'http://' & $Host & $File
    Local $PostData = "sig=f6b93aab695ecb7332184064e3058760&user="&$sUser&"&key="& $Auth &"&method=getAllBuildingsRewardsInfo"
    Local $oHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1')
    $oHTTP.Open('POST', $URL)
    $oHTTP.setTimeouts(5000, 5000, 10000, 10000)
    $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    Execute('$oHTTP.Send($PostData)')
    If (@error) Or ($oHTTP.Status <> 200) Then
        Return -1
    Else
        $oHTTP.WaitForResponse
        $Response = $oHTTP.ResponseText
        If Not $Response Then Return -1
    EndIf

	$sMessage = StringRegExpReplace($Response, '(?s).*?<rating>(\d+)</rating>?.*', '\1')
    If Not $sMessage Then Return -1
    Return $sMessage
EndFunc   ;==>_My_Func
;~ Иинформация о сборе Уважение в проходной
Func _My_Func6()
    Local $Response, $sMessage
    Local $Host = '109.234.155.196'
    If Not Ping($Host) Then Return -1
    Local $File = '/prison/universal.php?getAllBuildingsRewardsInfo'
    Local $URL = 'http://' & $Host & $File
    Local $PostData = "sig=f6b93aab695ecb7332184064e3058760&user="&$sUser&"&key="& $Auth &"&method=getAllBuildingsRewardsInfo"
    Local $oHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1')
    $oHTTP.Open('POST', $URL)
    $oHTTP.setTimeouts(5000, 5000, 10000, 10000)
    $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    Execute('$oHTTP.Send($PostData)')
    If (@error) Or ($oHTTP.Status <> 200) Then
        Return -1
    Else
        $oHTTP.WaitForResponse
        $Response = $oHTTP.ResponseText
        If Not $Response Then Return -1
    EndIf

	$sMessage = StringRegExpReplace($Response, '(?s).*?<love>(\d+)</love>?.*', '\1')
    If Not $sMessage Then Return -1
    Return $sMessage
EndFunc   ;==>_My_Func

; Настройки пользователя
Func _SetUserInfo()
	Local $Form1,$Label1,$Label2,$Input1,$Input2,$Button1,$Button2
$Form1 = GUICreate("Настройки Братка", 358, 127, -1, -1, BitOR($GUI_SS_DEFAULT_GUI,$DS_MODALFRAME), BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
$Label1 = GUICtrlCreateLabel("ID:", 15, 25, 25, 17)
$Input1 = GUICtrlCreateInput("Введите ID Братка", 56, 25, 289, 21)
$Label2 = GUICtrlCreateLabel("Key:", 15, 60, 25, 17)
$Input2 = GUICtrlCreateInput("Введите Ключ Братка", 56, 60, 289, 21)
$Button1 = GUICtrlCreateButton("Сохранить", 265, 95, 75, 25)
$Button2 = GUICtrlCreateButton("Очистить", 185, 95, 75, 25)
GUISetState(@SW_SHOW)

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			GUIDelete($Form1)
			ExitLoop
		Case $Button1
			$sUser = IniWrite(@ScriptDir&'\settings.ini','USER','id',GUICtrlRead($Input1))
		    $Auth  = IniWrite(@ScriptDir&'\settings.ini','USER','Auth',GUICtrlRead($Input2))
			GUIDelete($Form1)
			ExitLoop
		Case $Button2
			GUICtrlSetData($Input1,'')
			GUICtrlSetData($Input2,'')
	EndSwitch
WEnd
EndFunc
Так же можно и Host внести их два использовать можно любой либо добавить
Код:
Random()
на них
 
Автор
C

CreatiK

Новичок
Сообщения
93
Репутация
4
Guezt Gutsy сказал(а):
Можно вынести сохранение ID и Key в файл вот так например:
Код:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <TreeViewConstants.au3>
#include <ButtonConstants.au3>

Opt('MustDeclareVars', 1)
Opt('TrayIconDebug', 1)

    Global  $Host,$File,$URL,$PostData,$oHTTP,$Response,$sUser,$Auth
	Global $hGUI, $Input, $Button, $nMsg, $sMoney
	Global $b1,$b2,$b3,$b4,$b5,$b6,$b7
	Global $k1,$k2,$k3,$k4,$k5,$k6,$k7
	Global $v1,$v2,$v3,$v4,$v5,$v6,$v7

if FileExists(@ScriptDir&'\settings.ini') Then
		$sUser = IniRead(@ScriptDir&'\settings.ini','USER','id','')
		$Auth  = IniRead(@ScriptDir&'\settings.ini','USER','Auth','')
	Else
		_SetUserInfo()
		$sUser = IniRead(@ScriptDir&'\settings.ini','USER','id','')
		$Auth  = IniRead(@ScriptDir&'\settings.ini','USER','Auth','')
	EndIf

_Main()



Func _Main()
	Local $dvor, $proxod, $podogrev,$money,$sigaret,$prib1,$prib2,$prib3
	Local $msg,$rating,$energy,$diamond


	GUICreate("Бот для Тюряги", 400, 379)
	GUICtrlCreatePic(@ScriptDir &"\extra\logo.jpg", 0, 0, 201, 379,$SS_BITMAP )
	GuiCtrlSetState(-1,$GUI_DISABLE)
	$dvor = GUICtrlCreateButton("Собрать папиросы во Дворе", 210, 290, 170, 20)
	$proxod = GUICtrlCreateButton("Cобрать все в Проходной", 10, 286, 145, 32, $BS_BITMAP)
	GUICtrlSetImage(-1,@ScriptDir &"\extra\prib.bmp",0)
	GUICtrlSetTip($money,"Показывает инфу о Сигаретах,Энергии и т.д.")
	GUICtrlSetCursor(-1, 0)
	$podogrev = GUICtrlCreateButton("Coбрать все Подогревы", 210, 340, 170, 20)
	$sigaret = GUICtrlCreateInput('', 10, 194, 80, 15, BitOR($ES_READONLY, $ES_CENTER))
	$energy = GUICtrlCreateInput('', 10, 218, 80, 15, BitOR($ES_READONLY, $ES_CENTER))
	$rating = GUICtrlCreateInput('', 10, 243, 80, 15, BitOR($ES_READONLY, $ES_CENTER))
	$diamond = GUICtrlCreateInput('', 10, 267, 80, 15, BitOR($ES_READONLY, $ES_CENTER))
	$prib1 = GUICtrlCreateInput('', 10, 355, 33, 15, BitOR($ES_READONLY, $ES_CENTER))
	$prib2 = GUICtrlCreateInput('', 67, 355, 33, 15, BitOR($ES_READONLY, $ES_CENTER))
	$prib3 = GUICtrlCreateInput('', 123, 355, 33, 15, BitOR($ES_READONLY, $ES_CENTER))
	$money = GUICtrlCreateButton('Получить', 50, 165, 100, 25, $BS_BITMAP)
	GUICtrlSetImage(-1,@ScriptDir &"\extra\pol.bmp",0)
	GUICtrlSetTip($money,"Показывает инфу о Сигаретах,Энергии и т.д.")
	GUICtrlSetCursor(-1, 0)


	GuiCtrlCreateTab(200, 0, 200, 260)
	GuiCtrlCreateTabItem("Бутырка")
	GUICtrlCreatePic(@ScriptDir &"\extra\logo1.gif", 200, 21, 200, 360,$SS_BITMAP )
	GuiCtrlSetState(-0,$GUI_DISABLE)
	$b1 = GuiCtrlCreateButton("Задание №1", 210, 50)
	$b2 = GuiCtrlCreateButton("Задание №2", 210, 80)
	$b3 = GuiCtrlCreateButton("Задание №3", 210, 110)
	$b4 = GuiCtrlCreateButton("Задание №4", 210, 140)
	$b5 = GuiCtrlCreateButton("Задание №5", 210, 170)
	$b6 = GuiCtrlCreateButton("Задание №6", 210, 200)
	$b7 = GuiCtrlCreateButton("Задание №7", 210, 230)
	GuiCtrlCreateTabItem("Кресты")
	GUICtrlCreatePic(@ScriptDir &"\extra\logo2.gif", 200, 21, 200, 360,$SS_BITMAP )
	GuiCtrlSetState(-1,$GUI_DISABLE)
	$k1 = GuiCtrlCreateButton("Задание №1", 210, 50)
	$k2 = GuiCtrlCreateButton("Задание №2", 210, 80)
	$k3 = GuiCtrlCreateButton("Задание №3", 210, 110)
	$k4 = GuiCtrlCreateButton("Задание №4", 210, 140)
	$k5 = GuiCtrlCreateButton("Задание №5", 210, 170)
	$k6 = GuiCtrlCreateButton("Задание №6", 210, 200)
	$k7 = GuiCtrlCreateButton("Задание №7", 210, 230)
	GuiCtrlCreateTabItem("В.Централ")
	GUICtrlCreatePic(@ScriptDir &"\extra\logo1.gif", 200, 21, 200, 360,$SS_BITMAP )
	GuiCtrlSetState(-1,$GUI_DISABLE)
	$v1 = GuiCtrlCreateButton("Задание №1", 210, 50)
	$v2 = GuiCtrlCreateButton("Задание №2", 210, 80)
	$v3 = GuiCtrlCreateButton("Задание №3", 210, 110)
	$v4 = GuiCtrlCreateButton("Задание №4", 210, 140)
	$v5 = GuiCtrlCreateButton("Задание №5", 210, 170)
	$v6 = GuiCtrlCreateButton("Задание №6", 210, 200)
	GuiCtrlSetState(-1,$GUI_DISABLE)
	GUICtrlSetTip($v6,"Скоро...")
	$v7 = GuiCtrlCreateButton("Задание №7", 210, 230)
	GuiCtrlSetState(-1,$GUI_DISABLE)
	GUICtrlSetTip($v7,"Скоро...")
	GuiCtrlCreateTabItem("")
	GUISetState(@SW_SHOW)
	TCPStartup()
	While 1
		$msg = GUIGetMsg()


		Select
			Case $msg = $GUI_EVENT_CLOSE
				ExitLoop
			Case $msg = $money
				GUISetState(@SW_DISABLE)
				GUICtrlSetData($sigaret & $rating & $diamond & $energy, '')
				$sMoney = _My_Func()
				If $sMoney <> -1 Then
					GUICtrlSetData($sigaret, $sMoney)
				Else
					GUICtrlSetData($sigaret, 'Ошибка')
				EndIf
				$sMoney = _My_Func1()
				If $sMoney <> -1 Then
					GUICtrlSetData($rating, $sMoney)
				Else
					GUICtrlSetData($rating, 'Ошибка')
				EndIf
				GUISetState(@SW_ENABLE)
				$sMoney = _My_Func2()
				If $sMoney <> -1 Then
					GUICtrlSetData($diamond, $sMoney)
				Else
					GUICtrlSetData($diamond, 'Ошибка')
				EndIf
				$sMoney = _My_Func3()
				If $sMoney <> -1 Then
					GUICtrlSetData($energy, $sMoney)
				Else
					GUICtrlSetData($energy, 'Ошибка')
				EndIf
				$sMoney = _My_Func4()
				If $sMoney <> -1 Then
					GUICtrlSetData($prib1, $sMoney)
				Else
					GUICtrlSetData($prib1, 'Ошибка')
				EndIf
				$sMoney = _My_Func5()
				If $sMoney <> -1 Then
					GUICtrlSetData($prib2, $sMoney)
				Else
					GUICtrlSetData($prib2, 'Ошибка')
				EndIf
				$sMoney = _My_Func6()
				If $sMoney <> -1 Then
					GUICtrlSetData($prib3, $sMoney)
				Else
					GUICtrlSetData($prib3, 'Ошибка')
				EndIf
				GUISetState(@SW_ENABLE)
				GUISetState(@SW_ENABLE)
			Case $msg = $b1
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "city=1&key="& $Auth &"&action%5Ftype=3&method=doCityAction&sig=838d1b18e8010910aee8df39131206b1&user="&$sUser&"&action%5Fid=1"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $b2
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "user="&$sUser&"&city=1&sig=5cdf461b8f5c359b4ca715cde7cb3275&action%5Fid=2&key="& $Auth &"&action%5Ftype=3&method=doCityAction"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $b3
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "city=1&action%5Fid=3&sig=84b2a05fc1de3218cd6d83e0d2464bca&method=doCityAction&key="& $Auth &"&user="&$sUser&"&action%5Ftype=3"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $b4
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "city=1&action%5Fid=4&sig=8d465274186e26236d5254a61c59e090&method=doCityAction&key="& $Auth &"&user="&$sUser&"&action%5Ftype=3"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $b5
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "city=1&sig=66da86540fd2fb4c67a68a52c9a56c39&key="& $Auth &"&action%5Ftype=3&action%5Fid=5&user="&$sUser&"&method=doCityAction"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $b6
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "user="&$sUser&"&city=1&action%5Fid=6&key="& $Auth &"&sig=8822eb384d135df7e93cd2eadbe5d4cc&action%5Ftype=3&method=doCityAction"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $b7
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "city=1&action%5Fid=7&action%5Ftype=3&sig=f645a1f80cd76fe8d5cc2c86745af5a4&key="& $Auth &"&user="&$sUser&"&method=doCityAction"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $k1
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "action%5Ftype=3&method=doCityAction&action%5Fid=1&key="& $Auth &"&sig=5c66cf52daeaec0dc4644c7928e54a4f&city=2&user="&$sUser&""
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $k2
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "action%5Ftype=3&method=doCityAction&action%5Fid=2&key="& $Auth &"&sig=94a6c5da1659020a1b9980e8e3929785&city=2&user="&$sUser&""
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $k3
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "action%5Ftype=3&method=doCityAction&action%5Fid=3&key="& $Auth &"&sig=e73c45ea0ea474a384da6c6d1b4041a4&city=2&user="&$sUser&""
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $k4
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "action%5Ftype=3&method=doCityAction&action%5Fid=4&key="& $Auth &"&sig=13e1599c8adf4c0737442ade663747ec&city=2&user="&$sUser&""
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $k5
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "city=2&user="&$sUser&"&action%5Fid=5&action%5Ftype=3&key="& $Auth &"&sig=ca7b8ce0708b87b98aac59b65d7be77f&method=doCityAction"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $k6
				$Host = "109.234.156.250"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "city=2&user="&$sUser&"&action%5Ftype=3&key="& $Auth &"&action%5Fid=6&sig=6b8864635b1462d3d7ea19db4db75927&method=doCityAction"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $k7

				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "city=1&action%5Fid=7&action%5Ftype=3&sig=f645a1f80cd76fe8d5cc2c86745af5a4&key="& $Auth &"&user="&$sUser&"&method=doCityAction"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $v1
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "method=doCityAction&user="&$sUser&"&key="& $Auth &"&city=3&action%5Ftype=3&sig=1069ec0e304758b43442620abc1358d3&action%5Fid=1"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $v2
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "method=doCityAction&user="&$sUser&"&key="& $Auth &"&city=3&action%5Ftype=3&sig=7f269e62e22efa131854208f42ef44e1&action%5Fid=2"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $v3
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "method=doCityAction&user="&$sUser&"&key="& $Auth &"&city=3&action%5Ftype=3&sig=c777fdc264d9b23d0c2ea9be1bc68fe5&action%5Fid=3"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $v4
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "method=doCityAction&user="&$sUser&"&key="& $Auth &"&city=3&action%5Ftype=3&sig=7e7897d923dee2a9102de232382b3d49&action%5Fid=4"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $v5
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "method=doCityAction&user="&$sUser&"&key="& $Auth &"&city=3&action%5Ftype=3&sig=537f770dac1c6f055e64a527e12bf8c2&action%5Fid=5"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $v6
				$Host = "109.234.156.250"
				$File = "/prison/universal.php?doCityAction"
				$URL = "http://" & $Host & $File
				$PostData   = "method=doCityAction&user="&$sUser&"&key="& $Auth &"&city=3&action%5Ftype=3&sig=c777fdc264d9b23d0c2ea9be1bc68fe5&action%5Fid=3"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Задание выполнено")
			Case $msg = $v7
			Case $msg = $dvor
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?office"
				$URL = "http://" & $Host & $File
				$PostData   = "sig=a2c4397152d04569f6cd2d1002db7648&key="& $Auth &"&getidea=1&user="&$sUser&"&method=office"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Бот", "Сигареты собранны")
			Case $msg = $podogrev
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?useAllPresents"
				$URL = "http://" & $Host & $File
				$PostData   = "user="&$sUser&"&key="& $Auth &"&sig=3d61df9647e743e02dd8ddc847b00f1f&method=useAllPresents"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Подогрывы собраны")
			Case $msg = $proxod
				$Host = "109.234.155.196"
				$File = "/prison/universal.php?getAllBuildingsRewards"
				$URL = "http://" & $Host & $File
				$PostData   = "key="& $Auth &"&user="&$sUser&"&sig=2092bf53b9d4e1ab2abc15e7980c0915&method=getAllBuildingsRewards"
				$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
				$oHTTP.Open("POST", $URL)
				$oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
				$oHTTP.Send($PostData)
				$oHTTP.WaitForResponse
				$Response = $oHTTP.ResponseText
				MsgBox(0, "Готово", "Подогрывы собраны")
		EndSelect
	WEnd

	GUIDelete()

	Exit
EndFunc  ;==>_Main
;~ Иинформация о сигаретах
Func _My_Func()
    Local $Response, $sMessage
    Local $Host = '109.234.156.250'
    If Not Ping($Host) Then Return -1
    Local $File = '/prison/universal.php?getInfo'
    Local $URL = 'http://' & $Host & $File
    Local $PostData = "sig=5064ea55b0c410563fe3bd4dd23cd5c8&key="& $Auth &"&user="&$sUser&"&method=getInfo"
    Local $oHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1')
    $oHTTP.Open('POST', $URL)
    $oHTTP.setTimeouts(5000, 5000, 10000, 10000)
    $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    Execute('$oHTTP.Send($PostData)')
    If (@error) Or ($oHTTP.Status <> 200) Then
        Return -1
    Else
        $oHTTP.WaitForResponse
        $Response = $oHTTP.ResponseText
        If Not $Response Then Return -1
    EndIf

    $sMessage = StringRegExpReplace($Response, '(?s).*?<money>(\d+)</money>?.*', '\1')
    If Not $sMessage Then Return -1
    Return $sMessage
EndFunc   ;==>_My_Func
;~ Иинформация о энергии
Func _My_Func1()
    Local $Response, $sMessage
    Local $Host = '109.234.155.196'
    If Not Ping($Host) Then Return -1
    Local $File = '/prison/universal.php?getInfo'
    Local $URL = 'http://' & $Host & $File
    Local $PostData = "sig=5064ea55b0c410563fe3bd4dd23cd5c8&key="& $Auth &"&user="&$sUser&"&method=getInfo"
    Local $oHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1')
    $oHTTP.Open('POST', $URL)
    $oHTTP.setTimeouts(5000, 5000, 10000, 10000)
    $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    Execute('$oHTTP.Send($PostData)')
    If (@error) Or ($oHTTP.Status <> 200) Then
        Return -1
    Else
        $oHTTP.WaitForResponse
        $Response = $oHTTP.ResponseText
        If Not $Response Then Return -1
    EndIf

	$sMessage = StringRegExpReplace($Response, '(?s).*?<energy>(\d+)</energy>?.*', '\1')
    If Not $sMessage Then Return -1
    Return $sMessage
EndFunc   ;==>_My_Func
;~ Иинформация о рублях
Func _My_Func2()
    Local $Response, $sMessage
    Local $Host = '109.234.155.196'
    If Not Ping($Host) Then Return -1
    Local $File = '/prison/universal.php?getInfo'
    Local $URL = 'http://' & $Host & $File
    Local $PostData = "sig=5064ea55b0c410563fe3bd4dd23cd5c8&key="& $Auth &"&user="&$sUser&"&method=getInfo"
    Local $oHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1')
    $oHTTP.Open('POST', $URL)
    $oHTTP.setTimeouts(5000, 5000, 10000, 10000)
    $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    Execute('$oHTTP.Send($PostData)')
    If (@error) Or ($oHTTP.Status <> 200) Then
        Return -1
    Else
        $oHTTP.WaitForResponse
        $Response = $oHTTP.ResponseText
        If Not $Response Then Return -1
    EndIf

	$sMessage = StringRegExpReplace($Response, '(?s).*?<diamond>(\d+)</diamond>?.*', '\1')
    If Not $sMessage Then Return -1
    Return $sMessage
EndFunc   ;==>_My_Func
;~ Иинформация о рейтинга
Func _My_Func3()
    Local $Response, $sMessage
    Local $Host = '109.234.155.196'
    If Not Ping($Host) Then Return -1
    Local $File = '/prison/universal.php?getInfo'
    Local $URL = 'http://' & $Host & $File
    Local $PostData = "sig=5064ea55b0c410563fe3bd4dd23cd5c8&key="& $Auth &"&user="&$sUser&"&method=getInfo"
    Local $oHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1')
    $oHTTP.Open('POST', $URL)
    $oHTTP.setTimeouts(5000, 5000, 10000, 10000)
    $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    Execute('$oHTTP.Send($PostData)')
    If (@error) Or ($oHTTP.Status <> 200) Then
        Return -1
    Else
        $oHTTP.WaitForResponse
        $Response = $oHTTP.ResponseText
        If Not $Response Then Return -1
    EndIf

	$sMessage = StringRegExpReplace($Response, '(?s).*?<rating>(\d+)</rating>?.*', '\1')
    If Not $sMessage Then Return -1
    Return $sMessage
EndFunc   ;==>_My_Func
;~ Иинформация о сборе сигарет в проходной
Func _My_Func4()
    Local $Response, $sMessage
    Local $Host = '109.234.155.196'
    If Not Ping($Host) Then Return -1
    Local $File = '/prison/universal.php?getAllBuildingsRewardsInfo'
    Local $URL = 'http://' & $Host & $File
    Local $PostData = "sig=f6b93aab695ecb7332184064e3058760&user="&$sUser&"&key="& $Auth &"&method=getAllBuildingsRewardsInfo"
    Local $oHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1')
    $oHTTP.Open('POST', $URL)
    $oHTTP.setTimeouts(5000, 5000, 10000, 10000)
    $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    Execute('$oHTTP.Send($PostData)')
    If (@error) Or ($oHTTP.Status <> 200) Then
        Return -1
    Else
        $oHTTP.WaitForResponse
        $Response = $oHTTP.ResponseText
        If Not $Response Then Return -1
    EndIf

	$sMessage = StringRegExpReplace($Response, '(?s).*?<money>(\d+)</money>?.*', '\1')
    If Not $sMessage Then Return -1
    Return $sMessage
EndFunc   ;==>_My_Func
;~ Иинформация о сборе рейтинга в проходной
Func _My_Func5()
    Local $Response, $sMessage
    Local $Host = '109.234.155.196'
    If Not Ping($Host) Then Return -1
    Local $File = '/prison/universal.php?getAllBuildingsRewardsInfo'
    Local $URL = 'http://' & $Host & $File
    Local $PostData = "sig=f6b93aab695ecb7332184064e3058760&user="&$sUser&"&key="& $Auth &"&method=getAllBuildingsRewardsInfo"
    Local $oHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1')
    $oHTTP.Open('POST', $URL)
    $oHTTP.setTimeouts(5000, 5000, 10000, 10000)
    $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    Execute('$oHTTP.Send($PostData)')
    If (@error) Or ($oHTTP.Status <> 200) Then
        Return -1
    Else
        $oHTTP.WaitForResponse
        $Response = $oHTTP.ResponseText
        If Not $Response Then Return -1
    EndIf

	$sMessage = StringRegExpReplace($Response, '(?s).*?<rating>(\d+)</rating>?.*', '\1')
    If Not $sMessage Then Return -1
    Return $sMessage
EndFunc   ;==>_My_Func
;~ Иинформация о сборе Уважение в проходной
Func _My_Func6()
    Local $Response, $sMessage
    Local $Host = '109.234.155.196'
    If Not Ping($Host) Then Return -1
    Local $File = '/prison/universal.php?getAllBuildingsRewardsInfo'
    Local $URL = 'http://' & $Host & $File
    Local $PostData = "sig=f6b93aab695ecb7332184064e3058760&user="&$sUser&"&key="& $Auth &"&method=getAllBuildingsRewardsInfo"
    Local $oHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1')
    $oHTTP.Open('POST', $URL)
    $oHTTP.setTimeouts(5000, 5000, 10000, 10000)
    $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    Execute('$oHTTP.Send($PostData)')
    If (@error) Or ($oHTTP.Status <> 200) Then
        Return -1
    Else
        $oHTTP.WaitForResponse
        $Response = $oHTTP.ResponseText
        If Not $Response Then Return -1
    EndIf

	$sMessage = StringRegExpReplace($Response, '(?s).*?<love>(\d+)</love>?.*', '\1')
    If Not $sMessage Then Return -1
    Return $sMessage
EndFunc   ;==>_My_Func

; Настройки пользователя
Func _SetUserInfo()
	Local $Form1,$Label1,$Label2,$Input1,$Input2,$Button1,$Button2
$Form1 = GUICreate("Настройки Братка", 358, 127, -1, -1, BitOR($GUI_SS_DEFAULT_GUI,$DS_MODALFRAME), BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
$Label1 = GUICtrlCreateLabel("ID:", 15, 25, 25, 17)
$Input1 = GUICtrlCreateInput("Введите ID Братка", 56, 25, 289, 21)
$Label2 = GUICtrlCreateLabel("Key:", 15, 60, 25, 17)
$Input2 = GUICtrlCreateInput("Введите Ключ Братка", 56, 60, 289, 21)
$Button1 = GUICtrlCreateButton("Сохранить", 265, 95, 75, 25)
$Button2 = GUICtrlCreateButton("Очистить", 185, 95, 75, 25)
GUISetState(@SW_SHOW)

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			GUIDelete($Form1)
			ExitLoop
		Case $Button1
			$sUser = IniWrite(@ScriptDir&'\settings.ini','USER','id',GUICtrlRead($Input1))
		    $Auth  = IniWrite(@ScriptDir&'\settings.ini','USER','Auth',GUICtrlRead($Input2))
			GUIDelete($Form1)
			ExitLoop
		Case $Button2
			GUICtrlSetData($Input1,'')
			GUICtrlSetData($Input2,'')
	EndSwitch
WEnd
EndFunc
Так же можно и Host внести их два использовать можно любой либо добавить
Код:
Random()
на них



Этот код уже подправил?
 

Guezt

Продвинутый
Сообщения
335
Репутация
82
подправил?! непонял о чем ты, и да, я просто добавил функцию ввода данных о пользователе если запуск идет первый раз, при вводе сохраняются в файл ID и authkey.
p.s. Чем снимал запросы Charles ?
 

Guezt

Продвинутый
Сообщения
335
Репутация
82
Умное хождение за сигами можно реализовать из полученных данных о сигаретах во дворе. В твоем коде много запросов из-за того что ты для каждого параметра делаешь новый запрос когда достаточно сделать по одному запросу посмотри пример получения данных:
Код:
#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.6.1
 Author:
 Script Function: for prison

#ce ----------------------------------------------------------------------------
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <TreeViewConstants.au3>
#include <ButtonConstants.au3>
#include <File.au3>

Opt("TrayMenuMode", 1)

Global $URL,$IP_1,$IP_2,$User,$Auth

Global $Host = 'http://109.234.156.250'
Global $GetUserInfo = $Host&'/prison/universal.php?getInfo' ; информация игрока
Global $GetUserInfoRewards =$Host&'/prison/universal.php?getAllBuildingsRewardsInfo' ; информация о прибыли
Global $GetInfoCigaret = $Host&'/prison/universal.php?office' ; информация о Дворе
Global $oHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1')


if FileExists(@ScriptDir&'\settings.ini') Then
		$User = IniRead(@ScriptDir&'\settings.ini','USER','id','')
		$Auth  = IniRead(@ScriptDir&'\settings.ini','USER','Auth','')
	Else
		_SetUserInfo()
		$User = IniRead(@ScriptDir&'\settings.ini','USER','id','')
		$Auth  = IniRead(@ScriptDir&'\settings.ini','USER','Auth','')
EndIf


$info = TrayCreateItem('Информация')
TrayCreateItem("")
$exititem = TrayCreateItem("Выход")
TraySetState()
TraySetToolTip("Bot Тюряга")
While 1
	$msg = TrayGetMsg();
	Select
		Case $msg = 0
			ContinueLoop
		Case $msg = $info
			TrayItemSetState($info,4)
			TraySetState(2)
			_GetUserInfo()
			TraySetState()
		Case $msg = $exititem
				_Exit()
    EndSelect
WEnd


Func _GetUserInfo()
	Local $Response,$Response2
    Local $PostData = 'user='&$User&'&sig=2580efe69fd4066d670a3b4f5d3b8f14&key='&$Auth&'&method=getInfo' ; запрос на данные пользователя
    $oHTTP.Open('POST', $GetUserInfo)
    $oHTTP.setTimeouts(5000, 5000, 10000, 10000)
    $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    Execute('$oHTTP.Send($PostData)')
    If (@error) Or ($oHTTP.Status <> 200) Then
        Return
    Else
        $oHTTP.WaitForResponse
        $Response = $oHTTP.ResponseText
        If Not $Response Then Return
	EndIf
	$PostData2 = 'user='&$User&'&sig=9657510905665054df4c085a1b359445&key='&$Auth&'&method=getAllBuildingsRewardsInfo' ; запрос на проходную
	$oHTTP.Open('POST', $GetUserInfoRewards)
	$oHTTP.setTimeouts(5000, 5000, 10000, 10000)
    $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
	$oHTTP.Send($PostData2)
	$oHTTP.WaitForResponse
	$Response2 = $oHTTP.ResponseText

	$PostData3 = 'user='&$User&'&sig=f86236c0b49d7ed28dd0d5d0efc915a1&key='&$Auth&'&method=office' ; запрос информации о сигаретах
	$oHTTP.Open('POST', $GetInfoCigaret)
	$oHTTP.setTimeouts(5000, 5000, 10000, 10000)
    $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
	$oHTTP.Send($PostData3)
	$oHTTP.WaitForResponse
	$Response3 = $oHTTP.ResponseText

	MsgBox(0,'Информация', ' Авторитет: '&StringRegExpReplace($Response, '(?s).*?<rating>(\d+)</rating>?.*', '\1')& _
					 '   Энергия: '&StringRegExpReplace($Response, '(?s).*?<energy>(\d+)</energy>?.*', '\1') & _
	                 '   Сигарет: '&StringRegExpReplace($Response, '(?s).*?<money>(\d+)</money>?.*', '\1') & _
					 '   Рубли: '&StringRegExpReplace($Response, '(?s).*?<diamond>(\d+)</diamond>?.*', '\1')&@CRLF&@CRLF& _
					 'Общая прибыль:' &@CRLF& _
					 'Авторитет +'&StringRegExpReplace($Response2, '(?s).*?<rating>(\d+)</rating>?.*', '\1')& _
					 '   Уважение +'&StringRegExpReplace($Response2, '(?s).*?<love>(\d+)</love>?.*', '\1') & _
	                 '   Сигарет +'&StringRegExpReplace($Response2, '(?s).*?<money>(\d+)</money>?.*', '\1') &@CRLF&@CRLF& _
					 'Сигареты во дворе:' &@CRLF& _
					 (StringRegExpReplace($Response3, '(?s).*?<ideascount>(\d+)</ideascount>?.*', '\1')*5)&' Сигарет (сбор за один раз 5 сигарет)')

    ;Return $sMessage
EndFunc




; Установки о пользователе
Func _SetUserInfo()
	Local $Form1,$Label1,$Label2,$Input1,$Input2,$Button1,$Button2
$Form1 = GUICreate("Настройки Братка", 358, 127, -1, -1, BitOR($GUI_SS_DEFAULT_GUI,$DS_MODALFRAME), BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
$Label1 = GUICtrlCreateLabel("ID:", 15, 25, 25, 17)
$Input1 = GUICtrlCreateInput("Введите ID Братка", 56, 25, 289, 21)
$Label2 = GUICtrlCreateLabel("Key:", 15, 60, 25, 17)
$Input2 = GUICtrlCreateInput("Введите Ключ Братка", 56, 60, 289, 21)
$Button1 = GUICtrlCreateButton("Сохранить", 265, 95, 75, 25)
$Button2 = GUICtrlCreateButton("Очистить", 185, 95, 75, 25)
GUISetState(@SW_SHOW)

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			GUIDelete($Form1)
			ExitLoop
		Case $Button1
			$User = IniWrite(@ScriptDir&'\settings.ini','USER','id',GUICtrlRead($Input1))
		    $Auth  = IniWrite(@ScriptDir&'\settings.ini','USER','Auth',GUICtrlRead($Input2))
			GUIDelete($Form1)
			ExitLoop
		Case $Button2
			GUICtrlSetData($Input1,'')
			GUICtrlSetData($Input2,'')
	EndSwitch
WEnd
EndFunc

Func _Exit()
	Exit
EndFunc


Добавлено:
Сообщение автоматически объединено:

и еще непонятно, что ты хочешь сохранять? в смысле какие настройки, кроме пользователя и ключа?
 

vcomp71

Осваивающий
Сообщения
431
Репутация
25
А ключ пользователя вы где берете?
 
Верх