Jump to content

My script stops and does nothing


MATISZON
 Share

Recommended Posts

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]

Link to comment
Share on other sites

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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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]

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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]

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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!"

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