Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

MasterFocus's Code Repository


  • Please log in to reply
No replies to this topic
MasterFocus
  • Moderators
  • 4323 posts
  • Last active: Jan 28 2016 01:38 AM
  • Joined: 08 Apr 2009
####################################################################################
This old forum will be archived ( see https://autohotkey.c...s-decommission/ ).
For my up-to-date code and information, check the following links:
http://git.io/master | https://github.com/MasterFocus | http://masterfocus.ahk4.net/ | https://sites.google...masterfocusahk/
####################################################################################


MasterFocus's Home Topic
(will not be updated anymore - see note above)

================================================================= 
License
Unless differently specified, all my code is usually licensed under GNU AGPL v3.0.
Please make sure you refer to this topic and/or one of my webpages when reproducing any code.
Although it's not really necessary, I'd appreciate if you contact me when using my code.
=================================================================
 
Code catalog without links
This should work as an index for searching my code on the forum.

LIBRARIES
 
• General Proxy-Dll Functions a.k.a. GPF
      Overlay DirectX8/9 applications with multiple texts and one image. Also takes screenshots and shows FPS.
• Type Functions
      A group of functions to check, retireve and compare AHK variable types.
 
FUNCTIONS
 
• WaitPixelColor
      Waits for a pixel to be of a certain color. Features optional timeout.
• GetControlsInfo
      Retrieves name, handle, position and size of all controls from a matching window.
• WRandom
      Weighted random. Specify a weight for each field: the returned value is the number of the randomized field.
• RandomVar
      Creates any kind of random content for a variable. Options include type (AHK variable type), length and ASCII range.
• GetDriveByLabel
      Retrieves the letter of the first drive that matches the given label.
• ClearArray
      Clears the specified consecutive elements of an array without accidentally creating new elements/variables.
        [ probably obsolete as AHK v1.1.* supports real arrays (objects) ]
• GetFromList
      Retrieves a certain number of random items or all items containing a substring with optional matching position.
• RegExSort
      Returns a sorted version of an input list based on a RegEx needle and a precedence order for any subpatters.
• Dec2Roman + Roman2Dec
      A pair of functions created to perform convertions between decimal and roman numbers.
• ImageSearchList
      Finds multiple instances of a specified image on screen and returns a list of matching coordinates.
        [ the current implementation is WRONG! I will discontinue this function and upload a replacement later ]
• GetTuples + Combine
      A useful pair of functions for arrangements, tuples, combinations, permutations...
        [ related work by other users can be found within the topic ]
• Cycle
      Automatically cycle through a list of elements with ease. No need to declare a bunch of variables.
• GetRandom
      Simple short function which makes a random choice out of a given set.
• MouseMove_Ellipse
      Moves mouse from one point to another using an ellipse instead of a straight line. Based on previous work by Wicked.
• WinMoveSpecial
      Allows moving a target window to specific place on the screen, like TOPLEFT, BOTTOM or CENTER.
• RandomBezier
      Moves the mouse using a random trajectory, which is in fact a random Bézier curve.
• InputBox
      Yet another wrapper for the InputBox command.
 
TEMPLATES
 
• Checkboxes
      Use a simple GUI with checkboxes to work with selectable items.
• WinTrigger (former OnOpen/OnClose)
      Perform actions upon (de)activation or (un)existance of certain windows/programs.
• Grid Template
      This template is useful for finding the best way to visually distribute elements into a grid shape.
• Benchmarking Template
      Specially designed to compare two routines and show detailed results of the bechmark, possibly electing a winner.
        [ licensed under CC BY-SA 3.0 ]
 
MY CONTRIBUTIONS TO ROSETTACODE
All code submitted to RosettaCode becomes available under GNU FDL 1.2 by default
 
• Hailstone Sequence
      Calculates the Hailstone sequence (and its length) for a provided initial number.
• Price Fraction
      A specialised rounding function to work according to a certain table.
• Number Reversal Game
      A game where you get a jumbled list of numbers (1-9) and must attain the ascending order by only reversing them from the left side.
• String Repetition
      An example showing the simplest way to repeat a string in AutoHotkey.
• Dot Product
      A simple function which computes the dot product (aka scalar product) of two vectors.
• The N-Queens Problem
      A function that uses a few global variables and solves the N-Queens Problem.
• Missing Permutations
      Function designed to find one or more missing permutations of a given set.
• HQ9+ Interpreter
      A small simple function which executes a HQ9+ code.
 
OTHER SCRIPTS AND CODE SNIPPETS
 
• Bejeweled Autoplay
      A framework developed to autoplay a free Flash version of Bejeweled 2.
        [ the game webpage has already been redesigned, possibly affecting automation ]
• Drawing a spirograph + CoordSpirograph()
      Helper script for drawing a customizable spirograph.
• WinLimit a.k.a. XPSnap / XP Snap
      "A script that mimics Windows 7 Aero Snap", as stated in DataLife's original post.
        [ however, it doesn't change the size of the window (on WinXP) ]
• VK() a.k.a. Hotkey2Virtual Key
      A function to convert a hotkey into its virtual key code. Created in conjunction with other users.
 
============================================================================
Reminders to myself:
 
[1] add GetWindowsByStyle()
    http://www.autohotke...ws/#entry318484
[2] add Gdip_ImageSearch()
[3] add CenterControl()
    http://www.autohotke...-centercontrol/
[4] add the "mantain GUI aspect ratio" script
    http://www.autohotke...-when-resizing/
[5] add all the following references to my stuff:
http://www.rossgoodm...out-of-outlook/
http://forums.eagle....d.php?p=1308590
http://www.hiasm.com...ic.php?p=219670
http://forum.lockon....308010&langid=2
http://forum.script-...pic.php?id=5469
http://ahk8.com/Thread-【Krup】个人索引贴
http://ahk8.com/Thre...里面显示文字或者图片的-效果图
http://bbs.themex.ne...23&postcount=18