Jump to content

IE.au3 Form won't submit.


Recommended Posts

Hello.

I have made bot for auctions in game, but it won't submit offer. Sorry for my English. I'm from Poland.

Posted Image

Translate:

Offer $61 with character ($10795 on account) Offer.

#include <IE.au3>

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Global $oIE
Global $read_url
Global $read_cena

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("[H-RP] Licytacja...", 297, 137, 512, 375)
$edLogin = GUICtrlCreateInput("", 48, 16, 241, 21)
$lbLogin = GUICtrlCreateLabel("Login", 8, 16, 30, 17)
$lbHaslo = GUICtrlCreateLabel("Hasło", 8, 40, 33, 17)
$edHaslo = GUICtrlCreateInput("", 48, 40, 241, 21)
$edUrl = GUICtrlCreateInput("", 48, 80, 241, 21)
$lbUrl = GUICtrlCreateLabel("Url", 8, 80, 17, 17)
$edCena = GUICtrlCreateInput("", 48, 104, 65, 21)
$lbCena = GUICtrlCreateLabel("Cena", 8, 104, 29, 17)
$btStart = GUICtrlCreateButton("Start", 120, 104, 169, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Select
        Case $nMsg = $GUI_EVENT_CLOSE
            Exit
        Case $nMsg = $btStart
            Logowanie()
    EndSelect
WEnd

Func Logowanie()
    $oIE = _IECreate("http://h-rp.co/index.php?app=core&module=global&section=login", 0, 0, 1, 1)
    $oForm = _IEFormGetCollection ($oIE, 1)
    $oQuery = _IEFormElementGetObjByName ($oForm, "username")
    $read_login = GUICtrlRead($edLogin)
    _IEFormElementSetValue ($oQuery, $read_login)
    $oQuery = _IEFormElementGetObjByName ($oForm, "password")
    $read_haslo = GUICtrlRead($edHaslo)
    _IEFormElementSetValue ($oQuery, $read_haslo)
    _IEFormSubmit ($oForm)
    $read_url = GUICtrlRead($edUrl)
    $read_cena = GUICtrlRead($edCena)
    _IEQuit($oIE)
    Oczekiwanie()
EndFunc

Func Oczekiwanie()
    $oIE = _IECreate($read_url, 0, 1, 1, 1)
    $sText = _IEBodyReadText ($oIE)
    $result = StringInStr($sText, "Koniec aukcji")
    $tnij = StringTrimLeft($sText, $result +12)
    $result = StringInStr($tnij, "minUID")
    if $result > 0 Then
        Oczekiwanie()
    Else
        $szukaj = StringInStr($tnij, "sekUID")
        if $szukaj > 0 Then
            $result = StringLeft($tnij, $szukaj -1)
            if Int($result) < 4 Then
                $result = StringInStr($sText, "Minimalna oferta$")
                $tnij = StringTrimLeft($sText, $result +16)
                $result = StringInStr($tnij, "Koniec aukcji")
                $wynik = StringLeft($tnij, $result -1)
                if Int($wynik) <= Int($read_cena) Then
                    $oForm = _IEFormGetCollection ($oIE, 1)
                    _IEFormSubmit($oForm, 1) ;It doesn't work.
                    Exit
                Else
                    Exit
                EndIf
            Else
                Oczekiwanie()
            EndIf
        Else
            Oczekiwanie()
        EndIf
    EndIf

EndFunc
Link to comment
Share on other sites

Do not discuss automating games here.

[font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler]

Link to comment
Share on other sites

I have made bot for auctions in game

[font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler]

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...