Last active
April 22, 2017 22:30
-
-
Save sercanarga/208e6617b57aed611117435d1655a70a 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 Agar.IO | |
// @namespace Agar.IO | |
// @version 1.0 | |
// @description Agar.IO Script | |
// @author Sercan Arğa | |
// @match http://agar.io/ | |
// @grant none | |
// ==/UserScript== | |
window.addEventListener('keydown', keydown); | |
window.addEventListener('keyup', keyup); | |
var Parca_At = false; | |
var Hiz = 10; //Standart = 25 | |
//Fonksiyonlar | |
//İmleç | |
$('body').css('cursor', 'url(http://i.hizliresim.com/81Jm7V.png),auto'); | |
//Kronometre | |
var saniye = 0, dakika = 0, saat = 0; | |
var yaz,ysaniye,ydakika,ysaat; | |
function bak() | |
{ | |
if ( saniye < 59 ) saniye = saniye + 1; | |
else { | |
saniye = 0; | |
if ( dakika < 59 ) dakika = dakika + 1; | |
else { | |
dakika = 0; saat = saat + 1; | |
} | |
} | |
ysaniye = saniye < 10 ? '0'+saniye : saniye; | |
ydakika = dakika < 10 ? '0'+dakika : dakika; | |
ysaat = saat < 10 ? '0'+saat : saat; | |
yaz = ysaat+":"+ydakika+":"+ysaniye; | |
} | |
$(document).ready(function(){ | |
setInterval(bak, 1000); | |
}); | |
(function oto_bolun() { | |
var miktar = 6; | |
var sure = 50; //Ms Cinsinden | |
var overwriting = function(evt) { | |
if (evt.keyCode === 67) { // C | |
for (var i = 0; i < miktar; ++i) { | |
setTimeout(function() { | |
window.onkeydown({keyCode: 32}); | |
window.onkeyup({keyCode: 32}); | |
}, i * sure); | |
} | |
} | |
}; | |
window.addEventListener('keydown', overwriting); | |
})(); | |
//Müzik Fonksiyonu | |
(function(window, document){ | |
var audio = document.createElement("audio"), | |
standarmuzik = "http://mp3zone.co/download/listen/MWZYS3VMN09OQzI3Sy9aN1FGcWZRdz09/", | |
kontrol = false; | |
audio.loop = true; | |
document.addEventListener("keydown", function(event){ | |
if( event.keyCode == 77 && !kontrol ){ //M | |
audio.pause(); | |
kontrol = true; | |
var yenimuzik = prompt("Müzik İçin MP3 Adresi Girebilirsiniz. Kapatmak İçin İptal Butonuna Basın!", standarmuzik); | |
kontrol = false; | |
audio.src = yenimuzik; | |
audio.play(); | |
} | |
});})(window, document); | |
function bolun() { | |
$("body").trigger($.Event("keydown", { keyCode: 32})); | |
$("body").trigger($.Event("keyup", { keyCode: 32})); | |
} | |
function parca() { | |
if (Parca_At) { | |
window.onkeydown({keyCode: 87}); | |
window.onkeyup({keyCode: 87}); | |
setTimeout(parca, Hiz); | |
} | |
} | |
function keydown(event) { | |
//Besleme Makrosu | |
if (event.keyCode == 90) // Z | |
{ | |
Parca_At = true; | |
setTimeout(parca, Hiz); | |
} | |
//Durdur | |
if (event.keyCode == 88) { // X | |
X = window.innerWidth/2; | |
Y = window.innerHeight/2; | |
$("canvas").trigger($.Event("mousemove", {clientX: X, clientY: Y})); | |
} | |
} //Oyuncu Z Tuşuna Basmayı Bıraktığı Zaman Bu Fonksiyon Devreye Girer | |
function keyup(event) { | |
if (event.keyCode == 90) { | |
Parca_At = false; | |
} | |
} | |
//Mouse Tuşları | |
(function() { | |
document.getElementById("canvas").addEventListener("mousedown", function(event) { | |
if (event.which == 1) { | |
bolun(); | |
} | |
else if (event.which == 3) { | |
Parca_At = true; | |
setTimeout(parca, Hiz); | |
} | |
}); | |
document.getElementById("canvas").addEventListener("mouseup", function(event) { | |
if (event.which == 3) { | |
Parca_At = false; | |
} | |
}); | |
$('#canvas').bind('contextmenu', function(e) { | |
e.preventDefault(); | |
}); | |
}()); | |
//Kontroller | |
var kontroller = document.createElement("div"); | |
kontroller.style.padding = "5px"; | |
kontroller.style.font = "16px Ubuntu"; | |
kontroller.style.display = "block"; | |
kontroller.style.position = "fixed"; | |
kontroller.style.opacity = "0.7"; | |
kontroller.style.top = "67%"; | |
kontroller.style.color = "#000000"; | |
kontroller.style.padding = "10px"; | |
kontroller.style.borderRadius = "2px"; | |
kontroller.style.left = "5px"; | |
kontroller.innerHTML = '<div id="formx"><u><b>Script Kontrolleri</b></u><br><img src="https://cdn1.iconfinder.com/data/icons/mouse-conditions/154/mouse-device-left-click-control-16.png" /> = Bölün <br> <img src="https://cdn1.iconfinder.com/data/icons/mouse-conditions/154/mouse-device-right-click-control-16.png"/> = Parça At <br> <img src="https://cdn3.iconfinder.com/data/icons/interface/100/scroll_up_down-16.png"/> = Zoom <br> <img src="https://cdn1.iconfinder.com/data/icons/modern-latin-alphabet-lowercase-and-uppercase-lett/154/keyboard-key-z-upper-case-letter-16.png"/> = W Makrosu <br> <img src="https://cdn1.iconfinder.com/data/icons/modern-latin-alphabet-lowercase-and-uppercase-lett/154/keyboard-key-x-upper-case-letter-16.png"/> = Sabitle <br> <img src="https://cdn1.iconfinder.com/data/icons/modern-latin-alphabet-lowercase-and-uppercase-lett/154/keyboard-c-upper-case-key-16.png"/> = 16x Bölün <br> <img src="https://cdn1.iconfinder.com/data/icons/modern-latin-alphabet-lowercase-and-uppercase-lett/154/keyboard-key-m-letter-upper-case-16.png"/> = Müzik Paneli</div>'; | |
kontroller.style.backgroundColor = '#008FF8'; | |
kontroller.style.overflow = "hidden"; | |
document.body.appendChild(kontroller); | |
kontroller.onclick = function(){ //Tıklandığında Bu Fonksiyon Devreye Girer | |
kontroller.style.width = "0px"; | |
kontroller.style.padding = "0px"; | |
}; | |
//İletişim Butonu | |
var oynabutonu = document.getElementsByTagName("button")[6]; | |
var iletisim = document.createElement("button"); | |
iletisim.innerHTML = 'İletişim'; | |
iletisim.style.display = 'block'; | |
iletisim.style.float = 'right'; | |
iletisim.style.height = '37px'; | |
iletisim.style.width = '110px'; | |
iletisim.style.fontWeight = '700'; | |
iletisim.style.color = '#fff'; | |
iletisim.style.backgroundColor = '#D9534F'; | |
iletisim.style.borderColor = '#D9534F'; | |
iletisim.style.borderRadius = '5px'; | |
oynabutonu.style.width = '160px'; | |
document.getElementsByClassName("row")[0].appendChild(iletisim); | |
iletisim.addEventListener('click', function(){ | |
window.open('https://www.twitter.com/sercan_arga', '_blank'); | |
}); | |
//Fps Gösterme Fonksiyonu | |
(function() { | |
var gecikme = 700; //Ms Cinsinden | |
var guncelle = 0; | |
var fps_degeri = 0; | |
var fps_goster = document.createElement("div"); | |
fps_goster.style.font = "16px Ubuntu"; | |
fps_goster.style.position = "fixed"; | |
fps_goster.style.opacity = "0.8"; | |
fps_goster.style.top = "5px"; | |
fps_goster.style.left = "5px"; | |
fps_goster.textContent = "---"; | |
fps_goster.style.overflow = "hidden"; | |
document.body.appendChild(fps_goster); | |
fps_goster.onclick = function(){ //Tıklandığında Bu Fonksiyon Devreye Girer | |
fps_goster.style.width = "0px"; | |
fps_goster.style.padding = "0px"; | |
}; | |
function Css(color) { | |
var values;{ | |
return {r : 255, g : 255, b : 255}; | |
} | |
} | |
function YaziRengi(values) { //Yazı Rengi RGB Cinsinden | |
return "rgb(236, 27,35)"; | |
} | |
function FpsGuncelle() { | |
var yazi_renk = YaziRengi(); | |
fps_goster.style.color = yazi_renk; | |
var now = Date.now(); | |
var elapsed = now - guncelle; | |
if (elapsed < gecikme) { | |
++fps_degeri; | |
} else { | |
var fps = Math.round(fps_degeri / (elapsed / 1000)); | |
fps_goster.innerHTML = fps + ' FPS — ' + yaz; | |
fps_degeri = 0; | |
guncelle = now; | |
} | |
requestAnimationFrame(FpsGuncelle); | |
} | |
guncelle = Date.now(); | |
requestAnimationFrame(FpsGuncelle); | |
})(); | |
//Uzaklaştırma Fonksiyonu | |
window.uzaklastir = { | |
zoom: 0 | |
}; | |
var agario_scripti = "http://agar.io/agario.core.js"; | |
xmlhttp = new XMLHttpRequest(); | |
xmlhttp.open("GET", agario_scripti, true); | |
xmlhttp.onreadystatechange = function() { | |
if (xmlhttp.readyState == 4) { | |
uzaklastir_islem = xmlhttp.responseText; | |
uzaklastir_islem = uzaklastir_islem.replace (/if\((\+\w\[\w>>3\])<1\.0\){/i, "if($1<window.uzaklastir.zoom){"); | |
var bitir = document.createElement('script'); | |
bitir.innerHTML = uzaklastir_islem; | |
document.body.appendChild(bitir); | |
} | |
}; | |
xmlhttp.send(null); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment