Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (localStorage.getItem("keyFight") === null) localStorage.setItem("keyFight", "e|69");
- $(document).keyup(function(p) {
- if (p.which == localStorage.getItem("keyFight").split("|")[1] && p.target.tagName != "TEXTAREA" && p.target.tagName != 'INPUT') {
- for (n in g.other) {
- if (g.other[n].relation == "cl" || g.other[n].relation == "fr" || g.other[n].relation == "cl-fr") {} else {
- if ((Math.abs(hero.x - g.other[n].x) <= 1 && Math.abs(hero.y - g.other[n].y) <= 1)) {
- _g("fight&a=attack&id=" + n)
- }
- }
- }
- }
- });
- var menu = () => {
- displayKeyCode = (e) => {
- document.getElementById("keyFight").value = e.key.toLowerCase();
- localStorage.setItem("keyFight", e.key + "|" + e.keyCode);
- }
- mAlert('<center>Podaj klawisz, którym będziesz atakował(oprócz X): <input id="keyFight" type="text" onkeypress="return false;" onkeydown="return displayKeyCode(event)" value="' + localStorage.getItem("keyFight").split("|")[0] + '"><br></center>', 0, function() {
- delete displayKeyCode;
- });
- }
- $('<div id="settings" tip="<b>Atak bez klanowiczów</b>" style="top: 218px;cursor:pointer;left: 119px;position:absolute;z-index:60;width:32px;height:32px;background-size:100% 100%!important;background:url(https://www.margonem.pl/obrazki/itemy/mie/soul_dag03.gif)"></div>').appendTo("#panel");
- document.getElementById("settings").addEventListener("click", menu);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement