Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using RszTool;
namespace IntelOrca.Biohazard.BioRand.RE4R.Extensions
{
public static class RszExtensions
{
/// <reference path="C:\Users\Ted\Documents\GitHub\openrct2\distribution\openrct2.d.ts" />
function open() {
var width = 300;
var height = 200;
var w = ui.openWindow({
x: (ui.width - width) / 2,
y: (ui.height - height) / 2,
width: width,
height: height,
/// <reference path="C:\Users\Ted\Documents\GitHub\openrct2\distribution\openrct2.d.ts" />
var perf =
['tick',
[
['update', [
'rides',
'entities',
'network',
'scripting'
Function Name Total CPU [unit, %] Self CPU [unit, %] Module
+ openrct2.exe (PID: 10588) 19379 (100.00%) 0 (0.00%) openrct2.exe
| - [External Code] 19360 (99.90%) 127 (0.66%) Multiple modules
| - GameActions::Execute 18342 (94.65%) 0 (0.00%) openrct2.exe
| - game_load_or_quit_no_save_prompt 18342 (94.65%) 0 (0.00%) openrct2.exe
| - WindowManager::OpenWindow 18342 (94.65%) 0 (0.00%) openrct2.exe
| - context_open_window 18342 (94.65%) 0 (0.00%) openrct2.exe
| - context_handle_input 18342 (94.65%) 0 (0.00%) openrct2.exe
| - __scrt_common_main_seh 18342 (94.65%) 0 (0.00%) openrct2.exe
{
"openapi": "3.0.1",
"info": {
"title": "Composition Library API Reference",
"description": "API reference for Composition Library.",
"termsOfService": "https://complib.org/terms",
"contact": {
"email": "support@complib.org"
},
"version": "1.0.0"
@IntelOrca
IntelOrca / network-stats.js
Created January 31, 2021 23:24
OpenRCT2 plugin for network stats
/// <reference path="C:\Users\Ted\Documents\GitHub\openrct2\distribution\openrct2.d.ts" />
var NETWORK_STATS_WINDOW_CLASS = 'network-stats';
var DEBUG = true;
var MOCK_STATS = DEBUG;
function openNetworkStats() {
var StatKind = {
receive: 0,
send: 1
@IntelOrca
IntelOrca / async-plugin.ts
Created January 29, 2021 23:43
Example of an async OpenRCT2 plugin
/// <reference path="C:/Users/Ted/Documents/GitHub/openrct2/distribution/openrct2.d.ts" />
function nextTick() {
return new Promise<void>((resolve, reject) => {
try {
const subscription = context.subscribe('interval.tick', () => {
try {
subscription.dispose();
resolve();
} catch (e) {
// Copyright (C) 2020 Micro Focus or one of its affiliates.
import fs from 'fs';
// Open the given vsix file and patch the Linux debug adapter binary to be executable
if (process.argv.length < 3) {
console.log("usage: rezip <vsix>");
process.exit(1);
} else {
let vsixPath = process.argv[2];
/// <reference path="C:/Users/Ted/Documents/GitHub/openrct2/distribution/openrct2.d.ts" />
var main = function () {
context.subscribe('action.query', function(e) {
console.log("Query Action:");
if (!e.isClientOnly && e.type != 3 && e.type != 4)
console.log(e);
});
context.subscribe('action.execute', function(e) {
console.log("Execute Action:");
/// <reference path="C:\Users\Ted\Documents\GitHub\openrct2\distribution\openrct2.d.ts" />
var doDownloadHtml = function(url, callback) {
var socket = network.createSocket();
var allData = "";
socket.on('close', function() {
console.log('socket closed');
callback(allData);
});
socket.on('data', function(data) {