Advertisement
Guest User

Hater Checker

a guest
Feb 22nd, 2014
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 4.37 KB | None | 0 0
  1. ; AutoIt Wrapper Directives
  2. #Region
  3. #AutoIt3Wrapper_Res_Comment=Made by The Unintelligible
  4. #AutoIt3Wrapper_Res_Description=Gaia Online Ignore Check
  5. #AutoIt3Wrapper_UseUpx=n
  6. #EndRegion
  7.  
  8. ; Includes
  9. #include <ButtonConstants.au3>
  10. #include <EditConstants.au3>
  11. #include <GUIConstantsEx.au3>
  12. #include <StaticConstants.au3>
  13. #include <WindowsConstants.au3>
  14. #include <String.au3>
  15.  
  16. ; Variable declarations
  17. Global Const $SOH = Chr(01), $ENQ = Chr(05) ; SOH/ENQ for web requests
  18.  
  19. Global $oWinHTTP = ObjCreate("winhttp.winhttprequest.5.1") ; Creating our default winhttp COM object
  20. Global $sUsername, $sPassword
  21.  
  22. ; Functions
  23. Func _HTTPRequest(ByRef $oWinHTTP, $sMethod, $sURL, $sData = "")
  24.    $oWinHTTP.Open($sMethod, $sURL, False)
  25.    $oWinHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5")
  26.    If $sMethod == "POST" Then $oWinHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
  27.    $oWinHTTP.Send($sData)
  28.    Return $oWinHTTP.ResponseText
  29. EndFunc
  30.  
  31. Func _Login(ByRef $oWinHTTP, $sUsername, $sPassword)
  32.    Local $sSource, $aInputs, $sResponse, $sSID
  33.    Local $sPostData = "username=" & $sUsername & "&password=" & $sPassword & "&"
  34.    Local $aTemporary_1, $aTemporary_2
  35.  
  36.    Dim $aReturn[2]
  37.  
  38.    $sSource = _HTTPRequest($oWinHTTP, "GET", "http://www.gaiaonline.com/")
  39.    $aInputs = StringRegExp($sSource, '<input([^>]+)>', 3)
  40.  
  41.    For $i = 3 to UBound($aInputs) - 1
  42.       $aTemporary_1 = _StringBetween($aInputs[$i], 'name="', '"')
  43.       $aTemporary_2 = _StringBetween(StringReplace($aInputs[$i], "data-value", ""), 'value="', '"')
  44.       $sPostData &= $aTemporary_1[0] & "=" & $aTemporary_2[0] & "&"
  45.    Next
  46.  
  47.    $sPostData = StringLeft($sPostData, StringLen($sPostData) - 1)
  48.  
  49.    _HTTPRequest($oWinHTTP, "POST", "http://www.gaiaonline.com/auth/login/", $sPostData)
  50.  
  51.    $sResponse = _HTTPRequest($oWinHTTP, "GET", "http://www.gaiaonline.com/chat/gsi/index.php?m=109")
  52.    $sSID = StringReplace($sResponse, "109" & $SOH & $ENQ & $SOH, "")
  53.  
  54.    $aReturn[0] = (StringInStr($sResponse, "User not authenticated") <> True)
  55.    $aReturn[1] = $sSID
  56.  
  57.    Return $aReturn
  58. EndFunc
  59.  
  60. Func _IsIgnored($sUsername)
  61.     Local $iProfileID = StringReplace(_HTTPRequest($oWinHTTP, "GET", "http://gaiaonline.com/chat/gsi/index.php?m=121" & $SOH & $sUsername), _
  62.         "121" & $SOH & $ENQ & $SOH, "") ; Parse GSI request response that contains your profile ID of the given user
  63.  
  64.     Local $sResponse = _HTTPRequest($oWinHTTP, "GET", "http://www.gaiaonline.com/friends/add/" & $iProfileID & "?_gaia_t_=724&view=ajax")
  65.  
  66.     If StringInStr($sResponse, "Oof! Rejected!") Then Return True
  67. EndFunc
  68.  
  69. ; GUI/functionality
  70. Func Main()
  71.     Local $hForm = GUICreate("Gaia Ignore Checker", 373, 75, 291, 206)
  72.     Local $hInput = GUICtrlCreateInput("Enter username of person you want to evaluate...", 16, 16, 265, 21, -1, BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE))
  73.     Local $hBtn = GUICtrlCreateButton("&Go!", 288, 16, 75, 17)
  74.     Local $hLabel = GUICtrlCreateLabel("Made by The Unintelligible @ Logical Gamers", 152, 56, 219, 17, -1, $GUI_WS_EX_PARENTDRAG)
  75.  
  76.     GUICtrlSetFont(-1, 8, 400, 4, "MS Sans Serif")
  77.     GUICtrlSetColor(-1, 0x0000FF)
  78.     GUICtrlSetCursor(-1, 0)
  79.     GUICtrlCreateGroup("", 8, 0, 361, 49)
  80.     GUISetState()
  81.  
  82.     ; Event loop
  83.     While 1
  84.         $nMsg = GUIGetMsg()
  85.         Switch $nMsg
  86.             Case $GUI_EVENT_CLOSE
  87.                 Exit
  88.             Case $hBtn
  89.                 If _IsIgnored(GUICtrlRead($hInput)) Then
  90.                     MsgBox(0, "Result", "Yes, unfortunately you are ignored by this user.")
  91.                 Else
  92.                     MsgBox(0, "Result", "It's your lucky day! You are not ignored by this user.")
  93.                 EndIf
  94.             Case $hLabel
  95.                 ShellExecute("http://logicalgamers.com") ; Obviously launch LG in another tab
  96.         EndSwitch
  97.     WEnd
  98. EndFunc
  99.  
  100. ; Main
  101. While True
  102.     ; Loop valid information is given; breakpoint is if the Input box is exited
  103.     $sUsername = InputBox("Enter your username", "Enter your gaia online username in the input below to sign in", "")
  104.     $sPassword = InputBox("Enter your password", "Enter your gaia online password in the input below to sign in", "password", '*')
  105.  
  106.     $aResponse = _Login($oWinHTTP, $sUsername, $sPassword)
  107.  
  108.     If $aResponse[0] Then
  109.         MsgBox(0, "Success", "Your information is valid! You have been signed in.")
  110.         ExitLoop
  111.     Else
  112.         MsgBox(16, "Error", "Invalid information specified! Please enter your correct user info then try again.")
  113.     EndIf
  114.  
  115.     If $sPassword == "" Then Exit
  116. WEnd
  117.  
  118. Main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement