Jump to content

My script causes a crash, could use a hand :)


huldu
 Share

Recommended Posts

Ive worked really hard to locate what is causing a crash in my script. Its a pretty nasty crash where the program freezes and haveto be forced killed thru windows.

Func SaveFileInfo();This part is causing the crash

        $OpenFile = FileOpenDialog("Locate your silkroad.exe!", @ScriptDir, "Executables (*.exe)", 1);", 1 + 2 )
        $Convert = $OpenFile
        
        If StringInStr($Convert, "silkroad.exe") <> 0 Then
            IniWrite(@ScriptDir & $FileName, "GAME", "Dir", $Convert)
            
            
            GUICtrlSetData($mylist, "")
            GUICtrlSetData($mylist, $Convert)
            
    ;MsgBox(64, "Success", "Path has been saved: " & @CRLF & $Convert)
            
            $ShowError = "Path has been saved."
            
            GUICtrlSetData($List2, "")
            GUICtrlSetData($List2, $ShowError)
            
        Else
    ;MsgBox(16, "ERROR!", "You must select silkroad.exe!")
            
            
            $ShowError = "You must select silkroad.exe!"
            
            GUICtrlSetData($List2, "")
            GUICtrlSetData($List2, $ShowError)
            
            
        EndIf
; Script crash right here when function is about to exit, it does NOT get back to loop
    EndFunc

Ive tracked the problem to this specific part of the script. To be honest i have no idea why i get such a big problem running this func. The interesting part is, if i pick "wrong" .exe there is a slim chance the program keeps going. However if i pick the "correct" .exe the script instantly crashes.

Ive added the full source of the code of course, i really hope someone can help me put a finger on why it causes such an aggresive crash.

-- I must add beside the above problems the script works great, no errors compiling it, works like a charm! (well until you get to the part where you "open" and browse for a file *cough*) :P

Updated.au3

Edited by huldu

"I'm paper, rock is fine, nerf scissors!!!"

Link to comment
Share on other sites

  • Moderators

Func SaveFileInfo();This part is causing the crash

        $OpenFile = FileOpenDialog("Locate your silkroad.exe!", @ScriptDir, "Executables (*.exe)", 1);", 1 + 2 )
        $Convert = $OpenFile
        
        If StringInStr($Convert, "silkroad.exe") <> 0 Then
            IniWrite(@ScriptDir & $FileName, "GAME", "Dir", $Convert)
            
            
            GUICtrlSetData($mylist, "")
            GUICtrlSetData($mylist, $Convert)
            
 ;MsgBox(64, "Success", "Path has been saved: " & @CRLF & $Convert)
            
            $ShowError = "Path has been saved."
            
            GUICtrlSetData($List2, "")
            GUICtrlSetData($List2, $ShowError)
            
        Else
 ;MsgBox(16, "ERROR!", "You must select silkroad.exe!")
            
            
            $ShowError = "You must select silkroad.exe!"
            
            GUICtrlSetData($List2, "")
            GUICtrlSetData($List2, $ShowError)
            
            
        EndIf
; Script crash right here when function is about to exit, it does NOT get back to loop
    Return ''
    EndFunc

Not having SilkRoad makes it's difficult to find a specific problem myself, but try a return and see what happens. This another reason I'm not a fan of GUISetOnEvent()

Edit:

Bad Code Tag Day!!

Edit2:

I made a slikeroad.exe with a msgbox titled of SRO_client, and I couldn't get a crash myself.

Are you compiling with Beta Options?

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I am compiling using the beta. Did you try the "Open" and selecting your .exe?

I get the crash after selecting the "correct" .exe in this case silkroad.exe :P

Also added the Return '', but still the same sadly.

-- Edit

I can run the game fine from "Run Game" with the presaved information (even if the application crash it saved the info to saved.ini). Just a very wicked error hehe!

-- Edit 2

Im using SciTE and the "beta run/compile", i downloaded the "latest" beta build the other day, i think its the dec 30 release.

-- Edit 3

SmOke_N, Weird question but could you attach your source+compiled .exe, i would love to run both those 2 and see if i still get a crash.

Edited by huldu

"I'm paper, rock is fine, nerf scissors!!!"

Link to comment
Share on other sites

  • Moderators

i deleted them... i didn't do anything but this:

1. Ran your code in SciTe

2. Made an .exe SilkRoad / with nothing but MsgBox(0, "SRO_client", "") in it to test the crash.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

i deleted them... i didn't do anything but this:

1. Ran your code in SciTe

2. Made an .exe SilkRoad / with nothing but MsgBox(0, "SRO_client", "") in it to test the crash.

You had no problem with Open and selecting the silkroad.exe?

"I'm paper, rock is fine, nerf scissors!!!"

Link to comment
Share on other sites

  • Moderators

No, opened right up, and the msgbox popped right up

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

No, opened right up, and the msgbox popped right up

Lol.. what the heck can be messed up on my side :P ... any recommendations on what i should do?

-- Edit

Im gonna compile and run on another computer and see what happens.

-- Edit

Ugh.. same error there.. /cry

Edited by huldu

"I'm paper, rock is fine, nerf scissors!!!"

Link to comment
Share on other sites

  • Moderators

Yeh, I'm probably the wrong guy to help you here, the code is basically all over the place, and I don't use GUISetOnEvent() much, so jumping all over trying to figure out what the script was doing wasn't an ideal situation for myself.

On top of that, not having the specific exe your speaking of, doesn't help either. I hope someone that likes to play with GUISetOnEvent() and knows the SilkRoad.exe has some insight for you.... Sorry I couldn't be more help!

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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