[UCR Plugins] Latest: Cursor - Multiple mice/cursors. (2017-02-11): APM - Action per minute counter.

Post gaming related scripts
Helgef
Posts: 2107
Joined: 17 Jul 2016, 01:02
Contact:

[UCR Plugins] Latest: Cursor - Multiple mice/cursors. (2017-02-11): APM - Action per minute counter.

12 Nov 2016, 17:20

Edit: 2017-04-10
Updated the Zoom plugin.


This thread houses the following custom user plugins for UCR, descriptions are available a few posts down, see,
Note that some of these plugins can be linked to eachother via the link tab, that is, they can trigger in chain. This is a very experimental feature, but could be useful.



Zoom - Update - Version 2.1.1 (2017-04-10)

Update - Version 2.1.1 (2017-04-10): Fixed bug fix bug :wtf:
Update - Version 2.1 (2017-04-09): Bug fix, Added new feature: Show cursor on zoom window, mapped from source rectangle.
Mini update (2017-01-04): Added CodeThread to linkTypes array.
Update - Version 2. (2016-12-05)
This has been, quite extensivley, updated. Most importantly, I have fixed a bug so you can now have multiple instances of the plugin without weird results. The previous description still holds, these are the new features, in summary:

Features for convenience
  • Click and drag to select custom zoom box coordinates.
  • Click and point to select custom pop-up location.
  • Linking of multiple plugins, such that one hotkey can trigger more than one. (Very experimental, code was made in another context, seems mostly ok)
Features for usage
  • On-the-fly zoom, i.e., click and drag over area of interest, to zoom in (or out) on it. (Highlighted in demo 2)
  • Option to make zoom window click-throughable, this prevents it from captureing the mouse, and hence taking away control from the source (game). Recommended for zooming an FPS, the original purpose of this plugin.
  • Option to hide the source. Caveat: Don't use together with Source->Use active window. (Highlighted in demo 1)
  • Interactive clicks, (left and/or right) mouse clicks on the zoom pop-up are mapped to the source. Two methods, 1) ControlClick, source need not be visible, 2) Click, more reliable but source needs to be visible, no drag possible. (Highlighted in demo 2)
  • Optional hotkey to move the zoom pop-up.
Video preview.


  • Demo 1, shows hiding of source, and interactive clicks, method 1. Zooms out a browser window and interacts with the youtube video player
  • Demo 2, shows on-the-fly zoom, randomly zooming some small images.
Download. (Version 2.1.1)


zoom.ahk
(77.57 KiB) Downloaded 66 times

Additional credits.


  • Mouse effects for Demo 1:
mright wrote:Mouse ripple effect


Original post. (2016-11-12) Edit: removed code, use v2.1.

Introduction.


This is a user plugin for Universal Control Remapper - UCR, v0.1.5, with the purpose to enable zooming in or out on any part of any window.
This was originally a request at this thread. Some features are a consequence of that.

Features.


List of main features:
  • The zoom is live, meaning any change on the source window is imediately seen on the zoom window.
  • Toggle zoom on/off or zoom only while holding the selected hotkey.
  • Choose whether to include non-client area or not.
  • Point and click to select source (Source tab -> Get Source button).
  • Option to specify a custom rectangle on the source window to zoom. By default, the center of the window is zoomed. (See preview 1)
  • Option to specify where on the screen the zoom pop-up window will be placed.
  • Preset pop-up locations to match source corner, could be useful for something like a minimap zoom. (See preview 2)
  • Option to disable zoom when source is not the active window.
  • By courtesy of the UCR, settings are preserved and very nice hotkey selection functionality.
  • Very low CPU usage.

Animated gif preview.


Preview 1

Preview 2

Installation.


Download UCR, unzip, no installation required, save this plugin to UCR\Plugins\User\zoom.ahk. Start UCR, Select Zoom from the Plugin Selection dropdown list, click Add.

Setup.


You need to select a hotkey to toggle the zoom, and a source window, that is, select the window to zoom. You can choose to zoom the currently active window.
Options should be mostly self-explanatory, if you have questions, please ask.

About the implementation.


The display of the source window on the zoom pop-up window, is handled by the DWM, specifically, a thumbnail relationship between the source window and the pop-up window is registred, then it is just a matter of making some simple coordinate tranformations to get the correct size and placement.
To make something similar, or to make this independent of UCR, you basically just need the dwm_ functions, the rest of the code is mostly settings handling and simple coordinate tranformations. You can follow the links in the comments to learn more, or, feel free to ask.

Known limitations and problems.


  • Requires Windows Vista or newer OS.
  • Probably doesn't work in fullscreen.
  • Hide mouse cursor option doesn't seem to work reliably. I do not know why.
  • You cannot select mouse wheel up or down as hotkeys (for now).
  • When Only zoom client frame-option is used, some source windows, eg ones with a menu, might not be correctly zoomed. This is due to GetClientRect and DWM not agreeing on what is the client-area. As a workaround, specify a custom source rectangle.
  • All combinations of available settings are not really meant to used, but you still can. Result may be awkward.
  • Limited testing.

Cretdits.


  • evilC for making UCR.
  • ShareX for software to record gif, very nice tool, check it out!
  • Gif previews are hosted by giphy.com - I do not know for how long they will be available.

Misc.


A brief comment on the choise of format, although this is not a control remapping, making it as a UCR plugin, is a convenient way to wrap a simple class in a GUI, making it easy to use for non-programmers (most gamers). Also, save me the time to explain how to use this :wave:

Good luck and have fun!
Last edited by Helgef on 10 Apr 2017, 10:45, edited 7 times in total.
User avatar
evilC
Posts: 3412
Joined: 27 Feb 2014, 12:30

Re: [UCR Plugin] Zoom - Zoom in or out any window.

13 Nov 2016, 13:47

Awesome, officially the first plugin for UCR that was written from scratch by someone other than myself :)
Thank you so much for the time you put into this Helgef, and the feedback that you have provided.

I have a bit of a nasty bug that I am chasing at the moment, but I hope to try and address the mouse wheel issue soon.
guest3456
Posts: 2016
Joined: 09 Oct 2013, 10:31

Re: [UCR Plugin] Zoom - Zoom in or out any window.

13 Nov 2016, 13:49

Helgef wrote:Animated gif preview.


Preview 1


quake3 ?????


Helgef wrote: Gif previews are hosted by giphy.com - I do not know for how long they will be available.

probably a while:
https://techcrunch.com/2016/02/16/giphy ... valuation/

Helgef
Posts: 2107
Joined: 17 Jul 2016, 01:02
Contact:

Re: [UCR Plugin] Zoom - Zoom in or out any window.

13 Nov 2016, 14:33

evilC wrote:Awesome, officially the first plugin for UCR that was written from scratch by someone other than myself :)

Cheers! :D
guest3456 wrote:quake3 ?????

Yes :dance: I think its from quakecon 2015, good stuff. Also, I didn't realise until now, it is evil playing, no relation with evilC I supose?
guest3456 wrote:probably a while:

Cool.
Helgef
Posts: 2107
Joined: 17 Jul 2016, 01:02
Contact:

Re: [UCR Plugin] Zoom - Zoom in or out any window.

05 Dec 2016, 06:49

This has been updated, see the first post.
When I get time to type a short description, I will share an additional, very simple plugin. It will get its home in this thread aswell.
Suns

Re: [UCR Plugin] Zoom - Zoom in or out any window.

28 Dec 2016, 19:16

Hi, I am getting: Failed to register thumbnail relationship error.

I am on windows 7.

Any idea what is causing this issue?
Helgef
Posts: 2107
Joined: 17 Jul 2016, 01:02
Contact:

Re: [UCR Plugin] Zoom - Zoom in or out any window.

29 Dec 2016, 00:53

It could be due to having Aero theme disabled. If that's not the case I'll need more details and refresh my memory with respect to this code.
Helgef
Posts: 2107
Joined: 17 Jul 2016, 01:02
Contact:

Re: [UCR Plugin] Zoom - Zoom in or out any window.

03 Jan 2017, 17:57

WindowStyler


This is simple plugin for moving, resize, hiding and applying a few different styles to a window. Originally it was meant to complement the Zoom plugin with the abillity to hide the source, in v2 of Zoom that was added to the plugin instead.
Some features:
  • Resize (custom or full screen)
  • Move
  • Hide/show
  • Minimise/maximise
  • Activate/send to bottom
  • Set transparency
  • Remove borders and caption
Known limitations:
  • Resize to full screen do not consider multi-monitor setups.
  • Very limited testing.
Download.


Save as WindowStyler.ahk

Code: [Select all] [Expand] [Download] (WindowStyler.ahk)GeSHi © Codebox Plus

Last edited by Helgef on 03 Jan 2017, 18:03, edited 1 time in total.
Helgef
Posts: 2107
Joined: 17 Jul 2016, 01:02
Contact:

Re: [UCR Plugin] Zoom - Zoom in or out any window.

03 Jan 2017, 17:59

CodeThread


A variant of the built-in Code Runner plugin. This plugin gives option to run (AHK_H) code in a new thread. Can be used for, eg, creating hotkeys that runs in parallel. For example, running this code in one script, would only allow for one of the ToolTip to be updated at a time.

While putting each hotkey in a new thread, allows both to be updated simultaneously.
Some features:
  • Run code in new thread or wait for it to finish
  • Trigger code to start/stop via hotkey or button. (Wait to finish code cannot be stopped by other means than closing UCR)
  • Option to select tray icon for new thread, or to omit it.
  • Edit control has tab stops and and monospaced font
Known limitations:
  • Very limited testing.
Download.


Save as CodeThread.ahk

Code: [Select all] [Expand] [Download] (CodeThread.ahk)GeSHi © Codebox Plus

Last edited by Helgef on 03 Jan 2017, 18:02, edited 1 time in total.
Helgef
Posts: 2107
Joined: 17 Jul 2016, 01:02
Contact:

Re: [UCR Plugin] Zoom - Zoom in or out any window.

03 Jan 2017, 18:01

Developer plugin


A very simple plugin that facilitates (developer) usage of UCR. Recomended to be initialised in the SuperGlobal profile.
All features, via hotkeys:
  • Reload UCR
  • Activate UCR main window
  • Save settings
Download.


Save as developer.ahk

Code: [Select all] [Expand] [Download] (developer.ahk)GeSHi © Codebox Plus

User avatar
evilC
Posts: 3412
Joined: 27 Feb 2014, 12:30

Re: [UCR Plugins] Zoom and a few more.

11 Jan 2017, 17:06

I am intrigued by this Link system you have.

What is the purpose of the "When linked to by same type / different type" options?
And similarly the "Select plugin to run for case" option in the WindowStyler

Being able to reference plugins from one another has always been something I wanted to introduce, but I have never really examined the kind of use-cases that I would like to support. A basic plugin selector would probably be fairly easy to implement - the profile select control and associated menus could quite easily be expanded to accommodate selection of plugins, and it could work in a similar way - ie you get a callback if something about the linked plugin changed (Name or Path).

Also, bear in mind that if doing this, you should probably reference plugins by their IDs, because at some point I will also be adding the ability to rename plugins. ID will remain constant, even if the plugin moves to another profile (Another planned feature).
Guest

Re: [UCR Plugins] Zoom and a few more.

12 Jan 2017, 12:57

evilC wrote:What is the purpose of the "When linked to by same type / different type" options?

I understand that it is not obvious :lol:
I'll try to explain with an example.
Let's say you have two Zoom plugins in a profile, A, and B. Now, if you set up plugin A like,Link -> Select Plugin to run for case -> Zoom in and select plugin B in the listbox below, that means that when plugin A is zoomed in, plugin in B will be called, and what will happen when plugin B is called from plugin A is determined by your choise in the When linked to by same type dropdown list of plugin B. So if you for example chooses plugin B to Match case, it will do the same thing as the plugin who called it did, in case of being linked to by plugin A, it would also zoom in. And this is the reason why the When linked to by different type dropdown list also exists, because if a Zoom plugin is called by a WindowStyler, you can't match cases.
evilC wrote:And similarly the "Select plugin to run for case" option in the WindowStyler

Originally, I intended the WindowStyler to be able to toggle between new style and original, but in the end it just does apply settings. So the only reason for having that dropdown list for the WindowStyler is that you can also select Never, which basically means disable linking.

The reason the linking system looks like it does, is because it comes from the image/pixel search plugin we briefly talked about some time ago, there it would make more sense because you have the case of finding or not finding the image/pixel, i.e, two cases, select one plugin to call for either case. So you get a chain of image/pixel searches that can trigger some event, eg, a key-macro.

evilC wrote:Being able to reference plugins from one another has always been something I wanted to introduce, but I have never really examined the kind of use-cases that I would like to support. A basic plugin selector would probably be fairly easy to implement - the profile select control and associated menus could quite easily be expanded to accommodate selection of plugins, and it could work in a similar way - ie you get a callback if something about the linked plugin changed (Name or Path).

All my linkable plugins have an externalCall(vars*) function, it is this function that is called, and then the called plugin handles the rest from there, depending on the settings. I originally intended, and to some extent implemented, that the caller should pass parameters to the linked plugin, via vars*, but that was bad idea, it is much better for the called plugin to simply recieve a reference to the caller, and fetch whatever it needs from the reference, it makes adding new linkable plugins much easier. For example, let's say you want to have some overlay that displays axis or button states for your remapper plugins, then an Overlay plugin could be called when, eg, the axis state of a ButtonToAxis plugin is changed, then it would be up to the overlay plugin to display the new state, hence you wouldn't need to make overlay options for all your remapper plugins. You just make one overlay plugin that handles whatever is being linked to it.

evilC wrote:Also, bear in mind that if doing this, you should probably reference plugins by their IDs, because at some point I will also be adding the ability to rename plugins. ID will remain constant, even if the plugin moves to another profile (Another planned feature).

At some point I did consider using the id, I'm not sure why I ended up using their names instead. I'll keep it in mind.

I guess the mess of this post reflects the mess of my implementation, feel free to ask whatever you didn't understand and point out whatever I missed to answer, cheers! ;)
Helgef
Posts: 2107
Joined: 17 Jul 2016, 01:02
Contact:

Re: [UCR Plugins] Zoom and a few more.

12 Jan 2017, 12:59

I did reply, but I wasn't logged in, I think my reply is waiting for a moderator to approve.
Helgef
Posts: 2107
Joined: 17 Jul 2016, 01:02
Contact:

Re: [UCR Plugins] Zoom and a few more.

10 Feb 2017, 18:59

Actions per minute (APM) and Pixel per second (PPS) counter


This is a plugin for evaluating game and/or office performance, with respect to the number of keyboard actions per minute and mouse pixels moved per second. You might be surprised how many pixels you are moving :crazy:

Main statistics APM/PPS:
  • Average APM/PPS, your average speed for the current run of the plugin.
  • Current APM/PPS, your speed based on the last x ms. Can be change via plugin GUI.
  • Top APM/PPS, the highest current APM/PPS achieved.
  • Total actions, the sum of all actions/pixels moved (Separately ofc).

You can review your performance, in the plugin GUI,
Gif preview

and via a customisable overlay,
Gif preview

Transcolor on background, border around overlay, from left to right, Average Apm, Current Apm, Total actions, Time elapsed.

Setup options for the overlay are as shown below,
Image
Overlay options. Cramped GUI.

Extended performace report

After the plugin has run, you can view a more detailed report with extended statistics and (optional) plotting of the session,
report.png
report.png (160.25 KiB) Viewed 3764 times
Plots needs SVGraph, see credits and install instructions.

Download and Installation

Download:
APM.ahk
(53.77 KiB) Downloaded 100 times
and place in UCR\Plugins\User.

If you want the plots in the report, you need to download the files for SVGraph.
You need to place four files in UCR\Libraries\SVGraph, the files are,
  • SVGraph.ahk
  • SVGraph.js
  • SVGraph.html
  • d3.v4.js
Note: The plugin runs without SVGraph, but then you don't get the plots.

Misc features

  • PPS can be disabled, but not APM. See next item for comment.
  • The list of actions to consider can be modified via, Settings->Open key setup. Here, all keys can be deactivated, and hence apm is not measured.
  • There are two methods for measuring pixel movements, the regular UCR mouse delta, recommended, and also via (experimental and not completely evaluated) low level mouse hook, might be better for office use, uses less cpu as far my testing has showed.
  • Sampling rate and update frequency, as well as Current APM interval can be modified via the plugin's GUI.
  • Reports can be saved to file, and loaded back later. Note: Before you can save a report you need to show it once.
  • Sound beep on toggle :beard:

Known issues and limitations

  • No pause.
  • No hotkey to show/hide overlay during a session.
  • File size seems acceptable, ~5 hours with a sampling rate of 5 per second yielded a 75 kb file. Having a really high sampling rate going for a long time could take up a lot of memory. Default sampling rate is 1 per second, it's probably fine. Disabling plotting via checkbox or by not including the plot files in the first place, minimises memory usage.
  • Registers all actions as hotkey ~*key, interference with UCR hotkeys has not been evaluated.
  • The overlay only shows numbers, what they mean is defined by the same order as the options for showing them in the overlay options. From left to right, or top bottom if horizontal option is unticked.

Comments on implementation.

The plugin has a nested counter class, this class handles the calculations for the current and average APM/PPS. It is independent from UCR and can be used in any ahk script for counting anything, eg, feed it words and you have a word per minute counter, with your current typing speed.

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus


The rest of the code is mostly settings and report handling.

Credits



Good luck. Cheers!
Edit: English
User avatar
evilC
Posts: 3412
Joined: 27 Feb 2014, 12:30

Re: [UCR Plugins] Zoom. New (2017-02-11): APM - Action per minute counter.

20 Feb 2017, 07:04

Wow, another mind-bogglingly intricate plugin!

I suppose I should add SVGraph (and maybe QPX?) as libs that come bundled with UCR?
Helgef
Posts: 2107
Joined: 17 Jul 2016, 01:02
Contact:

Re: [UCR Plugins] Zoom. New (2017-02-11): APM - Action per minute counter.

20 Feb 2017, 10:14

Cheers!

I guess you would, for the joy-sens graphs you mentioned in the SVGraph thread. The QueryPerformanceCounter stuff sure is handy at times,
Helgef
Posts: 2107
Joined: 17 Jul 2016, 01:02
Contact:

Re: [UCR Plugins] Zoom. New (2017-02-11): APM - Action per minute counter.

03 Mar 2017, 17:40

Cursor

Conceptual plugin. Allows multiple mouse cursors to be used simultaneously.

Some features:
  • Use multiple cursors with multiple mice, simultaneously.
  • Multiple cursors for each mouse.
  • Sensitivity setting per each cursor.
  • Cycle through cursors.
  • Buttons considered: Left, Right, Middle, XButton1, XButton2, WheelUp, WheelDown.
  • Confine cursor to any rectangle on screen.
Preview.


Image
Moving around and clicking two cursors, using two mice. :crazy:
Gif made with shareX.

How to use.


  • Click the Select mouse button with the mouse you want to use.
  • Move the mouse.
  • The mouse id should show in the edit field next to the button.
  • Select hotkey, toggle it on.
  • Optionally, set the sensitivity for the cursor.

Download.


Download:
Cursor.ahk
(20.5 KiB) Downloaded 94 times

and place in UCR\Plugins\User.

Known limitations:

  • There is no such thing as simultaneously draging.
  • There is no concept of multiple cursors in windows, this is a custom implementation.
  • Doesn't fully handle always on top for the cursors.
  • WheelLeft and WheelRight is not handled.
  • Due to windows not updating the mouse cursor quick enough, you will get the wrong cursor image under some circumstances.
  • Clicking a mouse button with mouse A at point a, and the same button with mouse B at point b (while still holding the button on mouse A), makes a click-drag between a and b. This is easy to fix. I might do it, if there is any interest :yawn:
  • There might be unexpected results if you have instances of this plugin across multiple UCR profiles.
  • One directional cycle. :arrow:
  • For testing purposes, the UCR window itself isn't the best environment, due to the single threaded nature of AHK. (It works mostly fine there though.)
  • Very limited testing. Tested only with two mice. Win7.

Misc.

The plugin uses a slightly modifed version of MouseDelta.
Feel free to use this in which ever way you like. :wave:

Edit: Bug fix, code updated 2017-03-04
Last edited by Helgef on 04 Mar 2017, 16:17, edited 1 time in total.
Helgef
Posts: 2107
Joined: 17 Jul 2016, 01:02
Contact:

Re: [UCR Plugins] Zoom. New (2017-02-11): APM - Action per minute counter.

04 Mar 2017, 03:01

xZomBie wrote:EitherMouse

Hi, xZomBie, thank you for your comment, EitherMouse seems excellent, however, as far as I understand it doesn't apply to this concept. (With reference to the Cursor plugin.)

Cheers.
User avatar
evilC
Posts: 3412
Joined: 27 Feb 2014, 12:30

Re: [UCR Plugins] Latest: Cursor - Multiple mice/cursors. (2017-02-11): APM - Action per minute counter.

04 Mar 2017, 12:55

Yeah, not the same as EitherMouse.

It does not work on my PC though, maybe because of my multi-monitor setup?
When activated, the mouse gets moved to the bottom-left corner of my monitor and i cannot move it.

If I comment out these lines. I see some life in it (can move real cursor), but the other mouse does not move the fake cursor:

Code: [Select all] [Download] GeSHi © Codebox Plus

				cur.x:= cur.x>cur.MaxX?cur.MaxX:(cur.x<cur.MinX?cur.MinX:cur.x)				; Confine
cur.y:= cur.y>cur.MaxY?cur.MaxY:(cur.y<cur.MinY?cur.MinY:cur.y)


Here is my monitor setup:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



Got using:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Return to “Gaming”

Who is online

Users browsing this forum: Jnk and 5 guests