Jump to content

Recommended Posts

Posted (edited)

I have a question about IE. I want to know how can I make difference when I use IE functions when I have same type of form elements? If I try to get objets by name "add_comment_text", everytime I will get the first one.

Maybe this photo it's more suggestive:

Posted Image

I want to make a script for a facebook game, where players left comments to add each other to make some teams in game.

Edited by Andreik
Posted (edited)

I tried some ways with _IEFormElementGetCollection() but I cannot use it properly. This is my attempt to make this script:

#include <IE.au3>

$IE = _IECreate("http://www.facebook.com",0,1,1,1)
$LOGIN = _IEGetObjByName($IE,"login_form")
$EMAIL = _IEFormElementGetObjByName($LOGIN,"email")
$PASS = _IEFormElementGetObjByName($LOGIN,"pass")
_IEFormElementSetValue($EMAIL,"myuser@yahoo.com")
_IEFormElementSetValue($PASS,"mypassword")
_IEFormSubmit($LOGIN)
_IELoadWait($IE)
_IENavigate($IE,"http://www.facebook.com/MafiaWars")
_IELoadWait($IE)
$ADD = _IEGetObjByName($IE,"add_comment_text")
For $INDEX = 0 To @extended-1
    $MSG = _IEGetObjByName($IE,"add_comment_text",$INDEX)
    _IEAction($MSG,"focus")
    _IEFormElementSetValue($MSG,"PM me with team offer!")
    $COMMENT = _IEGetObjByName($IE,"comment",$INDEX)
    _IEAction($COMMENT,"click")
Next

But seems to be a little goofy this script. In my page are maybe more than 25 objects with name add_comment_text and @extended value show something like 11.

Know someone why? :graduated:

Edited by Andreik

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
×
×
  • Create New...