Jump to content

A Custom MeGUI Script


bb05
 Share

Recommended Posts

I basically do a lot of video encoding and have slapped this script together and was looking to get a little feedback on ways for improvement on it.

The one thing that I would really like to be able to add is a "pause/resume" function so I can, you guessed, pause and resume the script when its running >_<

HotkeySet("{HOME}","_end")
Func _end()
Exit 0
EndFunc
$fileinput = FileOpen("out.txt", 0)
$i = 1;
while $i <= 106
;=====Sets MeGUI up for auto-que=====
Opt("WinTitleMatchMode", 2)
WinActivate("MeGUI 0.3")
WinWait("MeGUI 0.3","")
WinMove("MeGUI 0.3","",1,1)
MouseClick("left",164,42,1,3);select tools
MouseClick("left",239,176,1,3);select avs script creator
WinWait("MeGUI - AviSynth script creator","")
WinMove("MeGUI - AviSynth script creator","",1,1);move aviscript creator tab to top left
MouseClick("left",447,90,1,3) ;selects source
$line = FileReadLine($fileinput)
WinWait("Select a source file","")
WinActivate("Select a source file","")
Send($line)
Send("{ENTER}")
;=====Sets MeGUI up for auto-que=====

;======Closes Preview Of Video File=====
WinWait("Current position: ","")
WinClose("Current position: ")
;======Closes Preview Of Video File=====

;======Video Cropping=====
;MouseClick("left",35,296,1,3) ;Enables Video Cropping
;MouseClick("left", 203,279,1,3) ; Clicks Top Crop
;Send("{BS}") ;Sends Backspace
;Send("32");Crops 32 Pixels 
;MouseClick("left",198,309,1,3) ; Click Bottom Crop
;Send("{BS}") ;Sends Backspace
;Send("32") ;Crops 32 Pixels 
;Mouseclick("left",36,333,1,3)
;MouseClickDrag("left",157,334,125,334);edit size
;Send("1280") ; used to downscale hd video
;MouseClick("left",260,337,1,3);mod 16 click
;======Video Cropping=====
MouseClick("left",441,500,1,3);Saves the script

;======Audio=====
MouseClick("left",487,296,1,3);Selects audio input
WinWait("Select your audio input","")
WinActivate("Select your audio input","")
Send($line)
Send("{ENTER}")
WinWaitActive("MeGUI 0.3","")
;======Audio=====

MouseClick("left",465,510,1,3) ; autoencode button
WinWait("MeGUI - Automatic Encoding","")
WinMove("MeGUI - Automatic Encoding","",1,1)

;=======Pre-Defined File Size=============
;MouseClick("left",323,172,1,3)
;MouseClick("left",381,507,1,3);first custom encode size
;=======Pre-Defined File Size=============

;=======File Output Container=======
MouseClick("left",180,58,1,3) ; Container Click
MouseClick("left",147,77,1,3) ; MKV Format
;MouseClick("left",131,91,1,3) ; MP4 Format
;=======File Output Container=======

;=======Pre-Defined Bitrate=============
MouseClick("left",36,200,1,3) ; Average bitrate Button
MouseClickDrag("left",211,194,122,193) ; Clicks Bitrate And drags to Beginning
Send("420") ; sets bitrate to 420kbps
;=======Pre-Defined Bitrate=============

MouseClick("left",382,264,1,3);Queues The File
WinWaitActive("MeGUI 0.3","")
$i = $i + 1
WEnd

out.txt example

ds9.1x02.past prologue.dvdrip.xvid.ac3-bags.avi
ds9.1x03.a man alone.dvdrip.xvid.ac3-bags.avi
ds9.1x04.babel.dvdrip.xvid.ac3-bags.avi
ds9.1x05.captive pursuit.dvdrip.xvid.ac3-bags.avi
ds9.1x06.q-less.dvdrip.xvid.ac3-bags.avi

feedback is greatly appreciated as i have been modifying with this script for about 2-3 months now.

cheers

bb05

Edited by bb05
Link to comment
Share on other sites

Here's a demo of just one of many ways to implement "pause":

Global $f_RUN = True
Global $i = 0

HotKeySet("{ESC}", "_Quit")
HotKeySet("{PAUSE}", "_Pause")

While 1
    $i += 1
    Sleep(100)
    ToolTip("$i = " & $i)
WEnd

Func _Quit()
    Exit
EndFunc

Func _Pause()
    $f_RUN = Not $f_RUN
    Do
        Sleep(10)
    Until $f_RUN
EndFunc

The _Pause() function could also just toggle the global $f_RUN flag and you could check it inside your loop.

>_<

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...