This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------------------------------------------------------------------------------- | |
function UserAI.onKeyboardKeyDown ( kKeyCode ) | |
-------------------------------------------------------------------------------- | |
local sState = application.getCurrentUserAIState("UserAI") | |
if( sState == "Menu" ) | |
then | |
if( kKeyCode == input.kKeyUp ) | |
then | |
this.changeSelection() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------------------------------------------------------------------------------- | |
function UserAI.Menu_onLoop ( ) | |
-------------------------------------------------------------------------------- | |
local up = this.getKey( 0, "up", true ) | |
local enter = this.getKey( 0, "enter", true ) | |
if( up ) | |
then | |
this.changeSelection() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var home = { | |
name : "home", | |
latitude : "0", | |
longitude : "0", | |
location : "Home" | |
}; | |
function createRegion(location, enterFunction, exitFunction){ | |
var region = device.regions.createRegion({ | |
latitude: parseFloat(location.latitude, 10), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------------------------------------------------------------------------------- | |
function droneControl.allocateDrone ( ) | |
-------------------------------------------------------------------------------- | |
for i = 0, this.nDronePoolSize ( ) - 1 | |
do | |
--if the entry is false the pool item is free | |
if( table.getAt ( this.tDroneFree ( ), i ) == false) | |
then | |
--allocate the entry |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Zerg Defense | |
// @namespace http://mobilecoder.wordpress.com | |
// @version 1.0 | |
// @description The Zerg Rush is coming, prepare yourself! | |
// @match https://www.google.com/search?q=zerg+rush* | |
// ==/UserScript== | |
var doMouseEvent = function(element, args) { | |
var event = document.createEvent("MouseEvents"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------------------------------------------------------------------------------- | |
function YourAI.findLastIndexOf ( sString, sPattern, nIndex ) | |
-------------------------------------------------------------------------------- | |
local firstIndex = string.findFirst ( sString, sPattern, nIndex ) | |
if(firstIndex == -1) | |
then | |
return nIndex - 1 | |
else | |
return this.findLastIndexOf ( sString, sPattern, firstIndex + 1 ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------------------------------------------------------------------------------- | |
-- Function......... : cycleValue | |
-- Author........... : Zachary Burke | |
-- Description...... : Increases or decreases a variable, handles wrapping the | |
-- value as well. | |
-- | |
-- Examples: | |
-- Say you have a variable nCounter where the max value is 5 and the minimum is 0 | |
-- | |
-- Increment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Google Analytics Realtime Alerts | |
// @namespace http://mobilecoder.wordpress.com | |
// @version 1.0 | |
// @description Plays a sound when you get a new user, you can change the sound by hosting your own file on dropbox or other web location | |
// @match https://www.google.com/analytics/web/?hl=en#realtime* | |
// ==/UserScript== | |
// Your custom sound goes here | |
mCoinSound = new Audio("https://dl.dropbox.com/u/7079101/coin.mp3"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//----------------------------------------------------------------------------- | |
// Basic Instructions for getting Kongregate into your export | |
// In your shiva project, anytime you want to send something to Kongregate stats API you will | |
// call: | |
// system.callClientFunction ( "onEngineEvent", sStatisticType, sStatisticName, nValue ) | |
// where sStatisticType is a Kongregate statistic type like "add", "max", "replace" | |
// sStatisticName is the name of the statistic you've defined on Kongregate | |
// nValue is the value to send | |
// Example: system.callClientFunction ( "onEngineEvent", "add", "deaths", 1 ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'csv' | |
require 'mechanize' | |
# OUYA dev stats scraper | |
# | |
# This job will download the downloads and purchases csv files from | |
# the OUYA dev portal and, based on the purchase identifier and | |
# game title, will send download, sales and conversion ratio to | |
# the dashboard. |