Что нового

Бот для тюряги в контакте 2

CreatiK

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


Код:
#NoTrayIcon
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TreeViewConstants.au3>
#include <ButtonConstants.au3>
;

Opt("GUIOnEventMode", 1)
Global  $Host,$File,$URL,$PostData,$oHTTP,$Response,$sUser,$Auth
$sINI = @ScriptDir & '\config.ini'
$Auth = IniRead($sINI, "Config", "Auth", "")
$sUser = IniRead($sINI, "Config", "id", "")

Dim $s_TempFile
$bmp = _TempFile()

FileInstall("gui2.bmp", $bmp)

$gui = GUICreate("Main GUI", 591, 287, -1, -1, $WS_POPUP + $WS_SYSMENU + $WS_MINIMIZEBOX, $WS_EX_LAYERED)
GUISetOnEvent($GUI_EVENT_CLOSE, "Close")


$min = GUICtrlCreateLabel("", 566, 35, 24, 24)
GUICtrlSetOnEvent($min, "Minimize")
GUICtrlSetTip($min, "Свернуть")

;GUICtrlSetStyle($min, -1, $WS_EX_TRANSPARENT) ; To select $min
;GUICtrlSetBkColor($min,0xFF00FF) ; To select $min

$close = GUICtrlCreateLabel("", 566, 6, 24, 24)
GUICtrlSetOnEvent($close, "Close")
GUICtrlSetTip($close, "Закрыть")

;GUICtrlSetStyle($close, -1, $WS_EX_TRANSPARENT) ; To select $close
;GUICtrlSetBkColor($close,0xFF00FF) ; To select $close

$a1 = GUICtrlCreateLabel("", 410, 13, 135, 80)
GUICtrlSetOnEvent($a1, "Atak1")
GUICtrlSetTip($a1, "Атаковать")

$a2 = GUICtrlCreateLabel("", 410, 107, 135, 80)
GUICtrlSetOnEvent($a2, "Atak2")
GUICtrlSetTip($a2, "Атаковать")

$a3 = GUICtrlCreateLabel("", 410, 197, 135, 80)
GUICtrlSetOnEvent($a3, "Atak3")
GUICtrlSetTip($a3, "Атаковать")

$a4 = GUICtrlCreateLabel("", 260, 13, 135, 80)
GUICtrlSetOnEvent($a4, "Atak4")
GUICtrlSetTip($a4, "Атаковать")

$a5 = GUICtrlCreateLabel("", 260, 107, 135, 80)
GUICtrlSetOnEvent($a5, "Atak5")
GUICtrlSetTip($a5, "Атаковать")

$a6 = GUICtrlCreateLabel("", 260, 197, 135, 80)
GUICtrlSetOnEvent($a6, "Atak6")
GUICtrlSetTip($a6, "Атаковать")

$btn = GUICtrlCreateButton("Начать бой", 40, 220, 100, 20)
GUICtrlSetStyle($btn, -1, $WS_EX_TRANSPARENT)
GUICtrlSetOnEvent($btn, "Btn")
$zdorov = GUICtrlCreateInput('', 30, 180, 120, 24, BitOR($ES_READONLY, $ES_CENTER))
GUICtrlSetStyle($zdorov, -1, $WS_EX_TRANSPARENT)
$pic = GUICtrlCreatePic($bmp, 0, 0, 591, 287)
GUICtrlSetOnEvent($pic, "_Drag")

GUISetState(@SW_SHOW)

While 1
	Sleep(1000)
	$msg = GUIGetMsg()
	Select
		Case $msg = $btn
			$sMoney = Btn()
			GUISetState(@SW_DISABLE)
			If $sMoney <> -1 Then
				GUICtrlSetData($zdorov, $sMoney)
			Else
				GUICtrlSetData($zdorov, 'Ошибка')
			EndIf
			GUISetState(@SW_ENABLE)
	EndSelect
WEnd

Func Btn()

	Local $Response, $sMessage
    Local $Host = '109.234.156.250'
    If Not Ping($Host) Then Return -1
    Local $File = '/prison/universal.php?getBoss'
    Local $URL = 'http://' & $Host & $File
    Local $PostData = "user="$sUser"&key="$Auth"&sig=0bd61f2d3ca24d1b933324d21cdfe124&method=getBoss"
    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).*?<h_now>(\d+)</h_now>?.*', '\1')
    If Not $sMessage Then Return -1
    Return $sMessage
	
	Local $Response, $sMessage
    Local $Host = '109.234.155.196'
    If Not Ping($Host) Then Return -1
    Local $File = '/prison/universal.php?getBoss'
    Local $URL = 'http://' & $Host & $File
    Local $PostData = "user="$sUser"&key="$Auth"&sig=0bd61f2d3ca24d1b933324d21cdfe124&method=getBoss"
    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).*?<h_now>(\d+)</h_now>?.*', '\1')
    If Not $sMessage Then Return -1
    Return $sMessage
EndFunc

Func Close()
	GUISetState(@SW_HIDE)
	FileDelete($bmp)
	Exit
EndFunc

Func Minimize()
	GUISetState(@SW_MINIMIZE)
EndFunc

Func _TempFile()
	Local $s_TempName
	
	Do
		$s_TempName = "~"
		While StringLen($s_TempName) < 7
			$s_TempName = $s_TempName & Chr(Round(Random(65, 90), 0))
		WEnd
		$s_TempName = @TempDir & "\" & $s_TempName & ".tmp"
	Until Not FileExists($s_TempName)
	Return ($s_TempName)
EndFunc

Func _Drag()
	DllCall("user32.dll", "int", "ReleaseCapture")
	DllCall("user32.dll", "int", "SendMessage", "hWnd", $gui, "int", 0xA1, "int", 2, "int", 0)
EndFunc
Func Atak1()
	$Host = "109.234.155.196"
	$File = "/prison/universal.php?hitBoss"
	$URL = "http://" & $Host & $File
	$PostData = "method=hitBoss&key="$Auth"&sig=af93f191e1f6272ea56f86bb51114389&boss%5Fid=1&spell%5Fid=1&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
	
	$Host = "109.234.156.250"
	$File = "/prison/universal.php?hitBoss"
	$URL = "http://" & $Host & $File
	$PostData = "method=hitBoss&key="$Auth"&sig=af93f191e1f6272ea56f86bb51114389&boss%5Fid=1&spell%5Fid=1&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
EndFunc
Func Atak2()
	$Host = "109.234.155.196"
	$File = "/prison/universal.php?hitBoss"
	$URL = "http://" & $Host & $File
	$PostData = "method=hitBoss&key="$Auth"&sig=af93f191e1f6272ea56f86bb51114389&boss%5Fid=1&spell%5Fid=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
	
	$Host = "109.234.156.250"
	$File = "/prison/universal.php?hitBoss"
	$URL = "http://" & $Host & $File
	$PostData = "method=hitBoss&key="$Auth"&sig=af93f191e1f6272ea56f86bb51114389&boss%5Fid=1&spell%5Fid=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
EndFunc

Func Atak3()
	$Host = "109.234.155.196"
	$File = "/prison/universal.php?hitBoss"
	$URL = "http://" & $Host & $File
	$PostData = "method=hitBoss&key="$Auth"&sig=af93f191e1f6272ea56f86bb51114389&boss%5Fid=1&spell%5Fid=3&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
	
	$Host = "109.234.156.250"
	$File = "/prison/universal.php?hitBoss"
	$URL = "http://" & $Host & $File
	$PostData = "method=hitBoss&key="$Auth"&sig=af93f191e1f6272ea56f86bb51114389&boss%5Fid=1&spell%5Fid=3&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
EndFunc

Func Atak4()
	$Host = "109.234.155.196"
	$File = "/prison/universal.php?hitBoss"
	$URL = "http://" & $Host & $File
	$PostData = "method=hitBoss&boss%5Fid=1&key="$Auth"&sig=b77a16007a0e8a09ed2d6c272d73844a&user="$sUser"&spell%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
	
	$Host = "109.234.156.250"
	$File = "/prison/universal.php?hitBoss"
	$URL = "http://" & $Host & $File
	$PostData = "method=hitBoss&boss%5Fid=1&key="$Auth"&sig=b77a16007a0e8a09ed2d6c272d73844a&user="$sUser"&spell%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
EndFunc

Func Atak5()
	$Host = "109.234.155.196"
	$File = "/prison/universal.php?hitBoss"
	$URL = "http://" & $Host & $File
	$PostData = "method=hitBoss&boss%5Fid=1&key="$Auth"&sig=e626d1e0e37d77438b8312ea62129d5d&user="$sUser"&spell%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

	$Host = "109.234.156.250"
	$File = "/prison/universal.php?hitBoss"
	$URL = "http://" & $Host & $File
	$PostData = "method=hitBoss&boss%5Fid=1&key="$Auth"&sig=e626d1e0e37d77438b8312ea62129d5d&user="$sUser"&spell%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
EndFunc

Func Atak6()
	$Host = "109.234.155.196"
	$File = "/prison/universal.php?hitBoss"
	$URL = "http://" & $Host & $File
	$PostData = "method=hitBoss&boss%5Fid=1&key="$Auth"&sig=e6061c37bc17b71e5fbdf52ba6a10f65&user="$sUser"&spell%5Fid=6"
	$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

	$Host = "109.234.156.250"
	$File = "/prison/universal.php?hitBoss"
	$URL = "http://" & $Host & $File
	$PostData = "method=hitBoss&boss%5Fid=1&key="$Auth"&sig=e6061c37bc17b71e5fbdf52ba6a10f65&user="$sUser"&spell%5Fid=6"
	$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
EndFunc
 

Garrett

Модератор
Локальный модератор
Сообщения
3 999
Репутация
964
Код:
Local $PostData = "user="$sUser"&key="$Auth"&sig=0bd61f2d3ca24d1b933324d21cdfe124&method=getBoss"

To:
Код:
Local $PostData = "user=" & $sUser & "&key=" & $Auth & "&sig=0bd61f2d3ca24d1b933324d21cdfe124&method=getBoss"
 
Верх