Sign in to follow this  
Followers 0
t0ddie

ie functions

10 posts in this topic

#1 ·  Posted (edited)

EDIT: I have not solved this issue yet.

see latest post.

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

On the "real" page the picture is stored in same folder, that's why you don't need the full path to the file. However when you replace it with a picture stored on your local computer you need the full path.

Edited by Pain

Share this post


Link to post
Share on other sites

On the "real" page the picture is stored in same folder, that's why you don't need the full path to the file. However when you replace it with a picture stored on your local computer you need the full path.

yeah i tried to give a full path to a place it is saved.

it does not seem to change the path at all, it just adds about:blank to the beginning of it.


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

EDIT: I have not solved this issue yet.

see latest post.

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

I figured it out

You screw up the search feature when you delete your posts... do it again, and you won't post in this forum again.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

You screw up the search feature when you delete your posts... do it again, and you won't post in this forum again.

dont threaten me because of an accident.

like I was supposed to know that...... i didnt delete anything i edited things.

whatever it was unintentional.

anyways...

it is still not figured out actually.

Global $searchstring[1]
$searchstring[0] = "35 alt="" hspace=0 src=" & '"' & "/images/title.gif"
Global $replacestring[1]
$replacestring[0] = "80 alt="" hspace=0 src=" & '"' & @ScriptDir & "/DeathStar.gif"



    $oFrame = _IEFrameGetCollection ($oIE, 0)
   $sHTML = _IEDocReadHTML ($oFrame)
    $replace = StringReplace($sHTML,$searchstring[0],$replacestring[0])
_IEDocWriteHTML ($oFrame, $replace)
_IEAction ($oFrame, "refresh")

i am using this code here and i have tried all types of different variations on the path but no matter what I put when I check the properties on the page it shows the old url and has "about:blank" at the beginning of it.

now.

if I replace the entire string $sHTML with the source code I downloaded from this frame, something like this

$menu = FileRead("menu[1].html")
    $oFrame = _IEFrameGetCollection ($oIE, 0)
   $sHTML = _IEDocReadHTML ($oFrame)
   $sText = _IEBodyReadText ($oFrame)
    $replace = StringReplace($sHTML,$sHTML,$menu)
_IEDocWriteHTML ($oFrame, $replace)
_IEAction ($oFrame, "refresh")
FileClose($menu)

in menu[1].html I have edited the image source manually. i have to put it online because it still wont read it from my computer. after i add a web url.. then it works. i can see a picture.

the problem is that the links dont work. so i edited those to point at the server first.

but then on other frames, it uses javascript and theres nothing that I can point it to...

so basically.. i need a way to be able to filter the page that I am accessing, so that only parts of it show up in the window, AND be able to add things to it too.

I hope this makes sense.

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

Unfortunately, it doesn't make sense to me.

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

dont threaten me because of an accident.

like I was supposed to know that...... i didnt delete anything i edited things.

whatever it was unintentional.

He can, and will threaten you. He's a mod. Deal.

You did delete things. You deleted text from the original post, via the editing feature.

It was intentional. You had the intent to do it, and therefore it was intentional.

Why would you ask for help after being rude to somebody?


Global $arr[2]

$arr[0]="hip"
$arr[1]="hip"
;^^ hip hip array. ^^

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

He can, and will threaten you. He's a mod. Deal.

i simply meant that threatening me to get me to do or not do something, was not needed.

and that comment really is not needed.

You did delete things. You deleted text from the original post, via the editing feature.

It was intentional. You had the intent to do it, and therefore it was intentional.

i was referring to the post itself, and not the content. i did not delete the post. as for the content,

yes i intended to delete it, but no i did not intend to disrupt anything, and furthermore I was not even aware that it would.

Why would you ask for help after being rude to somebody?

I did not think I was being rude... I was being defensive.

this was the first time I was notified about this, and I was treated as if I was pushing the limits.

I would like to get along, and this has gone far enough off topic.

let me clarify the issue.

here is the working script that I have.

you will need an account on www.starkingdoms.com to test this, its free and easy.

#include <GUIConstantsEx.au3>
#include <IE.au3>
#include <WindowsConstants.au3>
#RequireAdmin

_IEErrorHandlerRegister ()

$oIE = _IECreateEmbedded ()
GUICreate("Test", 640, 580,0,0, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$GUIActiveX = GUICtrlCreateObj($oIE, 40, 0, 900, 600)
;$GUI_Button_Back = GUICtrlCreateButton("Back", 10, 620, 100, 30)
;$GUI_Button_Forward = GUICtrlCreateButton("Forward", 120, 620, 100, 30)
;$GUI_Button_Home = GUICtrlCreateButton("Home", 230, 620, 100, 30)
;$GUI_Button_Stop = GUICtrlCreateButton("Stop", 340, 620, 100, 30)

GUISetState()   ;Show GUI
WinSetState("Test","",@SW_MAXIMIZE)
_IENavigate ($oIE, "http://www.starkingdoms.com/login/")


_IELoadWaitTimeout(5000)

$oForm = _IEFormGetCollection($oIE, 0)
$oAccount = _IEFormElementGetCollection($oForm, 0)
$oPass = _IEFormElementGetCollection($oForm, 1)

_IEFormElementSetValue($oAccount, "Account")
_IEFormElementSetValue($oPass, "Password")
_IEFormSubmit($oForm, 0)
_IELoadWait($oIE)

$oElements = _IELinkGetCollection($oIE)
For $oElement In $oElements
    If StringInStr($oElement.innertext, "Terra Nova") Then
        _IEAction($oElement, "click")
        _IELoadWait($oIE)
    EndIf
Next

$oFrames = _IEFrameGetCollection ($oIE)
$iNumFrames = @extended

; Waiting for user to close the window
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
;       Case $msg = $GUI_Button_Home
;           _IENavigate ($oIE, "http://www.starkingdoms.com/login/")
;       Case $msg = $GUI_Button_Back
;           _IEAction ($oIE, "back")
;       Case $msg = $GUI_Button_Forward
;           _IEAction ($oIE, "forward")
;       Case $msg = $GUI_Button_Stop
;           _IEAction ($oIE, "stop")
    EndSelect
WEnd

GUIDelete()

Exit

what I am tryinng to accomplish, is setting up a FILTER between what the IE_ functions read, and what the IE_ functions write to the active x control on the GUI.

what I have done to accomplish this has worked for some things, and has not worked for others.

for example.

I have tried to parse through the html in the frames and replace it, then rewrite to the control.

Global $searchstring[1]
$searchstring[0] = "35 alt="" hspace=0 src=" & '"' & "/images/title.gif"

Global $replacestring[1]
$replacestring[0] = "80 alt="" hspace=0 src=" & '"' & @ScriptDir & "/DeathStar.gif"

    $oFrame = _IEFrameGetCollection ($oIE, 0)
   $sHTML = _IEDocReadHTML ($oFrame)
    $replace = StringReplace($sHTML,$searchstring[0],$replacestring[0])
_IEDocWriteHTML ($oFrame, $replace)
_IEAction ($oFrame, "refresh")

this does not work. the image does not appear, and when you right click it and select properties, you can see that the path remains /images/title.gif and now ALSO has about:blank at the beginning of it. this is the menu frame.

i have tried several variations of this.

then instead of replacing just one piece of text, i copied the source for the frame, and adjusted the path manually.

i then replaced the frame with the new frame, like so

$menu = FileRead("menu[1].html")
    $oFrame = _IEFrameGetCollection ($oIE, 0)
   $sHTML = _IEDocReadHTML ($oFrame)
    $replace = StringReplace($sHTML,$sHTML,$menu)
_IEDocWriteHTML ($oFrame, $replace)
_IEAction ($oFrame, "refresh")
FileClose($menu)

and the picture still would not show up. now it has just "blank" in front of it, instead of about:blank i think.

i dont remember.. but it did not work either way.. whatever was written there.

so i adjusted the path again. this time i uploaded the picture online... and used a full web url as the path.

the picture then showed up. http://www.diablouniverse.com/DeathStar.gif

then of course the links on the menu did not work... because it was taken from my desktop! no problem right? i will just edit the links. so i placed http://s1.starkingdoms.com/scripts in front of all the menu links.. and viola, it worked.

so i thought hey... we are in business... i can just rip the html, adjust the links to point to the server and not leave them as is, which was pointing to some directory on my own computer...

so i started working on the second frame. and there were certain links that i could not change, because they are javascript actions...

so thats where i have run into the problem.

when i leave the page as is, everything works as normal.

when i adjust the page in any way, even just changing one picture.. the rest of the page seems to update as if it was now refreshing from my side instead of theirs. i dont need to adjust the frame itself, i need to adjust the active x controls frame.. for lack of a better description.

i dont want to rip the html onto my computer, then adjust it.... because i run into both problems with javascript, and the fact that i am in a session and if i try to duplicate actions on a page generated from my computer it does not work. almost all actions only work when the page is loaded from their server.

which is fine...

but it seems that theres a problem with editing ANY of the code...

i just want some pictures to DISPLAY differently... some pictures and text to be removed...and yet when i try to edit ANY of the page... even things that have nothing to do with user interaction.... NOTHING ELSE works...

i can make it look the way i want, but then nothing works!

here is a picture of before... and then after... I want to do further things to it but I have to get past (hopefully) this issue first.

BEFORE

Posted Image

AFTER

Posted Image

hope this helps!

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

The way I see it, I should be able to just edit the control itself.. that would be ideal... but

The GUI functions GUICtrlRead and GUICtrlSet have no effect on this control. The object can only be controlled using 'methods' or 'properties' on the $ObjectVar.

but it gives no example of any "method" and i am unsure what to make of the properties suggestion as I tried to simply replace one string in the object variable and it effected the entire functionality of the website that I was accessing. so i am unsure what other things i can do.

thanks for reading!

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
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
Sign in to follow this  
Followers 0