npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-gimx

v1.2.5

Published

Send commands to gimx via js

Downloads

17

Readme

node-gimx

Send commands to gimx via js. Currently, only Playstation is supported.

#Quickstart

var gimx = require('node-gimx');  
var g = new gimx({
	path: 'C:\\Program Files\\GIMX\\',
	host: '127.0.0.1',
	port: '51914'
});  
g.press("cross");  

#Macros
Macros are a chainable method of combining multiple commands into a set of instructions. press(), release(), hold(), and wait() are supported.

To add a macro:

g.macro('test')
  press/wait/hold/release
  .add();

To execute a macro:

g.macro('test')
  .run()

For example, to press left, wait a second, then press right:

g.macro('test')
  .press('left').wait(1000)
  .press('right')
  .add()

g.macro('test')
  .run()  

Macros can also contain other macros. The following would press left, wait a second, press right, wait a second, press up, wait a second, then press down:

g.macro('test1')
  .macro('test').wait(1000)
  .press('up').wait(1000)
  .press('down')
  .add()

g.macro('test1')
  .run()
  

A macro can also be repeated:

g.macro('test1')
  .run(true)
  

#Events

g.on('completed-macro-test', function() {
  //do stuff
});

completed-macro-name
Emitted when a macro named 'name' has completed

started-macro-name
Emitted when a macro named 'name' has started

repeated-macro
Emitted when the top-level macro has started over, given macro.run(true)

send-success
Emitted when a command is successfully sent to gimx

send-failure
Emitted when a command fails to be sent to gimx

#Options
path - string, path to gimx.exe
host - string, host of remote gimx
port - string, port of remote gimx
debug - boolean, prevents sending calls to gimx

#Methods
Macro(name)
string name - name of the macro

Add()
*To be chained with macro()

Run(repeat)
boolean repeat - if set to true, repeats the macro after finishing
*To be chained with macro()

Stop()
Stops all running macros and clears the action queue *To be chained with macro()

isRunning(name)
string name - name of the macro
Returns true if macro named name is currently running
*To be chained with macro()

Press(button, pressure)
string button - a valid button
optional number pressure - a number from 0 to 1 representing how far down the button is pushed. Defaults to 1.
*A press call automatically releases all other buttons. This is a feature of gimx.

Release(button)
string button - a valid button

Hold(button)
string button - a valid button

#Buttons
Pressure 0-1
"lstick x", "lstick y", "rstick x", "rstick y ", "acc x", "acc y", "acc z", "gyro", "up", "right", "down", "left", "triangle", "circle", "cross, "square", "l1", "l2", "r1", "r2"

Pressure 0 or 1
"select", "start", "PS", "l3", "r3"

#Licence The MIT License (MIT)

Copyright (c) 2015 Stephen Poole

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.