Jump to content

hi! i need help with some script


eitrnel
 Share

Recommended Posts

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
Link to comment
Share on other sites

  • Moderators

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! ;-)

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!! :)

Link to comment
Share on other sites

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