Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Copyright by BiZZ Keryear under CC by-sa 3.0 http://creativecommons.org/licenses/by-sa/3.0/
- ;BiZZ Keryear aka MrMegaPussyPlayer
- ;each copy must contain these three credits lines
- if A_AhkVersion < 1.1.16.05
- {
- msgbox ,16,! ! ! ! ! ! ! ! ! Error: Wrong Version of AHK ! ! ! ! ! ! ! ! !, You are using an outdated version of AHK!`n`n`nPlease grab the correct one:`t`tv1.1.16.05 (or later but before 2.x)`n`n`tfrom:`thttp://ahkscript.org/download/`n`nScript will exit after you click ok.
- ExitApp
- }
- else if A_AhkVersion => 2.
- {
- msgbox ,16,! ! ! ! ! ! ! ! ! Error: Wrong Version of AHK ! ! ! ! ! ! ! ! !, You are using a wrong version of AHK!`nThis script is not compatible with the experimental 2.x or later`n`nPlease grab the correct one:`t`tv1.1.16.05 (or later but before 2.x)`n`n`tfrom:`thttp://ahkscript.org/download/`n`nScript will exit after you click ok.
- ExitApp
- }
- EnvGet, PROGRAMFILESX86, PROGRAMFILES(X86)
- ifexist %PROGRAMFILES%\MiniCap\MiniCap.exe
- {
- minicap=%PROGRAMFILES%\MiniCap
- }
- else ifnotexist %PROGRAMFILESX86%\MiniCap\MiniCap.exe
- {
- msgbox ,16,! ! ! ! ! ! ! ! ! Error: MiniCap not found ! ! ! ! ! ! ! ! !, This programm needs MiniCap to work`n`nPlease go and grab it @ http://www.donationcoder.com/Software/Mouser/MiniCap/index.html`nThis script is only searching for MiniCap in the default folder`n`nScript will restart after you click ok.
- reload
- }
- else
- minicap=%PROGRAMFILESX86%\MiniCap
- screens:=20 ;pages to shot
- maxscreens:=20 ;max pages to shot
- DefaultPicturePath= %USERPROFILE%\Pictures\Frontier Developments\Elite Dangerous
- Menu, TRAY, Tip , Elite Dangerous Market Auto Screenshot Taker Beta 0.5
- Menu, TRAY, NoStandard
- Menu, TRAY, Add , Exit Script , ExitSub
- Menu, TRAY, Add , Reload Script , ReloadSub
- Menu, TRAY, Add
- Menu, TRAY, Add , Change Settings, SettingsGui
- Menu, TRAY, Default , Change Settings
- ;----------------------Mainprogram-----------------
- IfNotExist ScreenGrab.ini
- {
- gosub reset
- sleep 100
- gosub settingsgui
- /*
- to do:
- write errorhandler
- */
- }
- else
- {
- ;IniRead, OutputVar, Filename [, Section, Key, Default]
- IniRead, hotkey, ScreenGrab.ini , Keysettings , Hotkey
- IniRead, Win, ScreenGrab.ini , Keysettings , Win
- IniRead, PicturePath, ScreenGrab.ini , PathSettings , PicturePath
- gosub parsekey
- Hotkey , %ParsedKey% , ScreenLoop , On
- }
- ;-------------Functions----------------------
- dummy:
- return
- SettingsGui:
- Gui, 1:Add, Text, x36 y7 w586 h190 , ED Market Auto Screenshot Taker:`n`tTakes Screenshots of all Comodities availible in the current Market.`n`n`tUsage:`n`t`tSet up here. (Setup is later availble from the Tray icon context menu or by double clicking the tray icon)`n`t`tPress Hotkey while in ED Comodity Market abd wait for all the shoots to happen.`n`t`tPress OK, save and make the Hotkey active`n`n`tImportant! Keep hands of controls while the grabing is happen.`n`n`t`t`t"Change Settings" will bring up this menu`n`t`t`tThe rest of Menu should be selfexplaining`nTo Do: Implementing reading ED control settings for more comfort. `t Writing Errorhandlers for more stability`nCopyright by BiZZ Keryear under CC by-sa 3.0 http://creativecommons.org/licenses/by-sa/3.0/
- Gui, 1:Add, Text, x6 y207 w110 h20 , Assigned Hotkey:
- Gui, 1:Add, Checkbox, x126 y207 h20 vWin Checked%Win%, Win key+
- Gui, 1:Add, Hotkey, x190 y207 w230 h20 vhotkey, %hotkey%
- Gui, 1:Add, Text, x430 y202 w230 h40, (field can contain any key, but win key.`nWin key has to be assigned with checkbox)
- Gui, 1:Add, Text, x6 y237 w110 h20 , Save Screenshots to:
- Gui, 1:Add, Text, x126 y237 w470 h20 , %PicturePath%
- Gui, 1:Add, Button, x606 y237 w60 h20 gChange, Change
- Gui, 1:Add, Button, x190 y267 w100 h30 Default ,&OK
- Gui, 1:Add, Button, x410 y267 w100 h30 gResetd ,&Reset to default
- Gui, 1:Show,, ED Market Auto Screenshot Taker Beta 0.5 -- Settings:
- Return
- Change:
- inputbox , nPicturePath , Change Path to Screenshoots, Type or Paste in here the path where the screenshots shall be saved:,,800,120,,,,,%PicturePath%
- if Errorlevel
- Errorlevel =
- else
- {
- PicturePath := nPicturePath
- nPicturePath =
- }
- gui , 1:destroy
- gosub SettingsGui
- return
- ButtonOK:
- Gui, 1:submit
- gosub WriteSettings
- reload
- return
- parsekey:
- if Win = 1
- ParsedKey=#
- else
- ParsedKey=
- ParsedKey=%ParsedKey%%hotkey%
- return
- resetd:
- gosub reset
- gosub WriteSettings
- Gui, 1:destroy
- gosub SettingsGui
- return
- reset:
- PicturePath:=DefaultPicturePath
- hotkey=y
- Win:=1
- return
- ScreenLoop:
- SetKeyDelay , 0 , 80 ; set key delay so down key will be fetched
- loop %screens%
- {
- gosub EliteAction
- if TestEnd = 1
- {
- screens := A_Index
- break ;, down
- }
- }
- SetKeyDelay , -1 , -1 ; reset key delay
- screens=maxscreens ;cleanup
- return
- WriteSettings:
- IniWrite, 0.5 , ScreenGrab.ini, Version , Version
- IniWrite, %hotkey% , ScreenGrab.ini, Keysettings , Hotkey
- IniWrite, %Win% , ScreenGrab.ini, Keysettings , Win
- IniWrite, %PicturePath% , ScreenGrab.ini, PathSettings , PicturePath
- return
- EliteAction:
- CoordMode , Mouse , Window
- WinActivate , Elite - Dangerous (CLIENT) ahk_class FrontierDevelopmentsAppWinClass
- WinwaitActive , Elite - Dangerous (CLIENT) ahk_class FrontierDevelopmentsAppWinClass
- MouseMove , 1218, 895 ,5 ;mouse in market second last row to make it scroll
- MouseMove , 1218, 920 ,5 ;place to last row so last row is active no matter what
- if A_Index = 1
- {
- loop 100 ; scroll to top
- {
- Send {WheelUp}
- Sleep 10
- }
- Sleep 100 ; make sure program catches up
- }
- else
- {
- loop 4 ; scroll a page down
- {
- Send {WheelDown}
- sleep 300
- }
- Send s
- }
- sleep 100 ; give it a moment to appear
- loop 3 ; improve regonition by test more than once ... 10 took too long three will have to do
- {
- PixelSearch,,, 233, 963, 268, 989, 0x35A5FF , 35 ;color may vary so high tollerance
- if !ErrorLevel
- TestEnd:=1
- ;sleep 10 ; give it a very little time ... took too long reliable but too slow has to work this way
- }
- Mousemove , 1596, 360 , 5 ; Side pannnel = clears highlight
- SoundPlay, %minicap%\CAMERA.WAV ; feedback shot is taken
- runwait , %minicap%\MiniCap.exe -closeapp -exit -captureactivewin -save "%PicturePath%\Screenshot_$uniquenum0$.png" -compress 10 , %minicap% ,, miniid ;use Hide in empty space if things are working out
- return
- ExitSub:
- ExitApp
- return
- ReloadSub:
- reload
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement