이전버전 스크립트임 폰에는 아직 구버전이어서 그거 복붙해옴
딱 도장 스크립트만 이거로 바꿔주니 로컬도장 잘돌아가더라
javascript: (
/* ver.1911.1
https://gall.dcinside.com/m/mobage/4640
*/
function () {
var safety = 30;
var deal = 1000
var local = {record: 0, use:2}
var greeting = { use:0, msg:'ありがとうございました!' };
var energy = [9, 15]
var home = "http://sp.pf.mbga.jp/12008305/?guid=ON&url=http://mobamas.net/idolmaster/"
var main = home + "battles/";
function find(s) { return document.querySelector(s); }
function text(s, e, x) { return (e ? find(s).textContent.split(e)[x] : find(s).textContent) || ''}
function number(s, e, x) { return ((e ? text(s).split(e)[x] : text(s)) || '0').replace(/[^0-9]/g, '') * 1 }
function value(s) { return find(s) ? find(s).value : 0}
const send = (type, url, request) => {
const option = request || {}
const form = new FormData()
const xhr = new XMLHttpRequest()
for (param in option.data) { form.append(param, option.data[param]) }
xhr.open(type, url, option.async != undefined ? option.async : true)
option.onprogress && (xhr.onprogress = (res) => { option.onprogress(res) })
option.onload && (xhr.onload = (res) => { option.onload(res.target) })
xhr.send(form)
return xhr
}
function reload(target, action) {
$('#top').load(main + target + " h1#JtextLimit, section.bg_gray_s.m-Top5.m-Btm10.m-Top8, form[action *= battle_processing]:eq(0), [value = 回復する], a[href *= 'profile'], table:nth-child(1), table:nth-child(4), form[action *= use_item]:eq(0)", function (response) {
action && action()
});
}
function index() {
if (local.record || local.use) {
var last = localStorage.getItem('vove.dojo.last') || '0000000000'
var date = new Date()
var now = [date.getFullYear(), date.getMonth() + 1, date.getDate(), date.getHours()];
for (i in now) {
if (now[i] < 10) {
now[i] = "0" + now[i];
}
now[i] += ''
}
var now = now[0] + now[1] + now[2] + now[3]
var nowdate = 1 * now.slice(0, 8),
nowhours = 1 * now.slice(8),
lastdate = 1 * last.slice(0, 8),
lasthours = 1 * last.slice(8)
if ((nowdate > lastdate && nowhours >= 5) || (nowdate == lastdate && nowhours >= 5 && lasthours < 5)) {
console.log('reset')
if (local.use == 2) {
send("GET", "https://imcg.pink-check.school/api/v1/dojo?minLevel=300", {
async: false,
onload: (res) => {
const api = JSON.parse(res.response)
api.forEach((apiDojo) => {
let found = DJ.some((localDojo) => {
if (localDojo.id * 1 == apiDojo.mobageId * 1) {
localDojo.lv = apiDojo.level
localDojo.title = apiDojo.unitName
return true
}
})
if (!found) {
DJ.push({ enable: 1, failed: 0, id: apiDojo.mobageId, lv: apiDojo.level, title: apiDojo.unitName })
}
})
console.log(DJ)
}
})
}
for (var i = 0; i < DJ.length; i++) {
if (!DJ[i].id) {
DJ.splice(i, 1)
}
for (var j = i + 1; j < DJ.length; j++) {
if (DJ[i].id === DJ[j].id) {
DJ[i].failed > DJ[j].failed ? DJ.splice(j, 1) : DJ.splice(i, 1)
}
}
}
for (i = 0; i < DJ.length; i++) {
DJ[i].enable = 1
}
DJ.sort((a, b) => { return b.enable - a.enable || b.lv - a.lv || a.failed - b.failed });
localStorage.setItem('vove.dojo', JSON.stringify(DJ))
}
localStorage.setItem('vove.dojo.last', now)
}
var index = - 1
for (i = 0; i < DJ.length; i++) {
if (DJ[i].id == id) {
var index = i
break
}
}
return index
}
function next(index, failed) {
document.title = ">>>>"
if (failed || local.record == 2) {
if (index == - 1) {
DJ.push({ enable: 0, lv: level, id: id, failed: failed, title: title })
localStorage.setItem('vove.dojo', JSON.stringify(DJ))
var index = DJ.length - 1
}
if (index + 1) {
if (DJ[index].failed < failed) {
DJ[index].failed = failed
}
DJ[index].lv = level
DJ[index].title = title
}
}
if (index + 1) {
DJ[index].enable = 0
}
if (local.use) {
DJ.sort((a, b) => { return b.enable - a.enable || b.lv - a.lv || a.failed - b.failed });
localStorage.setItem('vove.dojo', JSON.stringify(DJ))
for (i = 0; i < DJ.length; i++) {
if (DJ[i].enable && DJ[i].failed < deal) {
$('<input/>', { value: '送信中' }).appendTo('#top');
reload('battle_check/' + DJ[i].id, function () { document.title = "Ready" })
return
}
}
alert('모든 로컬 도장을 사용했습니다.')
}
window.close()
}
if (document.title == ">>>>" || find("[value = 送信中]") || document.readyState != 'complete') {
return
}
if (find("#dojos")) {
find("#dojos > div:nth-child(1) > a").click();
document.title = ">>>>";
setTimeout(() => { document.title = "Ready" }, 200);
} else if (find("#dojoList")) {
document.title = ">>>>";
setTimeout(() => { document.title = "Ready" }, 200);
document.querySelectorAll('#dojoList > tbody')[1].querySelector('a').click()
document.querySelectorAll('#dojoList > tbody')[1].remove()
} else if (find('div[onclick ^= navigateToDojo]')) {
document.title = ">>>>";
setTimeout(() => { document.title = "Ready" }, 200);
find('div[onclick ^= navigateToDojo]').click();
}else if (find("h1#JtextLimit")) {
var DJ = JSON.parse(localStorage.getItem('vove.dojo') || '[]')
if (find("a[href *= 'profile']")) {
var id = decodeURIComponent(find("a[href *= 'profile']").href).split(/[/?]/)[11]
find('#mbga-pf-footer').innerText = id
var myLevel = number("td[align='left']", '\n', 2)
var level = number("td[align='right']", '\n', 2)
var title = text("td[align='right']", '\n', 1)
}
if (find("[value = LIVEバトル開始]")) {
if (safety) {
if (value("[name = my_param_attack]") * 1 - number(".t-Cnt > div > span.red_mild") > safety) {
alert("[Safety] 사용 코스트가 " + safety + "를 초과했습니다.");
return
}
}
var gap = level / myLevel
if (first = !(document.title * 1)) {
var index = index()
if (gap < 0.7 || /休業/.test(title) || /休止/.test(title) || ((index + 1) && (DJ[index].failed > deal))) {
next(index, 0)
return
}
document.title = id
}
find("[value = LIVEバトル開始]").value = '送信中';
let failed = 0
send('POST', main + "battle_processing", {
async: first && local.record ? false : true,
data: {
'enemy_id': value("[name = 'enemy_id']"),
'csrf_test_name': value("[name = 'csrf_test_name']")
},
onload: () => {
if (first && local.record) {
if (/start_lose/.test(send('GET', main + "win_or_lose?enemy_id=" + id, { async: false }).response) ? 1 : 0) {
document.title == "패배한 도장을 기록합니다."
failed = send('GET', main + "flash?enemy_id=" + id, { async: false }).response.split('self')[2].replace(/[^0-9]/g, "") * 1
next(index, failed)
throw new Error('this is not dojo. failed deal: ' + failed)
return
}
}
}
})
failed || reload("battle_check/" + id);
return
} else if (find("[value = 回復する]")) {
find("[value = 回復する]").value = '送信中';
for (i of energy) {
if (csrf = $(send('GET', home + 'item/check/' + i, { async: false }).response).find("[name = csrf_test_name]").val()) {
send('POST', home + 'item/use_item', {
async: false,
data: {
'item_id': i,
'csrf_test_name': csrf
},
onload: () => {
setTimeout(() => { reload('battle_check/' + find('#mbga-pf-footer').innerText) }, 100)
}
})
return
}
}
alert('공격 코스트 회복 아이템이 없어 보입니다.')
}
if ((document.title * 1) && greeting.use) {
document.title = 'Now greeting...';
find("#top").innerText = '';
send('POST', home + "cheer/send_check", {
async: false,
data: {
'to_viewer_id': id,
'message': greeting.msg
}
})
}
next(index(), 0)
return
}
}
)();
댓글 영역
획득법
① NFT 발행
작성한 게시물을 NFT로 발행하면 일주일 동안 사용할 수 있습니다. (최초 1회)
② NFT 구매
다른 이용자의 NFT를 구매하면 한 달 동안 사용할 수 있습니다. (구매 시마다 갱신)
사용법
디시콘에서지갑연결시 바로 사용 가능합니다.