Skip to content

Instantly share code, notes, and snippets.

@xDeda
xDeda / love.lua
Created January 4, 2016 01:52
Adoration
tfm.exec.newGame(6445588)
tfm.exec.setNameColor("Imaginist",0xFFFFFF)
tfm.exec.setNameColor("Dedax",0xFFFFFF)
tfm.exec.setUIMapName("I Love You")
tfm.exec.setGameTime(8000,true)
function eventLoop(timeRemaining,timeRemaining)
imax = tfm.get.room.playerList.Imaginist.x
imay = tfm.get.room.playerList.Imaginist.y
@xDeda
xDeda / ysearch.py
Created September 24, 2016 20:47
python script to fetch first youtube result from search with arg string
#!/usr/bin/env python
import urllib
import urllib.request
import clipboard
import sys
import gi
gi.require_version('Notify', '0.7')
from gi.repository import Notify
from urllib.parse import quote
p = peripheral.wrap("right")
i = 0
while true do
info = p.getPlayers()
if #info > 0 then
redstone.setBundledOutput("left", color.white)
@xDeda
xDeda / lettercoordinates.py
Created December 31, 2016 17:57
how to write letters via coordinates
A = [3,22] , [10,0] , [18,22] , [15,14] , [4,14]
B = [3,1] , [11,1] , [16,5] , [12,10] , [3,11] , [12,10] , [17,16] , [10,22] , [3, 22] , [3,1]
C = [17,4] , [10,0] , [4,4] , [1,12] , [4,19] , [10,22] , [17,18]
D = [3,0] , [11,1] , [15,4] , [17,11] , [16,18] , [13,21] , [6,23] , [3,23] , [3,0]
E = [3,0] , [16,0] , [3,0] , [3,10] , [14,10] , [3,10] , [3,22] , [16,22]
F = [3,0] , [15,0] , [3,0] , [3,10] , [14,10] , [3,10] , [3,22]
G = [16,3] , [9,0] , [3,3] , [1,10] , [4,20] , [10,22] , [16,20] , [16,11] , [10,11]
H = [3,0] , [3,22] , [3,10] , [15,10] , [15,0] , [15,22]
I = [3,0] , [15,0] , [9,0] , [9,22] , [3,22] , [15,22]
J = [4,0] , [15,0] , [15,18] , [12,21] , [8,23] , [5,22] , [3,19]
toDespawn={} -- define a table variable that you can put spawned items into
--
function eventMouse(name,xco,yco) -- name = name of clicker, xco = x cord of click, yco = y cord of click
ax = tfm.get.room.playerList[name].x -- x cord of mouse that clicked
by = tfm.get.room.playerList[name].y -- y cord of mouse that clicked
x = ax - xco -- x cord of mouse minus x cord of click
y = by - yco -- y cord of mouse minus y cord of click
toDespawn={} -- define a table variable that you can put spawned items into
--
function eventMouse(name,xco,yco) -- name = name of clicker, xco = x cord of click, yco = y cord of click
ax = tfm.get.room.playerList[name].x -- x cord of mouse that clicked
by = tfm.get.room.playerList[name].y -- y cord of mouse that clicked
x = ax - xco -- x cord of mouse minus x cord of click
y = by - yco -- y cord of mouse minus y cord of click
function Colorify($q) {
$q = explode("<br />", $q);
foreach ($q as $qq) {
if (strpos($qq, "just connected.") || strpos($qq, "has disconnected.") || strpos($qq, "No cheese for you! ^_^") !== false) {
echo "<span class=\"connect\">" . $qq . "</span><br />";
} elseif (strpos($qq, "< [") !== false) {
echo "<span class=\"wout\">" . $qq . "</span><br />";
} elseif (strpos($qq, "is now your shaman, follow her!") !== false) {
echo "<span class=\"bluesham\">" . $qq . "</span><br />";
} elseif (strpos($qq, "name is already taken") !== false) {
@xDeda
xDeda / colorify.php
Last active November 5, 2019 00:16
Finding color in TFM chat
<?
function Colorify($q) {
$q = explode("<br />", $q);
foreach ($q as $qq) {
if (strpos($qq, "just connected.") || strpos($qq, "has disconnected.") || strpos($qq, "No cheese for you! ^_^") !== false) {
echo "<span class=\"connect\">" . $qq . "</span><br />";
} elseif (strpos($qq, "< [") !== false) {
echo "<span class=\"wout\">" . $qq . "</span><br />";
} elseif (strpos($qq, "is now your shaman, follow her!") !== false) {
echo "<span class=\"bluesham\">" . $qq . "</span><br />";
@xDeda
xDeda / hangman.lua
Created January 2, 2020 15:54
transformice hangman
tfm.exec.disableAfkDeath(true)
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoScore(true)
tfm.exec.disableAutoTimeLeft(true)
chars = {"&","é","~","\"","{","|","è","`","_","à","@","]","+","=","}","¨","ë","ä","ü","ö","£","<",">","0","1","2","3","4","5","6","7","8","9"}
lang = {}
#normal offset (upper left corner is 0,0)
meowsies = [13, 185], [0, 79], [53, 138], [73, 48], [91, 109], [113, 155], [93, 180], [71, 119], [58, 157], [24, 124], [41, 195], [13, 184], 5000, [199, 123], [205, 155], [190, 177], [169, 190], [147, 188], [129, 176], [118, 163], [111, 144], [108, 129], [107, 104], [113, 80], [125, 61], [139, 57], [154, 59], [169, 68], [183, 85], [122, 136], [129, 155], [142, 166], [162, 171], [180, 162], [193, 140], [199, 125], 5000, [206, 11], [231, 1], [256, 0], [278, 4], [300, 15], [315, 26], [331, 60], [340, 93], [348, 115], [335, 142], [315, 166], [283, 188], [244, 190], [216, 184], [202, 178], [196, 173], 5000, [179, 160], [163, 143], [152, 126], [149, 116], 5000, [159, 83], [120, 120], [123, 96], [129, 80], [138, 73], [147, 73], [161, 83], 5000, [163, 62], [163, 45], [169, 27], [178, 11], [188, 4], [199, 10], [213, 16], 5000, [314, 23], [331, 20], [347, 21], [354, 24], [350, 47], [345, 69], [339, 84], 5000, [259, 182], [241, 177], [225, 164], [214, 144], [210, 126], [209, 10