Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; AutoIt Wrapper Directives
- #Region
- #AutoIt3Wrapper_Res_Comment=Made by The Unintelligible
- #AutoIt3Wrapper_Res_Description=Gaia Online Ignore Check
- #AutoIt3Wrapper_UseUpx=n
- #EndRegion
- ; Includes
- #include <ButtonConstants.au3>
- #include <EditConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <StaticConstants.au3>
- #include <WindowsConstants.au3>
- #include <String.au3>
- ; Variable declarations
- Global Const $SOH = Chr(01), $ENQ = Chr(05) ; SOH/ENQ for web requests
- Global $oWinHTTP = ObjCreate("winhttp.winhttprequest.5.1") ; Creating our default winhttp COM object
- Global $sUsername, $sPassword
- ; Functions
- Func _HTTPRequest(ByRef $oWinHTTP, $sMethod, $sURL, $sData = "")
- $oWinHTTP.Open($sMethod, $sURL, False)
- $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")
- If $sMethod == "POST" Then $oWinHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
- $oWinHTTP.Send($sData)
- Return $oWinHTTP.ResponseText
- EndFunc
- Func _Login(ByRef $oWinHTTP, $sUsername, $sPassword)
- Local $sSource, $aInputs, $sResponse, $sSID
- Local $sPostData = "username=" & $sUsername & "&password=" & $sPassword & "&"
- Local $aTemporary_1, $aTemporary_2
- Dim $aReturn[2]
- $sSource = _HTTPRequest($oWinHTTP, "GET", "http://www.gaiaonline.com/")
- $aInputs = StringRegExp($sSource, '<input([^>]+)>', 3)
- For $i = 3 to UBound($aInputs) - 1
- $aTemporary_1 = _StringBetween($aInputs[$i], 'name="', '"')
- $aTemporary_2 = _StringBetween(StringReplace($aInputs[$i], "data-value", ""), 'value="', '"')
- $sPostData &= $aTemporary_1[0] & "=" & $aTemporary_2[0] & "&"
- Next
- $sPostData = StringLeft($sPostData, StringLen($sPostData) - 1)
- _HTTPRequest($oWinHTTP, "POST", "http://www.gaiaonline.com/auth/login/", $sPostData)
- $sResponse = _HTTPRequest($oWinHTTP, "GET", "http://www.gaiaonline.com/chat/gsi/index.php?m=109")
- $sSID = StringReplace($sResponse, "109" & $SOH & $ENQ & $SOH, "")
- $aReturn[0] = (StringInStr($sResponse, "User not authenticated") <> True)
- $aReturn[1] = $sSID
- Return $aReturn
- EndFunc
- Func _IsIgnored($sUsername)
- Local $iProfileID = StringReplace(_HTTPRequest($oWinHTTP, "GET", "http://gaiaonline.com/chat/gsi/index.php?m=121" & $SOH & $sUsername), _
- "121" & $SOH & $ENQ & $SOH, "") ; Parse GSI request response that contains your profile ID of the given user
- Local $sResponse = _HTTPRequest($oWinHTTP, "GET", "http://www.gaiaonline.com/friends/add/" & $iProfileID & "?_gaia_t_=724&view=ajax")
- If StringInStr($sResponse, "Oof! Rejected!") Then Return True
- EndFunc
- ; GUI/functionality
- Func Main()
- Local $hForm = GUICreate("Gaia Ignore Checker", 373, 75, 291, 206)
- Local $hInput = GUICtrlCreateInput("Enter username of person you want to evaluate...", 16, 16, 265, 21, -1, BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE))
- Local $hBtn = GUICtrlCreateButton("&Go!", 288, 16, 75, 17)
- Local $hLabel = GUICtrlCreateLabel("Made by The Unintelligible @ Logical Gamers", 152, 56, 219, 17, -1, $GUI_WS_EX_PARENTDRAG)
- GUICtrlSetFont(-1, 8, 400, 4, "MS Sans Serif")
- GUICtrlSetColor(-1, 0x0000FF)
- GUICtrlSetCursor(-1, 0)
- GUICtrlCreateGroup("", 8, 0, 361, 49)
- GUISetState()
- ; Event loop
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- Case $hBtn
- If _IsIgnored(GUICtrlRead($hInput)) Then
- MsgBox(0, "Result", "Yes, unfortunately you are ignored by this user.")
- Else
- MsgBox(0, "Result", "It's your lucky day! You are not ignored by this user.")
- EndIf
- Case $hLabel
- ShellExecute("http://logicalgamers.com") ; Obviously launch LG in another tab
- EndSwitch
- WEnd
- EndFunc
- ; Main
- While True
- ; Loop valid information is given; breakpoint is if the Input box is exited
- $sUsername = InputBox("Enter your username", "Enter your gaia online username in the input below to sign in", "")
- $sPassword = InputBox("Enter your password", "Enter your gaia online password in the input below to sign in", "password", '*')
- $aResponse = _Login($oWinHTTP, $sUsername, $sPassword)
- If $aResponse[0] Then
- MsgBox(0, "Success", "Your information is valid! You have been signed in.")
- ExitLoop
- Else
- MsgBox(16, "Error", "Invalid information specified! Please enter your correct user info then try again.")
- EndIf
- If $sPassword == "" Then Exit
- WEnd
- Main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement