Jump to content

_IEFormElementOptionSelect invalid value using byIndex


Recommended Posts

Hello  I am trying to automate some form applications on a website and the issue I'm encountering is being able to select something other than the first value in the drop down menu.  For some reason if the first option is desired the code works flawless, but if the 2nd or 3rd entry is desired I receive the error invalid value.  The desired slot is determined off a GUI I built where the value will be set to 1,2, or 3.  I assumed that seeing how I'm using an index, but I think this assumption is wrong and I honestly don't know how to go about fixing it.  I can't use a search bytext because the text could vary differently from instance to instance.  byvalue I don't think I have that information either,I'm assuming its a value that is determined on their end in the code?  The options only show up after I choose the correct server.  The question is how do I get the next option in the drop down menu?

Local $oQuery4 = _IEFormElementGetCollection($oForm3, 1)
_IEFormElementOptionSelect($oQuery4, 1, $slot, "byIndex");  which of the 3 slots
_IEFormSubmit($oForm3)
_IELoadWait($oIE)
   EndFunc
<select name="char_id" id="char_id" onchange="list_char_level();"><option value="">Please choose character</option><option value="1541544">oldschoolxz3a</option><option value="1541545">oldschoolxz3b</option><option value="1541546">oldschoolxz3c</option></select>
Link to comment
Share on other sites

Is this for a game? If yes, then please review the forum rules. We do not allow discussion of game automation here.

If I'm wrong then would you be so kind in letting us know the name of the website so we can see the code they use? That way we can better help you. Thanks.

Edited by YogiBear
Link to comment
Share on other sites

It is indeed related to a game.  It is designed to run the back office so I don't have to waste hours clicking html forms to manage my accounts, does this actually launch the game or run anything, no this does not automate any form of grinding or character interaction.  Does this count as a game bot, I don't think so.  All I'm trying to do is manage accounts on the html side.  If you feel that I am in violation of the rules ok, ill won't bother you anymore.  

Edited by obite
Link to comment
Share on other sites

  • Developers

It is indeed related to a game.  It is designed to run the back office so I don't have to waste hours clicking html forms to manage my accounts, does this actually launch the game or run anything, no this does not automate any form of grinding or character interaction.  Does this count as a game bot, I don't think so.  All I'm trying to do is manage accounts on the html side.  If you feel that I am in violation of the rules ok, ill won't bother you anymore.  

 

Care to elaborate about the Hours of clicking managing accounts?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I manage about 100 accounts, and I apply them to groups, so instead of logging into each account search for the group and applying them.  I'm trying to automate, I did it just fine with getting mouse coordinates but, that was dependent on the screen resolution, so I tried upgrading my code to get away from use of mouse clicks. 

Edited by obite
Link to comment
Share on other sites

I've managed to confirm that there is actually 4 values in the Index, but I still can't make _IEFormElementOptionSelect  "byIndex" to work.

Here is the link where the problem lies.

It requires that you have a login so use this test account.

Login: oldschoolx1

pass: oldschoolx

http://top2.igg.com/event/pirate_club/join_team.php?id=34392

If you want to see what my code actually does, for clarity purposes on what I'm doing then use this.  Please let me know even if its to say I'm in violation.

#include <IE.au3>
HotKeySet ("{ESC}", "Terminate") ; hit esc to cancel
Master()




Func Master()
Global $name = "oldschoolx"
Global $start= 1

Global $pass = "oldschoolx"


Global $slot = 1; only works at 1, the main problem.

Global $oIE = _IECreate("http://top2.igg.com/event/pirate_club/")

Login()

_IENavigate($oIE, "http://top2.igg.com/event/pirate_club/index.php?p_level=3"); 45 club
_IELoadWait($oIE)

Apply()



MsgBox(4096, "Finished", "Done")

EndFunc


Func Apply()

Local $oForm2 = _IEFormGetCollection($oIE, 1)
Local $oQuery2 = _IEFormElementGetCollection($oForm2, 2); club name
_IEFormElementSetValue($oQuery2, "old school")
_IEFormSubmit($oForm2)
_IELoadWait($oIE)

_IEImgClick($oIE, "http://top2.igg.com/themes/images/event/pirateclub/btnapply.gif"); hit apply to club
_IELoadWait($oIE)


Local $oForm3 = _IEFormGetCollection($oIE, 2)
Local $oQuery3 = _IEFormElementGetCollection($oForm3, 0)
_IEFormElementOptionSelect($oQuery3, "Dream Islands--Dawn Isle", 1, "byText")
_IELoadWait($oIE)

;Problem area
$oForm3 = _IEFormGetCollection($oIE, 2); reload the form because of first dropdown
Local $oQuery4 = _IEFormElementGetCollection($oForm3, 1)
_IEFormElementOptionSelect($oQuery4, 1, $slot, "byIndex");  which of the 3 slots, won't work if $slot value is anything but 1                                                     

;Problem area

_IEFormSubmit($oForm3)
_IELoadWait($oIE)
   EndFunc




   Func Login()
Local $oForm = _IEFormGetCollection($oIE, 0)
Local $oQuery = _IEFormElementGetCollection($oForm, 0) ;login
Local $oQuery1 = _IEFormElementGetCollection($oForm, 1) ;pass
_IEFormElementSetValue($oQuery, $name & $start)
_IEFormElementSetValue($oQuery1, $pass)
_IEFormSubmit($oForm)

    _IELoadWait($oIE)

       EndFunc

Func Terminate()
    Exit 0
    EndFunc
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...