Created
January 30, 2017 03:04
-
-
Save jakemayeux/09d1a1402c22da10f085532ecc21bcae to your computer and use it in GitHub Desktop.
This file contains 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 cell.sh friend map | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @require https://cdn.socket.io/socket.io-1.4.5.js | |
// @description try to take over the world! | |
// @author Jake Mayeux | |
// @match http://cell.sh/* | |
// @run-at document-end | |
// ==/UserScript== | |
const SERVER = '129.10.33.206:3000' | |
var socket = io(SERVER) | |
CH.data = new Array() | |
CH.players = new Array() | |
window.asdf = 'asdf' | |
socket.on('data', function(data){ | |
if(!CH.players.includes(data.id)){ | |
CH.players.push(data.id) | |
} | |
CH.data[data.id] = data | |
}) | |
document.asdf = document.createElement | |
document.createElement = function(str){ | |
let ret = document.asdf(str); | |
if(str == 'canvas'){ | |
ret.qwer = ret.getContext | |
ret.getContext = function(){ | |
let c = ret.qwer('2d') | |
c.a = c.arc | |
c.arc = function(a,b,c,d,e,f){ | |
window.posX = a | |
window.posY = b | |
socket.emit('pos',{x:a,y:b}) | |
for(i of CH.players){ | |
let asdfx = CH.data[i].x | |
let asdfy = CH.data[i].y | |
this.beginPath() | |
this.a(asdfx,asdfy,c,d,e,f) | |
this.fillStyle = '#00ff00' | |
this.fill() | |
} | |
this.beginPath() | |
this.a(a,b,c,d,e,f) | |
} | |
return c | |
} | |
} | |
return ret | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment