Skip to content

Instantly share code, notes, and snippets.

View harryhare's full-sized avatar

harryhare harryhare

View GitHub Profile
@harryhare
harryhare / scoreboard_with_junk.js
Last active March 9, 2022 01:04
scoreboard for dark forest lobby game with junk score
function print_score(players) {
console.log(`total ${players.length}`);
for (let player of players) {
console.log(`${player.player}: ${player.score}`)
}
}
function sort_players(m) {
let a = Array.from(m);
a.sort((a, b) => {
@harryhare
harryhare / scoreboard.js
Last active March 9, 2022 01:03
scoreboard for dark forest lobby game
function print_score(players) {
console.log(`total ${players.length}`);
for (let player of players) {
console.log(`${player.player}: ${player.score}`)
}
}
function sort_players(m) {
let a = Array.from(m);
a.sort((a, b) => {
@harryhare
harryhare / df_gas.js
Created February 27, 2022 13:57
change gas price for dark forest
/**
* Remember, you have access these globals:
* 1. df - Just like the df object in your console.
* 2. ui - For interacting with the game's user interface.
*
* Let's log these to the console when you run your plugin!
*/
console.log(df, ui);
class Plugin {
@harryhare
harryhare / df_planet_tool.js
Created February 27, 2022 03:45
find & refresh & look into invader of a planet
class Plugin {
constructor() {
let jump_contaienr = document.createElement("div");
jump_contaienr.style.width = '100%';
jump_contaienr.style.height = '26px';
jump_contaienr.style.display = 'block';
let idInput = document.createElement('input');
idInput.placeholder = 'planet id';
// idInput.style.color = 'black';
@harryhare
harryhare / dark_forest_grid.js
Last active February 23, 2022 01:17
dark_forest grid plugin
class Plugin {
constructor() {
}
draw(ctx) {
const viewport = ui.getViewport();
ctx.save();
//ctx.fillStyle = "red";
//ctx.strokeStyle = "red";
//ctx.strokeStyle = "dashed";
@harryhare
harryhare / untrusted.md
Created April 21, 2021 07:26
solution to game untrusted

solution to game untrusted

*level 6

   let c=0;
        map.defineObject('attackDrone1', {
        'type': 'dynamic',
        'symbol': 'd',
        'color': 'red',
        'onCollision': function (player) {
@harryhare
harryhare / maze.py
Last active April 25, 2019 08:49
4 ways to generate maze 四种迷宫生成方法
from matplotlib import pyplot
from matplotlib import cm
import numpy as np
import random
def show(image,name=None):
pyplot.imshow(image, cmap='gray', interpolation='none')
if name==None:
pyplot.show()
@harryhare
harryhare / Stardew Valley.CT
Last active January 12, 2019 16:54
stardraw valley save file edit (星露谷游戏存档修改,Artifact Spot, item stack/ quality)
<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="26">
<CheatEntries>
<CheatEntry>
<ID>19</ID>
<Description>"cost no stamina(AOB)"</Description>
<LastState/>
<VariableType>Auto Assembler Script</VariableType>
<AssemblerScript>{ Game : Stardew Valley.exe
Version:
package main
import (
"encoding/pem"
"errors"
"crypto/x509"
"crypto/rsa"
"crypto/rand"
"fmt"
"encoding/base64"
@harryhare
harryhare / reflect.go
Created November 13, 2018 07:18
用interface 传递slice指针作为函数参数,并填充
const maxIdle = 2
const address = "127.0.0.1:6379"
var pool = redis.Pool{
MaxIdle: maxIdle,
Dial: func() (redis.Conn, error) {
return redis.Dial("tcp", address)
},
TestOnBorrow: func(c redis.Conn, t time.Time) error {