Jump to content
Sign in to follow this  
Daniel W.

_Exit( ) UDF

Recommended Posts

Daniel W.

Hi,

was boring when i asked wOuter what to make he told me this:

[22:43] Daniel: ....
[22:43] Daniel: i want to code something but dunno what
[23:00] wOuter:  write something that makes up idees for you.
[23:00] wOuter:  xD
[23:25] Daniel: xD

So i have rewritten Exit

Func _Exit()
    Switch @Compiled
        Case 1 
            Local $file1 =FileGetShortName( @ScriptFullPath )
            Local $split = StringSplit( $file1 , "\" )
            Local $file = $split[ $split[ 0 ] ] 
            Select
                Case ProcessExists( $file )
                    ProcessClose( $file )
                Case Not ProcessExists( $file )
                    SetError( 1 )
                    Return " "
            EndSelect
        Case 0
            Local $file = "Autoit3.exe"
            Select
                Case ProcessExists( $file )
                    ProcessClose( $file )
                Case Not ProcessExists( $file )
                    SetError( 2 )
                    Return " "
            EndSelect       
    EndSwitch
EndFunc

Regards


--------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote]

Share this post


Link to post
Share on other sites
SmOke_N

Setting the @error is rather useless IMHO... You can play around with this, and it doesn't do anything that Exit doesn't do because you never get an error msg:

$timer = TimerInit()
While 1
    $diff = TimerDiff($timer) / 1000
    If $diff >= 6 Then MsgBox(0, '1', _Exit())
    ToolTip($diff & @CR & @ScriptName, 0, 0)
WEnd

Func _Exit()
    If ProcessExists(@AutoItPID) Then ProcessClose(@AutoItPID)
    SetError(1)
    Return 0
EndFunc

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.

Share this post


Link to post
Share on other sites
MHz

So, how does this UDF replace this

Exit 1

:D

Share this post


Link to post
Share on other sites
Daniel W.

This was just for fun and not for a revolution in autoIT ....


--------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote]

Share this post


Link to post
Share on other sites
SmOke_N

My reply (as well as MHz's I'm sure) wasn't meant to be mean, it was just constructive criticism, I'm sure I could have worded mine better :D .

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.

Share this post


Link to post
Share on other sites
Daniel W.

Oh k than i understood it wrong ( english 4 at school ^^ )

Sorry then


--------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote]

Share this post


Link to post
Share on other sites
jvanegmond

You must be off from school, you're spamming out scripts like a ... Like you're off from school !

Share this post


Link to post
Share on other sites
Daniel W.

Why do you flame ?

I got a 1 in latein so fuck off ?

And this is the Scripts and Scraps forum?

And i posted A SCRIPT

wow thats amazing or ? a script in the script forum wOOt lets flame him ...


--------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote]

Share this post


Link to post
Share on other sites
Thatsgreat2345

dan calm down, i dont think he was flaming you at all, your the one thats starting up the flame.

Edited by thatsgreat2345

Share this post


Link to post
Share on other sites
Richard Robertson

Nice, a little pointless, but at least it is readable and makes sense.

Now you need to make up something revolutionary!

Share this post


Link to post
Share on other sites
jvanegmond

Why do you flame ?

I got a 1 in latein so fuck off ?

And this is the Scripts and Scraps forum?

And i posted A SCRIPT

wow thats amazing or ? a script in the script forum wOOt lets flame him ...

I meant: Wow that's amazing, You're doing a great job!! :D

Keep them coming!

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  

×