Sign in to follow this  
Followers 0
MATISZON

My script stops and does nothing

9 posts in this topic

Hello my script stops at a certain point and does not carry out further work the moment of detention stated in the script.

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            If GUICtrlRead($Checkbox3) = 1 Then $sila = 1
            If GUICtrlRead($Checkbox3) = 4 Then $sila = 0
            If GUICtrlRead($Checkbox4) = 1 Then $obrona = 1
            If GUICtrlRead($Checkbox4) = 4 Then $obrona = 0
            If GUICtrlRead($Checkbox5) = 1 Then $szybkosc = 1
            If GUICtrlRead($Checkbox5) = 4 Then $szybkosc = 0
            If GUICtrlRead($Checkbox1) = 1 Then $show = 1
            If GUICtrlRead($Checkbox1) = 4 Then $show = 0
            If GUICtrlRead($Checkbox7) = 1 Then $crim = 1
            If GUICtrlRead($Checkbox7) = 4 Then $crim = 0
            If GUICtrlRead($Checkbox8) = 1 Then $pvp = 1
            If GUICtrlRead($Checkbox8) = 4 Then $pvp = 0
            If GUICtrlRead($Checkbox9) = 1 Then $sterydy = 1
            If GUICtrlRead($Checkbox9) = 4 Then $sterydy = 0
            If GUICtrlRead($Checkbox2) = 1 Then $cwicz = 1
            If GUICtrlRead($Checkbox2) = 4 Then $cwicz = 0
            If GUICtrlRead($Checkbox6) = 1 Then $dym = 1
            If GUICtrlRead($Checkbox6) = 4 Then $dym = 0
            If GUICtrlRead($Checkbox14) = 1 Then $swiezak = 1
            If GUICtrlRead($Checkbox14) = 4 Then $swiezak = 0
            If GUICtrlRead($Checkbox10) = 1 Then $gangcrimes = 1
            If GUICtrlRead($Checkbox10) = 4 Then $gangcrimes = 0
            If GUICtrlRead($Checkbox11) = 1 Then $bank = 1
            If GUICtrlRead($Checkbox11) = 4 Then $bank = 0
            $crimX = GUICtrlRead($Input6)
            $poz = GUICtrlRead($Input7)
            $valsil = GUICtrlRead($Input3)
            $valobr = GUICtrlRead($Input4)
            $valszyb = GUICtrlRead($Input5)
            $loginG = GUICtrlRead($Input1)
            $hasloG = GUICtrlRead($Input2)
            save()
            GUIDelete()
            login()
        Case $Button2
            $thanx = 1
            GUICtrlSetState($Button2, $GUI_DISABLE)
        Case $Button3
            Run("help.dat")
    EndSwitch
WEnd
Func login()
    Global $IE = _IECreate("http://www.prisonwars.pl/", 0, $show)
    $html = _IEDocReadHTML($IE)
    $s = StringInStr($html, "http://www.prisonwars.pl/bank/")
    If $s = 0 Then
        $login = _IETagNameGetCollection($IE, "input", 1)
        $haslo = _IETagNameGetCollection($IE, "input", 2)
        $form = _IETagNameGetCollection($IE, "form", 0)
        _IEFormElementSetValue($login, $loginG)
        _IEFormElementSetValue($haslo, $hasloG)
        _IEFormSubmit($form) ;The script sends the form and does nothing further.
    EndIf
    thanx()
EndFunc   ;==>login
Func thanx()
    ;If $thanx = 1 Then
        _IENavigate($IE, "http://www.bialoleka.prisonwars.pl/userprofile/62884/")
        ;szpital("http://www.prisonwars.pl/userprofile/62884/")
        $formm = _IETagNameGetCollection($IE, "form", 10)
        $d = _IEFormElementGetObjByName($formm, "points")
        _IEFormElementSetValue($d, "1")
        _IEFormSubmit($formm)
    ;EndIf
EndFunc   ;==>thanx

[size="3"][font="Arial Black"]I'm from the Polish do not as well know how English[/font][/size]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Add

#AutoIt3Wrapper_Run_Debug_Mode=Y
to your script and run it through SciTE.

The console will show where your script is running around.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

0182: 0-0:      $login = _IETagNameGetCollection($IE, "input", 1)
0183: 0-11:         $haslo = _IETagNameGetCollection($IE, "input", 2)
0184: 0-11:         $form = _IETagNameGetCollection($IE, "form", 0)
0185: 0-2:      _IEFormElementSetValue($login, $loginG)
0186: 0-0:      _IEFormElementSetValue($haslo, $hasloG)
0187: 0-0:      _IEFormSubmit($form)

Last few lines until you stop the script.


[size="3"][font="Arial Black"]I'm from the Polish do not as well know how English[/font][/size]

Share this post


Link to post
Share on other sites

The _IE* functions set the variable @error if anything goes wrong.

Could you please check the value of @error after the mentioned _IE* statements e.g. by inserting something like

ConsoleWrite("Please insert the IE_Function name here: " & @error & @CRLF)
after each line?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

If $s = 0 Then
        $login = _IETagNameGetCollection($IE, "input", 1)
        ConsoleWrite("_IETagNameGetCollection" & @error & @CRLF)
        $haslo = _IETagNameGetCollection($IE, "input", 2)
        ConsoleWrite("_IETagNameGetCollection" & @error & @CRLF)
        $form = _IETagNameGetCollection($IE, "form", 0)
        ConsoleWrite("_IETagNameGetCollection" & @error & @CRLF)
        _IEFormElementSetValue($login, $loginG)
        ConsoleWrite("_IEFormElementSetValue" & @error & @CRLF)
        _IEFormElementSetValue($haslo, $hasloG)
        ConsoleWrite("_IEFormElementSetValue" & @error & @CRLF)
        _IEFormSubmit($form)
        ConsoleWrite("_IEFormSubmit" & @error & @CRLF)
    EndIf

That's it about?

post-53057-12591679715052_thumb.jpg


[size="3"][font="Arial Black"]I'm from the Polish do not as well know how English[/font][/size]

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Cope differently. Maybe it BUG in AutoIt or include IE :)

$form.submit        
_IELoadWait($IE)
Edited by MATISZON

[size="3"][font="Arial Black"]I'm from the Polish do not as well know how English[/font][/size]

Share this post


Link to post
Share on other sites

That's it about?

Yes. Unfortunately all @error codes are 0. I nearly know nothing about the IE UDF, maybe a more experienced user can jump in?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Check the example for _IETagNameGetCollection(). It demonstartes the method to use when you are using Collections. Think of them as arrays(they aren't) and you will catch on.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

This piece of code I have in other parts of the script and works well.


[size="3"][font="Arial Black"]I'm from the Polish do not as well know how English[/font][/size]

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