Sign in to follow this  
Followers 0
Wesloth

Problem with _IE and autologin

4 posts in this topic

#1 ·  Posted (edited)

Well, i wrote a function to login in the browsergame www.ogame.de

Func Login($universe,$user,$pass)
    If $universe="Universum auswählen" Then
        MsgBox(0,"OBot","Universum auswählen!")
        Return 0
    EndIf
    $universe = Int($universe)
    Local $oIE = _IECreate("Ogame.de")
    Local $oHWND = _IEPropertyGet($oIE, "hwnd")
    WinSetState ($oHWND, "", @SW_MAXIMIZE )
    Local $oFrameMain   = _IEFrameGetObjByName ($oIE, "mainframe")
    Local $oForm        = _IEFormGetObjByName($oFrameMain,"loginForm")
    Local $oElement_1   = _IEFormElementGetObjByName($oForm,"login")
    Local $oElement_2   = _IEFormElementGetObjByName($oForm,"pass")
    Local $oElement_3   = _IEFormElementGetObjByName($oForm,"universe")
    _IEFormElementSetValue($oElement_1,$user)
    _IEFormElementSetValue($oElement_2,$pass)
    _IEFormElementSetValue($oElement_3,"uni" & $universe & ".ogame.de")
    _IEFormImageClick($oFrameMain,'button','name')
EndFunc

Till this point all works fine.

But now i am in the game and i want to click a link named "Technik".

So i thought _IELinkClickByText($oIE,"Technik")

But no, nothing happens and i get some errors.

--> IE.au3 V2.3-1 Warning from function _IELoadWait, $_IEStatus_AccessIsDenied (Cannot verify readyState. Likely casue: cross-site scripting security restriction.) --> IE.au3 V2.3-1 Warning from function _IELinkClickByText, $_IEStatus_NoMatch

I am a bit afraid of this message: $_IEStatus_AccessIsDenied

I noticed that, after login, that i am still in a frame (name:"mainframe").

So i thought _IELinkClickByText($oFrameMain,"Technik")

But again i only get errors from the IE.au3 (The requested action with this object has failed.) and the scripts chrashed >_>

I think the problem is this message: $_IEStatus_AccessIsDenied

Well, some help would be nice :P

Sorry for my english ;)

Edited by Wesloth

Share this post


Link to post
Share on other sites



It is not really clear what function calls result in the errors you are receiving. It is important to figure that out. Use Debug statements of SciTe Trace Lines if you need to.

The access is denied error is typically caused by trying to operate on a frame whose source is from a different domain than its parent -- if this is the case, your only option is to open the src of that frame in a new browser window.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

The access is denied error is typically caused by trying to operate on a frame whose source is from a different domain than its parent

How can you tell programmatically if the domain is different Dale?

Share this post


Link to post
Share on other sites

delstone,

Please do not necro threads from over 4 years ago - just start a new thread. Autoit has typically advanced a great deal since the original post and there is often little relevance to the posted code. :)

Furthermore the current Forum Rules do not permit the discussion of site log-in and automating games - so the thread is now being locked anyway. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0