Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
javascript: /*if (window.location.href.indexOf('screen=ally&mode=members') < 0) { //relocate window.location.assign(game_data.link_base_pure + "ally&mode=members"); }*/ // Sophie "Shinko to Kuma" var tribeTable = ''; var rowStart = 1; var columnStart = 6; var columnName = 0; var rows; var BBTable = ""; var csvTable = ""; var statsEnabled = {}; if (localStorage.getItem("tribeStatsEnabled") == null) { console.log("No settings stored, creating") statsEnabled = { "ODA": true, "ODD": true, "ODS": true, "Loot": true, "Gathering": true, "Combined": true, "ODATotal": true, "ODDTotal": true, "ODSTotal": true }; localStorage.setItem("tribeStatsEnabled", JSON.stringify(statsEnabled)); } else { console.log("Getting settings"); statsEnabled = JSON.parse(localStorage.getItem("tribeStatsEnabled")); } var langShinko; switch (game_data.locale) { case "pt_BR": langShinko = { "ODA": "ODA", "ODD": "ODD", "ODS": "ODS", "Loot": "Saqueado", "Gathered": "Coletado", "Combined": "Combinado", "ODATotal": "ODA TOTAL", "ODDTotal": "ODD TOTAL", "ODSTotal": "ODS TOTAL" } break; case "es_ES": langShinko = { "ODA": "ODA", "ODD": "ODD", "ODS": "ODS", "Loot": "Saqueado", "Gathered": "Recolectado", "Combined": "Combinado", "ODATotal": "ODA TOTAL", "ODDTotal": "ODD TOTAL", "ODSTotal": "ODS TOTAL" } break; case "de_DE": langShinko = { "ODA": "BGA", "ODD": "BGV", "ODS": "BGU", "Loot": "Geplündert", "Gathered": "Gesammelt", "Combined": "Insgesamt ", "ODATotal": "ODA TOTAL", "ODDTotal": "ODD TOTAL", "ODSTotal": "ODS TOTAL" } break; default: langShinko = { "ODA": "ODA", "ODD": "ODD", "ODS": "ODS", "Loot": "Loot", "Gathered": "Gathered", "Combined": "Combined", "ODATotal": "ODA TOTAL", "ODDTotal": "ODD TOTAL", "ODSTotal": "ODS TOTAL" } } if (window.location.href.indexOf('screen=ally&mode=members') > -1) { //members own tribe tribeTable = "#content_value table.vis"; rowStart = 3; columnStart = 6; columnName = 0; rows = $($("table .vis")[2]).find('tr'); } if (window.location.href.indexOf('&screen=info_ally') > -1) { //any tribe tribeTable = ".vis:eq(" + (3 + $(".bbcodetable").length) + ")"; rowStart = 1; columnStart = 5; columnName = 0; rows = $($("table .vis").not(".bbcodetable")[2]).find('tr'); } if ((window.location.href.indexOf('screen=ranking&mode=player') > -1 || window.location.href.indexOf('screen=ranking&mode=con_player') > -1) || (window.location.href.indexOf('screen=ranking') > -1 && window.location.href.indexOf('&mode') == -1)) { //any player tribeTable = ".vis:eq(2)"; rowStart = 1; columnStart = 6; columnName = 1; rows = $($("table .vis")[1]).find('tr'); } $.getAll = function ( urls, // array of URLs onLoad, // called when any URL is loaded, params (index, data) onDone, // called when all URLs successfully loaded, no params onError // called when a URL load fails or if onLoad throws an exception, params (error) ) { var numDone = 0; var lastRequestTime = 0; var minWaitTime = 200; // ms between requests loadNext(); function loadNext() { if (numDone == urls.length) { onDone(); return; } let now = Date.now(); let timeElapsed = now - lastRequestTime; if (timeElapsed < minWaitTime) { let timeRemaining = minWaitTime - timeElapsed; setTimeout(loadNext, timeRemaining); return; } console.log('Getting ', urls[numDone]); $("#progress").css("width", `${(numDone + 1) / urls.length * 100}%`); lastRequestTime = now; $.get(urls[numDone]) .done((data) => { try { onLoad(numDone, data); ++numDone; loadNext(); } catch (e) { onError(e); } }) .fail((xhr) => { onError(xhr); }) } }; var names = []; var html = "<div style='width:500px'>"; if (typeof customNames == 'undefined') { for (var i = 1; i < rows.length; i++) { names.push($(rows[i]).find('a')[0].innerText.trim().split(' ').join('+')); } } else { html += `<table class="vis" id="tableMembers" border="1" style="width: 100%"><tr><th>Player Name</th></tr>`; tribeTable = "#tableMembers"; rowStart = 1; columnStart = 1; columnName = 0; rows = 4; for (var i = 0; i < customNames.length; i++) { html += `<tr><td id="${customNames[i]}" style="width:50px;padding: 5px;">${customNames[i]}</td></tr>` customNames[i] = customNames[i].trim().split(' ').join('+'); } html += `</table></div>` names = customNames; $("#contentContainer").eq(0).prepend(html); } $("#contentContainer").eq(0).prepend("<span>BB</span><br><textarea id='BBCODE' rows='" + (rows + 4) + "' cols='100'></textarea><br>"); $("#contentContainer").eq(0).prepend("<span>CSV</span><br><textarea id='CSVCODE' rows='" + (rows + 4) + "' cols='100'></textarea><br>"); function getData() { $("#getData").prop('disabled', true); //save checkboxes to localstorage for (var i = 0; i < Object.keys(statsEnabled).length; i++) { console.log("Current stat:" + Object.keys(statsEnabled)[i]); console.log("Set to: " + $(`:checkbox#${Object.keys(statsEnabled)[i]}`).is(":checked")) statsEnabled[Object.keys(statsEnabled)[i]] = $(`:checkbox#${Object.keys(statsEnabled)[i]}`).is(":checked"); } localStorage.setItem("tribeStatsEnabled", JSON.stringify(statsEnabled)); linksODS = []; linksODD = []; linksODA = []; linksODSTotal = []; linksODDTotal = []; linksODATotal = []; linksLoot = []; linksGathering = []; ODSperPlayer = []; ODDperPlayer = []; ODAperPlayer = []; ODSTotalperPlayer = []; ODDTotalperPlayer = []; ODATotalperPlayer = []; lootperPlayer = []; gatheredperPlayer = []; for (var i = 0; i < names.length; i++) { if (statsEnabled.ODA) linksODA.push("/game.php?screen=ranking&mode=in_a_day&type=kill_att&name=" + names[i]); if (statsEnabled.ODD) linksODS.push("/game.php?screen=ranking&mode=in_a_day&type=kill_sup&name=" + names[i]); if (statsEnabled.ODS) linksODD.push("/game.php?screen=ranking&mode=in_a_day&type=kill_def&name=" + names[i]); if (statsEnabled.Loot) linksLoot.push("/game.php?screen=ranking&mode=in_a_day&type=loot_res&name=" + names[i]); if (statsEnabled.Gathering) linksGathering.push("/game.php?screen=ranking&mode=in_a_day&type=scavenge&name=" + names[i]); if (statsEnabled.ODATotal) linksODATotal.push("/game.php?screen=ranking&mode=kill_player&type=att&name=" + names[i]); if (statsEnabled.ODDTotal) linksODDTotal.push("/game.php?screen=ranking&mode=kill_player&type=def&name=" + names[i]); if (statsEnabled.ODSTotal) linksODSTotal.push("/game.php?screen=ranking&mode=kill_player&type=support&name=" + names[i]); } titleCount = 0; for (var i = 0; i < Object.keys(statsEnabled).length; i++) { if (statsEnabled[Object.keys(statsEnabled)[i]]) { $(tribeTable + " tr").eq(rowStart - 1).append("<th onclick='sortTableTest(" + (columnStart + titleCount) + ")'>" + langShinko[Object.keys(langShinko)[i]] + "</th>"); titleCount++; } } $(tribeTable).eq(rowStart - 1).attr('id', 'tableMembers'); $("#contentContainer").eq(0).prepend(` <div id="progressbar" style="width: 100%; background-color: #36393f;"><div id="progress" style="width: 0%; height: 35px; background-color: #4CAF50; text-align: center; line-height: 32px; color: black;"></div> </div>`); $("#mobileHeader").eq(0).prepend(` <div id="progressbar" style="width: 100%; background-color: #36393f;"><div id="progress" style="width: 0%; height: 35px; background-color: #4CAF50; text-align: center; line-height: 32px; color: black;"></div> </div>`); //ODA $.getAll(linksODA, (i, data) => { if ($(data).find(".lit-item")[3] != undefined) { temp = $(data).find(".lit-item") ODAperPlayer.push([temp[3].innerText.replace(/\./g, ','), temp[4].innerText]); } else { ODAperPlayer.push(["0", "Never"]); } }, () => { $("#progress").css("width", `${(linksODA.length) / linksODA.length * 100}%`); for (var o = rowStart; o < ODAperPlayer.length + rowStart; o++) { $(tribeTable + " tr").eq(o).append("<td title=" + ODAperPlayer[o - rowStart][1] + ">" + ODAperPlayer[o - rowStart][0] + "</td>") } //ODD $.getAll(linksODD, (i, data) => { if ($(data).find(".lit-item")[3] != undefined) { temp = $(data).find(".lit-item") ODDperPlayer.push([temp[3].innerText.replace(/\./g, ','), temp[4].innerText]); } else { ODDperPlayer.push(["0", "Never"]); } }, () => { for (var o = rowStart; o < ODDperPlayer.length + rowStart; o++) { $(tribeTable + " tr").eq(o).append("<td title=" + ODDperPlayer[o - rowStart][1] + ">" + ODDperPlayer[o - rowStart][0] + "</td>") } //ODS $.getAll(linksODS, (i, data) => { if ($(data).find(".lit-item")[3] != undefined) { temp = $(data).find(".lit-item") ODSperPlayer.push([temp[3].innerText.replace(/\./g, ','), temp[4].innerText]); } else { ODSperPlayer.push(["0", "Never"]); } }, () => { for (var o = rowStart; o < ODSperPlayer.length + rowStart; o++) { $(tribeTable + " tr").eq(o).append("<td title=" + ODSperPlayer[o - rowStart][1] + ">" + ODSperPlayer[o - rowStart][0] + "</td>") } //loot $.getAll(linksLoot, (i, data) => { if ($(data).find(".lit-item")[3] != undefined) { temp = $(data).find(".lit-item") lootperPlayer.push([temp[3].innerText.replace(/\./g, ','), temp[4].innerText]); } else { lootperPlayer.push(["0", "Never"]); } }, () => { for (var o = rowStart; o < lootperPlayer.length + rowStart; o++) { $(tribeTable + " tr").eq(o).append("<td title=" + lootperPlayer[o - rowStart][1] + ">" + lootperPlayer[o - rowStart][0] + "</td>") } //gathering $.getAll(linksGathering, (i, data) => { if ($(data).find(".lit-item")[3] != undefined) { temp = $(data).find(".lit-item") gatheredperPlayer.push([temp[3].innerText.replace(/\./g, ','), temp[4].innerText]); } else { gatheredperPlayer.push(["0", "Never"]); } }, () => { for (var o = rowStart; o < gatheredperPlayer.length + rowStart; o++) { $(tribeTable + " tr").eq(o).append("<td title=" + gatheredperPlayer[o - rowStart][1] + ">" + gatheredperPlayer[o - rowStart][0] + "</td>") //only show combined if loot and gathering are collected if (statsEnabled["Loot"] == true && statsEnabled["Gathering"] == true) { $(tribeTable + " tr").eq(o).append("<td>" + numberWithCommas(parseInt(gatheredperPlayer[o - rowStart][0].split(",").join("")) + parseInt(lootperPlayer[o - rowStart][0].split(",").join(""))) + "</td>") } else { if (statsEnabled["Combined"] == true) $(tribeTable + " tr").eq(o).append("<td>Need both Loot and Gathering enabled to see this column</td>") } } // ODA total $.getAll(linksODATotal, (i, data) => { if ($(data).find(".lit-item")[3] != undefined) { temp = $(data).find(".lit-item") x = temp[3].innerText; console.log(x); if (x.indexOf(" Mil.") > -1) { x = x.replace(" Mil.", ""); x = x.replace(",", ""); x = parseInt(x) * 10000; x=x.toString(); } ODATotalperPlayer.push(x.replace(/\./g, ',')); } else { ODATotalperPlayer.push("0"); } }, () => { for (var o = rowStart; o < ODATotalperPlayer.length + rowStart; o++) { $(tribeTable + " tr").eq(o).append("<td>" + numberWithCommas(ODATotalperPlayer[o - rowStart]) + "</td>") } // ODD total $.getAll(linksODDTotal, (i, data) => { if ($(data).find(".lit-item")[3] != undefined) { temp = $(data).find(".lit-item") x = temp[3].innerText; console.log(x); if (x.indexOf(" Mil.") > -1) { x = x.replace(" Mil.", ""); x = x.replace(",", ""); x = parseInt(x) * 10000; x=x.toString(); } ODDTotalperPlayer.push(x.replace(/\./g, ',')); } else { ODDTotalperPlayer.push("0"); } }, () => { for (var o = rowStart; o < ODDTotalperPlayer.length + rowStart; o++) { $(tribeTable + " tr").eq(o).append("<td>" + numberWithCommas(ODDTotalperPlayer[o - rowStart]) + "</td>") } // ODS total $.getAll(linksODSTotal, (i, data) => { if ($(data).find(".lit-item")[3] != undefined) { temp = $(data).find(".lit-item") x = temp[3].innerText; console.log(x); if (x.indexOf(" Mil.") > -1) { x = x.replace(" Mil.", ""); x = x.replace(",", ""); x = parseInt(x) * 10000; x=x.toString(); } ODSTotalperPlayer.push(x.replace(/\./g, ',')); } else { ODSTotalperPlayer.push("0"); } }, () => { for (var o = rowStart; o < ODSTotalperPlayer.length + rowStart; o++) { $(tribeTable + " tr").eq(o).append("<td>" + numberWithCommas(ODSTotalperPlayer[o - rowStart]) + "</td>") } $("#progress").remove(); sortTableTest(columnStart); }, (error) => { console.error(error); }); }, (error) => { console.error(error); }); }, (error) => { console.error(error); }); }, (error) => { console.error(error); }); }, (error) => { console.error(error); }); }, (error) => { console.error(error); }); }, (error) => { console.error(error); }); }, (error) => { console.error(error); }); } function sortTableTest(n) { var table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0; table = document.getElementById("tableMembers"); switching = true; // Set the sorting direction to ascending: dir = "desc"; /* Make a loop that will continue until no switching has been done: */ while (switching) { // Start by saying: no switching is done: switching = false; rows = table.rows; /* Loop through all table rows (except the first, which contains table headers): */ for (i = 1; i < (rows.length - 1); i++) { // Start by saying there should be no switching: shouldSwitch = false; /* Get the two elements you want to compare, one from current row and one from the next: */ x = rows[i].getElementsByTagName("td")[n]; y = rows[i + 1].getElementsByTagName("td")[n]; /* Check if the two rows should switch place, based on the direction, asc or desc: */ if (dir == "asc") { if (Number(x.innerHTML.replace(/\,/g, '')) > Number(y.innerHTML.replace(/\,/g, ''))) { // If so, mark as a switch and break the loop: shouldSwitch = true; break; } } else if (dir == "desc") { if (Number(x.innerHTML.replace(/\,/g, '')) < Number(y.innerHTML.replace(/\,/g, ''))) { // If so, mark as a switch and break the loop: shouldSwitch = true; break; } } } if (shouldSwitch) { /* If a switch has been marked, make the switch and mark that a switch has been done: */ rows[i].parentNode.insertBefore(rows[i + 1], rows[i]); switching = true; // Each time a switch is done, increase this count by 1: switchcount++; } else { /* If no switching has been done AND the direction is "asc", set the direction to "desc" and run the while loop again. */ if (switchcount == 0 && dir == "desc") { dir = "asc"; switching = true; } } } createBB(tribeTable, rowStart); $("#BBCODE")[0].value = BBTable; $("#CSVCODE")[0].value = csvTable; } function createBB(tableID, rowStart) { BBTable = "[table]\n"; csvTable = ""; //grab rows for (var i = rowStart - 1; i < $(tableID + " tr").length; i++) { //grab cells if (i == rowStart - 1) { BBTable += "[**]"; } else { BBTable += "[*]"; } for (var j = 0; j < $(tableID + " tr")[i].children.length; j++) { //add text to code if (i == rowStart - 1) { //header row BBTable += $(tableID + " tr")[i].children[j].innerText; csvTable += $(tableID + " tr")[i].children[j].innerText; if (j != $(tableID + " tr")[i].children.length - 1) { BBTable += "[||]"; csvTable += ";" } } else { //regular row BBTable += $(tableID + " tr")[i].children[j].innerText; csvTable += $(tableID + " tr")[i].children[j].innerText; if (j != $(tableID + " tr")[i].children.length - 1) { BBTable += "[|]"; csvTable += ";" } } } if (i == rowStart - 1) { BBTable += "[/**]\n"; csvTable += "\n"; } else { BBTable += "\n"; csvTable += "\n"; } } BBTable += "[/table]" } function numberWithCommas(x) { // add . to make numbers more readable x = x.toString(); var pattern = /(-?\d+)(\d{3})/; while (pattern.test(x)) x = x.replace(pattern, "$1,$2"); return x; } html = "<table id='settingsData' class='vis content-border'><tr>"; for (var i = 0; i < Object.keys(statsEnabled).length; i++) { html += ` <th align="center" style="width:50px;padding: 5px;">${Object.keys(statsEnabled)[i]}</th> `; } html += "</tr><tr>" for (var i = 0; i < Object.keys(statsEnabled).length; i++) { html += ` <td align="center" style="padding: 5px;"><input type="checkbox" ID="${Object.keys(statsEnabled)[i]}" name="${Object.keys(statsEnabled)[i]}"></td> `; } html += `</tr></table><input type="button" class="btn btnSophie" id="getData" onclick="getData()" value="Get data"><br>`; $("#contentContainer").eq(0).prepend(html); for (var i = 0; i < Object.keys(statsEnabled).length; i++) { $(`#${Object.keys(statsEnabled)[i]}`).prop("checked", statsEnabled[Object.keys(statsEnabled)[i]]); }
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
Input_AOC
1 hour ago | 18.01 KB
Untitled
15 hours ago | 13.15 KB
Analog GPUs: THE FUTURE
21 hours ago | 8.88 KB
Quotes I believe to be true.
21 hours ago | 0.16 KB
Die 7 wichtigsten Aktionen diese Woche
1 day ago | 4.17 KB
Untitled
1 day ago | 13.34 KB
Untitled
1 day ago | 13.59 KB
VNC SCRIPT 2/2: autoinput.vbs
VBScript | 1 day ago | 0.23 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!