Skip to content

Instantly share code, notes, and snippets.

View Emojigit's full-sized avatar

1F616EMO~nya Emojigit

View GitHub Profile
@Emojigit
Emojigit / um_check_richest_person.lua
Last active January 28, 2025 07:04
Unified Money: Check richest person
local aname, aamount = nil, -math.huge
for _, name in ipairs(unified_money.list_accounts()) do
local amount = unified_money.get_balance(name)
if amount > aamount then
aname = name
aamount = amount
end
end
-- nlvcross: LuaATC for Andrew's Cross
local next, setstate = next, setstate
local S, F = S, F
-- System -> Number of crosses
-- Crosses should be named <system>#
F.systems = {
["OLV_S"] = 4,
}
function advtrains.wagon_entity_pairs()
local ent = minetest.luaentities
local ent_i = 1
return function()
while ent_i <= #minetest.luaentities do
local wagon = ent[ent_i]
ent_i = ent_i + 1
if wagon.is_wagon then
return ent_i, wagon
@Emojigit
Emojigit / snip_cycle_pub_farm_restore.lua
Created August 15, 2024 15:59
Repair broken farmland
-- snip_cycle/pub_farm_restore
local name = ...
local pos1 = vector.new(8387,1,3122)
local pos2 = vector.new(8428,1,3220)
local player = minetest.get_player_by_name(name)
if not player then return end
local meta = player:get_meta()

From ChatGPT

This code is written in JavaScript and utilizes the Web3 library to interact with an Ethereum blockchain node. Here's a breakdown of what the code is doing:

  1. Importing the necessary modules from the 'web3' library. It uses the Web3 class and the utils module.
const { Web3, utils } = require('web3');
// ==UserScript==
// @name AntiSomeBadHosts
// @namespace 1F616EMO/TDProject_Browser_Script
// @description You know the purpose
// @version 1
// @grant unsafeWindow
// @grant GM.notification
// @include *
// @run-at document-start
// ==/UserScript==
@Emojigit
Emojigit / ccr_signal_compact_stoprail.lua
Last active January 16, 2023 10:51
LuaATC Rail Code: Wait for green light before closing the door
-- ccr_signal_compact_stoprail.lua
-- LuaATC Rail Code: Wait for green light before closing the door
local stn_name = "Example Station" -- Station name to be shown inside the train
local stn_subtitle = "Interchange: COL1 CE1" -- Station information to be shown at arrive but not when approaching
local door_side = "L" -- Either L, R or C
local minimum_stop_time = 10 -- In second
local kick_passenger = false -- Kick out passengers right after the door is open
local reverse = false -- Reverse the train before leave
local signal_pos = POS(0,0,0) -- Either a passive component name or position table
local match = function(line,rc) -- Should return a route name if the train should stop, or nil if not
@Emojigit
Emojigit / ccr_sort_trains.lua
Last active November 12, 2022 21:24
Advtrains Train Yard Sorter
-- ccr_sort_trains.lua
-- Copyright (c) 2022 Cato
--[[ CONFIG START ]]--
-- Configured for C&C By The Way Yard.
-- Name of the Train Yard, to build unique debug messages.
local name = "CcrY-Btw"
-- Passive component name, or coordinate, of the signal to be controlled.
@Emojigit
Emojigit / cursorGame.lua
Created July 1, 2022 14:21
(Failed) Luacontroller cursor moving game (multiplayer via digiline)
local controlls = "cont" -- W A S D
local display = "disp"
local debugc = "debug"
local game = "game"
local disp_height = 6
local disp_width = 20
local machineID = "TM1"
-- ATLATC wrapper START
if not S["TextGame_" .. machineID] then S["TextGame_" .. machineID] = {} end
<!DOCTYPE HTML>
<?php
GLOBAL $error, $uname, $passwd, $host, $port, $mt_proto_url;
$pattern = "{\/?(([a-zA-Z0-9_-]+)(:(\S+))?@)?(\S+):(\d{1,5})\/?}";
$target = $_SERVER['REQUEST_URI'];
$error = false;
if (preg_match($pattern, $target, $matches)) {
if ($matches[5] && $matches[6]) {
$uname = $matches[2];