Jump to content
Sign in to follow this  
eitrnel

hi! i need help with some script

Recommended Posts

eitrnel

hi !

i need script that will do the following:

first it will read info from a text file (lets say it will be numeric - '1' or '2')

if the number is '1' it will press F8, minimize file named 'media.exe' (this fie is always running on background),

and then it will open file named '1.exe' and run it for 15 minutes, and change the value on the text file to '2'

and if the number is '2'

it will close file named '1.exe, Press F8, and maximize 'media.exe' and change the value in the text file to '1'

i hope i was clear :) tnx!

Edited by eitrnel

Share this post


Link to post
Share on other sites
Melba23

eitrnel,

Hello and welcome to the AutoIt forums. You will find lots of help here, but we do expect you do do some work first.

Go and read the Help file and the excellent tutorials that you can find here and here.

Then when you have some code, even if it does not work, come back and ask for help again. You will be amazed at the difference!

M23

Hint: Start by looking at the following functions:

FileOpen, FileRead, FileWrite, FileClose, Send, WinSetState, Run, WinClose, TimerInit, TimerDiff

That should get you started! ;-)


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
Authenticity

HotKeySet('{ESC}', '_EXIT')
Dim $sTxt, $iInterval = 60*1000
Dim $sTitle, $hWin

$sTxt = FileRead(@ScriptDir & '\Test.txt', 1)
$sTitle = ''
$hWin = WinGetHandle($sTitle)

While 1 
    If $sTxt = '1' Then
        Send('{F8}')
        WinSetState($hWin, '', @SW_MINIMIZE)
        Run(@ScriptDir & '\1.exe')
        Sleep(15*$iInterval)
    Else
        If $sTxt = '2'
            ProcessClose('1.exe')
            Send('{F8}')
            WinSetState($hWin, '', @SW_MAXIMIZE)
        EndIf
    EndIf

    Sleep(20)
WEnd
        
Func _EXIT()
    Exit
EndFunc

I didn't bother to check this as I don't know what is the title of media.exe window.

Share this post


Link to post
Share on other sites
eitrnel

Melba23 - youy right, im gonna read the Help file :lmao:

Authenticity - thanks, ill chek it out :)

Edited by eitrnel

Share this post


Link to post
Share on other sites
eitrnel

Im backkkk :)

ok, so i got this code

ProcessClose("1.exe")

WinSetState($hWin, '', @SW_MAXIMIZE)

Send('{F8}')

Sleep((5) * ($iInterval))

but 1.exe wont close, it's still on the background

any ideas?

Share this post


Link to post
Share on other sites
BrettF
eitrnel

Post the full code :lmao:

Maybe try ProcessWaitClose?

Cheers,

Brett

still not working :)

here's the code

CODE
HotKeySet('{ESC}', '_EXIT')

Dim $sPresToShow, $iInterval = 60*1000

Dim $sTitle, $hWin

$sPresToShow = 1

$sTitle = ''

$hWin = WinGetHandle($sTitle)

while True

if $sPresToShow > 3 then

$sPresToShow = 1

endif

Send('{F8}')

WinSetState($hWin, '', @SW_MINIMIZE)

Run("1.exe")

$sPresToShow = $sPresToShow + 1

Sleep((1) * ($iInterval))

ProcessClose("1.exe")

WinSetState($hWin, '', @SW_MAXIMIZE)

Send('{F8}')

Sleep((5) * ($iInterval))

WEnd

Func _EXIT()

Exit

EndFunc

Share this post


Link to post
Share on other sites
eitrnel

ok! i understand my problem

i closed another process instead of mine :)

so, i got another question

how do i make this code to be correct with autoit Syntax

Run("Variable.exe")

("Variable" is a variable number of course, and not specific name of file)

tnx guys!! :)

Share this post


Link to post
Share on other sites
Inverted

Very easy :

$var1 = 111
MsgBox (4096, "Test", "c:\" & $var1 & ".exe")
Edited by Inverted

Share this post


Link to post
Share on other sites
eitrnel

Very easy :

$var1 = 111
MsgBox (4096, "Test", "c:\" & $var1 & ".exe")

tnx man! work like magic :)

Share this post


Link to post
Share on other sites
eitrnel

So, i got another question!

how do i mute entire column in the Master Volume (or Mixer)?

there is any custom function for this?

2d8ltnr.jpg&quot;]<!--url{0}--> alt=

let's say i want to mute Skype

tnx! :)

Edited by eitrnel

Share this post


Link to post
Share on other sites
BrettF
eitrnel

Tnx! but in Vista it's little bit different

cuz every application has its own column

Share this post


Link to post
Share on other sites
eitrnel

is some one know how to deal with this situation?

So, i got another question!

how do i mute entire column in the Master Volume (or Mixer)?

there is any custom function for this?

2d8ltnr.jpg&quot;]<!--url{0}--> alt=

let's say i want to mute Skype

tnx! :)

Edited by eitrnel

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  

×