Jump to content

Gah


Recommended Posts

I'm getting aggravated.

I'm in the process of upgrading my current script to allow the feature of running minimized.

Well , the button I'm needing to click... ( This is a IE automation script )... Well the button doesn't have a "ID" , and I'm not sure that you can use what Ive been using to do this.

Here's my script , and my functions script.

Note: The main point of this is the _Banking() function.

Main Script:

#include <IE.au3>
 #include <Mobsters.au3>
Global $oIE
    If WinExists( "MySpace -") Then
    $oIE = _IEAttach("MySpace")
;~  WinActivate( "MySpace -")
    WinSetState("", "", @SW_MAXIMIZE)
Else
    $oIE = _IECreate ("www.myspace.com", 1)
    WinSetState("", "", @SW_MAXIMIZE)
EndIf
_Banking()

Functions:

;Random Info
;===================
;Banking Tab: 271, 245
;Main Tab: 390, 206
;Missions Tab: 159, 244
;Territory Tab: 231, 246
;Fight Tab: 413, 244
;Refresh tab: 807, 207
;Deposit Button: 579, 377
;===================

Func _Opener()
    If WinExists( "MySpace -") Then
    $oIE = _IEAttach("MySpace")
;~  WinActivate( "MySpace -")
    WinSetState("", "", @SW_MAXIMIZE)
Else
    $oIE = _IECreate ("www.myspace.com", 1)
    WinSetState("", "", @SW_MAXIMIZE)
EndIf
EndFunc
Func _Banking()
;~ WinActivate( "MySpace - Windows Internet Explorer")
MouseClick( "left", 271, 245, 1, 0)
$sMyString = "REFRESH"
    $oLinks = _IELinkGetCollection($oIE)
    For $oLink In $oLinks
        $sLinkText = _IEPropertyGet($oLink, "innerText")
        If StringInStr($sLinkText, $sMyString) Then
            _IEAction($oLink, "click")
            ExitLoop
        EndIf
    Next
    _IELoadWait($oIE)
;~  MouseClick( "left", 807, 207, 1, 0)
    _IELoadWait($oIE)
    Sleep( 1000 )
    $DepositClick = PixelSearch( 515, 348, 632, 413, 0x39599C)
    If @Error = 1 Then
        Sleep( 1000 )
    Else
        MouseClick( "left", 579, 377, 1, 0)
    EndIf
EndFunc
Func _ClickMobsters()
    $sMyString = "Mobsters"
    $oLinks = _IELinkGetCollection($oIE)
    For $oLink In $oLinks
        $sLinkText = _IEPropertyGet($oLink, "innerText")
        If StringInStr($sLinkText, $sMyString) Then
            _IEAction($oLink, "click")
            ExitLoop
        EndIf
    Next
_IELoadWait($oIE)
EndFunc  ;==>_ClickMobsters
Func _AutoLogin()
;Attempt to auto-login
    $EmailBox = PixelSearch(767, 521, 826, 569, 0xFFFFFF)
    MouseClick("left", $EmailBox[0], $EmailBox[1], 2)
    $Email = IniRead(@ScriptDir & "\Config.ini", "Config", "Email", "Default")
    $Password = IniRead(@ScriptDir & "\Config.ini", "Config", "Password", "Default")
    Send($Email)
    Send("{TAB}")
    Sleep(100)
    Send($Password)
    Sleep(100)
    Send("{ENTER}")
    _IELoadWait($oIE)
EndFunc  ;==>_AutoLogin
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...