Jump to content
Sign in to follow this  
MikeTranser

Hard Script Need

Recommended Posts

MikeTranser

Hello i need very good script:

My program working 20min (Error) sometimes 10h (Error) LOL?

Include IE3.au3 etc.

Example:

If Program Have Problem in working before that "(Error AutoiT Line:xxxx)" Then program go func xyz()

Edited by MikeTranser

Share this post


Link to post
Share on other sites
MikeTranser

I need anti debug script :mellow:

Share this post


Link to post
Share on other sites
Melba23

MikeTranser,

Answer to Q1: Look at this thread - the second post is from the creator of AutoIt, sounds like a definitive answer to me! :mellow:

Answer to Q2: You have asked this sort of question before and your thread was locked - do you really want to ask it again? It will only end in tears..... :(

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
MikeTranser

I dont understand this i need if program debug (error) then set error=0 and go working more...

Share this post


Link to post
Share on other sites
dani

What? If @error = 1 the script will continue like nothing happened anyway :mellow:

Edited by dani

Share this post


Link to post
Share on other sites
MikeTranser

My script have 3 GUI and 17 Func (4754 Line). And Where i must add this func? And Every one have easy script? If Error Then program working?

Share this post


Link to post
Share on other sites
Jos

My script have 3 GUI and 17 Func (4754 Line). And Where i must add this func? And Every one have easy script? If Error Then program working?

How on earth can you ask where to put your error checking when you have a 4754 lines script? Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
MikeTranser

^^ Every One have small anti debug script?

Becouse this not working:

Global $success = 1AdlibEnable("errorHandle")$success = functionHere("stuff").........Func errorHandle()    If (Not $success) Or @error Then        ConsoleWrite("Failure" & @CRLF)        Exit 1    EndIfEndFunc

And Meaby this script is good?

Global $success = 1

$success = start()
Func errorHandle()
    If (Not $success) Or @error Then
        ConsoleWrite("Failure" & @CRLF)
        Exit 1
    EndIf
EndFunc

Start have 17 func in while.

Edited by MikeTranser

Share this post


Link to post
Share on other sites
MikeTranser

How make Exit 1? Exit my program?

And how to test this script?

Meaby my script is good for anti debug? :

If @error <> 0 Then
SetError(0)
EndIf
Edited by MikeTranser

Share this post


Link to post
Share on other sites
MariusN

Debugging your script?

1) Run it in Scite and look at the bottom for errors...thats the first rule

2) This might seem like a long way, but its effective and i use this all the time...If you don't get errors at the bottom, try putting in "messageboxes" after functions you "think" might not work properly or might contain errors...Name your msgbox's the functions name

ie under func Test() you will put msgbox(0,"func test","my first msgbox")in the text area so you know where you are...

If this messagebox pops up, you know your function was triggered...if not, your command calling the func Test() may be at fault...just an idea :mellow:

I battled my BACKSIDE of with a bandwidth monitoring script that gave me gray hairs...At the end i found out that "some" commands (especially DOS or WIN commands), RunWait doesnt work...After some time your script will error out...Reason? The DOS command (if i may call it like that) needed TIME to execute properly...all i then did was add a Sleep(100) AFTER the RUN command..All errors GONE! :(

...just a tip

Edited by MariusN

Share this post


Link to post
Share on other sites
MikeTranser

Iam have only errors if IE not load or load timeout.

Share this post


Link to post
Share on other sites
dani

Then try to somehow 'catch' that error and handle it. It's really not that difficult.

If you really can't do it then just post the lines that give you errors and will help you find the problem..

Share this post


Link to post
Share on other sites
MikeTranser

Hmm this is my one func:

Func zaloguj()
    Sleep(100)
    Global $I = _IECreate("http://x", 0, $show)
    errorHandle()
    $bodyhtml3 = _IEBodyReadHTML($I)
    $s2 = StringInStr($bodyhtml3, "ErrorPageTemplate")
    If $s2 = 0 Then
        $logi = GUICtrlRead($LoginGui)
        $hasl = GUICtrlRead($HasloGui)
        $login = _IETagNameGetCollection($I, "input", 1)
        $haslo = _IETagNameGetCollection($I, "input", 2)
        _IEFormElementSetValue($login, $logi)
        _IEFormElementSetValue($haslo, $hasl)
        $bodyhtml = _IEBodyReadHTML($I)
        $b = StringInStr($bodyhtml, "login")
        $bs = _IETagNameGetCollection($I, "input")
        For $b In $bs
            If $b.src = "login.png" Then _IEAction($b, "click")
        Next
        _IELoadWait($I)
        errorHandle()
    EndIf
    Sleep(100)
EndFunc   ;==>zaloguj

Share this post


Link to post
Share on other sites
dani

Hmm this is my one func:

Func zaloguj()
    Sleep(100)
    Global $I = _IECreate("http://x", 0, $show)
    errorHandle()
    $bodyhtml3 = _IEBodyReadHTML($I)
    $s2 = StringInStr($bodyhtml3, "ErrorPageTemplate")
    If $s2 = 0 Then
        $logi = GUICtrlRead($LoginGui)
        $hasl = GUICtrlRead($HasloGui)
        $login = _IETagNameGetCollection($I, "input", 1)
        $haslo = _IETagNameGetCollection($I, "input", 2)
        _IEFormElementSetValue($login, $logi)
        _IEFormElementSetValue($haslo, $hasl)
        $bodyhtml = _IEBodyReadHTML($I)
        $b = StringInStr($bodyhtml, "login")
        $bs = _IETagNameGetCollection($I, "input")
        For $b In $bs
            If $b.src = "login.png" Then _IEAction($b, "click")
        Next
        _IELoadWait($I)
        errorHandle()
    EndIf
    Sleep(100)
EndFunc   ;==>zaloguj

What is the error and at what line does it occur? Only giving a piece of code won't do it :mellow:

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  

×