From 2c0937fcc7ef98a4d853c6f02015d2a39e66d4aa Mon Sep 17 00:00:00 2001 From: mingjun97 Date: Wed, 4 May 2022 23:00:20 -0700 Subject: [PATCH] Impl give weapon --- pages/cheat.html | 6 ++++- scripts/cheat.js | 4 ++- scripts/cheat/data.js | 1 + scripts/cheat/quickcommand.js | 11 ++++++++ scripts/cheat/weapon.js | 50 +++++++++++++++++++++++++++++++++++ scripts/parent.js | 4 +-- styles/cheat.css | 2 +- 7 files changed, 73 insertions(+), 5 deletions(-) create mode 100644 scripts/cheat/data.js create mode 100644 scripts/cheat/weapon.js diff --git a/pages/cheat.html b/pages/cheat.html index bae143d..db1afd3 100644 --- a/pages/cheat.html +++ b/pages/cheat.html @@ -3,9 +3,13 @@ - + + + + +
diff --git a/scripts/cheat.js b/scripts/cheat.js index 5fc2f52..a20c35f 100644 --- a/scripts/cheat.js +++ b/scripts/cheat.js @@ -8,6 +8,8 @@ document.addEventListener("DOMContentLoaded", ()=> { } console.log(e.target); } - genQuickCommand(); +// genQuickCommand(); +genWeapon(); document.getElementById("tab-1").onclick = genQuickCommand; + document.getElementById("tab-3").onclick = genWeapon; }); \ No newline at end of file diff --git a/scripts/cheat/data.js b/scripts/cheat/data.js new file mode 100644 index 0000000..029ea15 --- /dev/null +++ b/scripts/cheat/data.js @@ -0,0 +1 @@ +var weapon_list = [{"id": 11101, "name": "Dull Blade", "level": 1}, {"id": 11201, "name": "Silver Sword", "level": 2}, {"id": 11301, "name": "Cool Steel", "level": 3}, {"id": 11302, "name": "Harbinger of Dawn", "level": 3}, {"id": 11303, "name": "Traveler's Handy Sword", "level": 3}, {"id": 11304, "name": "Dark Iron Sword", "level": 3}, {"id": 11305, "name": "Fillet Blade", "level": 3}, {"id": 11306, "name": "Skyrider Sword", "level": 3}, {"id": 11401, "name": "Favonius Sword", "level": 4}, {"id": 11402, "name": "The Flute", "level": 4}, {"id": 11403, "name": "Sacrificial Sword", "level": 4}, {"id": 11404, "name": "Royal Longsword", "level": 4}, {"id": 11405, "name": "Lion's Roar", "level": 4}, {"id": 11406, "name": "Prototype Rancour", "level": 4}, {"id": 11407, "name": "Iron Sting", "level": 4}, {"id": 11408, "name": "Blackcliff Longsword", "level": 4}, {"id": 11409, "name": "The Black Sword", "level": 4}, {"id": 11410, "name": "The Alley Flash", "level": 4}, {"id": 11412, "name": "Sword of Descension", "level": 4}, {"id": 11413, "name": "Festering Desire", "level": 4}, {"id": 11414, "name": "Amenoma Kageuchi", "level": 4}, {"id": 11415, "name": "Cinnabar Spindle", "level": 4}, {"id": 11501, "name": "Aquila Favonia", "level": 5}, {"id": 11502, "name": "Skyward Blade", "level": 5}, {"id": 11503, "name": "Freedom-Sworn", "level": 5}, {"id": 11504, "name": "Summit Shaper", "level": 5}, {"id": 11505, "name": "Primordial Jade Cutter", "level": 5}, {"id": 11509, "name": "Mistsplitter Reforged", "level": 5}, {"id": 11510, "name": "Haran Geppaku Futsu", "level": 5}, {"id": 12101, "name": "Waster Greatsword", "level": 1}, {"id": 12201, "name": "Old Merc's Pal", "level": 2}, {"id": 12301, "name": "Ferrous Shadow", "level": 3}, {"id": 12302, "name": "Bloodtainted Greatsword", "level": 3}, {"id": 12303, "name": "White Iron Greatsword", "level": 3}, {"id": 12304, "name": "Quartz", "level": 3}, {"id": 12305, "name": "Debate Club", "level": 3}, {"id": 12306, "name": "Skyrider Greatsword", "level": 3}, {"id": 12401, "name": "Favonius Greatsword", "level": 4}, {"id": 12402, "name": "The Bell", "level": 4}, {"id": 12403, "name": "Sacrificial Greatsword", "level": 4}, {"id": 12404, "name": "Royal Greatsword", "level": 4}, {"id": 12405, "name": "Rainslasher", "level": 4}, {"id": 12406, "name": "Prototype Archaic", "level": 4}, {"id": 12407, "name": "Whiteblind", "level": 4}, {"id": 12408, "name": "Blackcliff Slasher", "level": 4}, {"id": 12409, "name": "Serpent Spine", "level": 4}, {"id": 12410, "name": "Lithic Blade", "level": 4}, {"id": 12411, "name": "Snow-Tombed Starsilver", "level": 4}, {"id": 12412, "name": "Luxurious Sea-Lord", "level": 4}, {"id": 12414, "name": "Katsuragikiri Nagamasa", "level": 4}, {"id": 12416, "name": "Akuoumaru", "level": 4}, {"id": 12501, "name": "Skyward Pride", "level": 5}, {"id": 12502, "name": "Wolf's Gravestone", "level": 5}, {"id": 12503, "name": "Song of Broken Pines", "level": 5}, {"id": 12504, "name": "The Unforged", "level": 5}, {"id": 12510, "name": "Redhorn Stonethresher", "level": 5}, {"id": 13101, "name": "Beginner's Protector", "level": 1}, {"id": 13201, "name": "Iron Point", "level": 2}, {"id": 13301, "name": "White Tassel", "level": 3}, {"id": 13302, "name": "Halberd", "level": 3}, {"id": 13303, "name": "Black Tassel", "level": 3}, {"id": 13304, "name": "The Flagstaff", "level": 3}, {"id": 13401, "name": "Dragon's Bane", "level": 4}, {"id": 13402, "name": "Prototype Starglitter", "level": 4}, {"id": 13403, "name": "Crescent Pike", "level": 4}, {"id": 13404, "name": "Blackcliff Pole", "level": 4}, {"id": 13405, "name": "Deathmatch", "level": 4}, {"id": 13406, "name": "Lithic Spear", "level": 4}, {"id": 13407, "name": "Favonius Lance", "level": 4}, {"id": 13408, "name": "Royal Spear", "level": 4}, {"id": 13409, "name": "Dragonspine Spear", "level": 4}, {"id": 13414, "name": "Kitain Cross Spear", "level": 4}, {"id": 13415, "name": "\"The Catch\"", "level": 4}, {"id": 13416, "name": "Wavebreaker's Fin", "level": 4}, {"id": 13501, "name": "Staff of Homa", "level": 5}, {"id": 13502, "name": "Skyward Spine", "level": 5}, {"id": 13504, "name": "Vortex Vanquisher", "level": 5}, {"id": 13505, "name": "Primordial Jade Winged-Spear", "level": 5}, {"id": 13507, "name": "Calamity Queller", "level": 5}, {"id": 13509, "name": "Engulfing Lightning", "level": 5}, {"id": 14101, "name": "Apprentice's Notes", "level": 1}, {"id": 14201, "name": "Pocket Grimoire", "level": 2}, {"id": 14301, "name": "Magic Guide", "level": 3}, {"id": 14302, "name": "Thrilling Tales of Dragon Slayers", "level": 3}, {"id": 14303, "name": "Otherworldly Story", "level": 3}, {"id": 14304, "name": "Emerald Orb", "level": 3}, {"id": 14305, "name": "Twin Nephrite", "level": 3}, {"id": 14306, "name": "Amber Bead", "level": 3}, {"id": 14401, "name": "Favonius Codex", "level": 4}, {"id": 14402, "name": "The Widsith", "level": 4}, {"id": 14403, "name": "Sacrificial Fragments", "level": 4}, {"id": 14404, "name": "Royal Grimoire", "level": 4}, {"id": 14405, "name": "Solar Pearl", "level": 4}, {"id": 14406, "name": "Prototype Amber", "level": 4}, {"id": 14407, "name": "Mappa Mare", "level": 4}, {"id": 14408, "name": "Blackcliff Agate", "level": 4}, {"id": 14409, "name": "Eye of Perception", "level": 4}, {"id": 14410, "name": "Wine and Song", "level": 4}, {"id": 14412, "name": "Frostbearer", "level": 4}, {"id": 14413, "name": "Dodoco Tales", "level": 4}, {"id": 14414, "name": "Hakushin Ring", "level": 4}, {"id": 14415, "name": "Oathsworn Eye", "level": 4}, {"id": 14501, "name": "Skyward Atlas", "level": 5}, {"id": 14502, "name": "Lost Prayer to the Sacred Winds", "level": 5}, {"id": 14504, "name": "Memory of Dust", "level": 5}, {"id": 14506, "name": "Everlasting Moonglow", "level": 5}, {"id": 14509, "name": "Kagura's Verity", "level": 5}, {"id": 15101, "name": "Hunter's Bow", "level": 1}, {"id": 15201, "name": "Seasoned Hunter's Bow", "level": 2}, {"id": 15301, "name": "Raven Bow", "level": 3}, {"id": 15302, "name": "Sharpshooter's Oath", "level": 3}, {"id": 15303, "name": "Recurve Bow", "level": 3}, {"id": 15304, "name": "Slingshot", "level": 3}, {"id": 15305, "name": "Messenger", "level": 3}, {"id": 15306, "name": "Ebony Bow", "level": 3}, {"id": 15401, "name": "Favonius Warbow", "level": 4}, {"id": 15402, "name": "The Stringless", "level": 4}, {"id": 15403, "name": "Sacrificial Bow", "level": 4}, {"id": 15404, "name": "Royal Bow", "level": 4}, {"id": 15405, "name": "Rust", "level": 4}, {"id": 15406, "name": "Prototype Crescent", "level": 4}, {"id": 15407, "name": "Compound Bow", "level": 4}, {"id": 15408, "name": "Blackcliff Warbow", "level": 4}, {"id": 15409, "name": "The Viridescent Hunt", "level": 4}, {"id": 15410, "name": "Alley Hunter", "level": 4}, {"id": 15412, "name": "Mitternachts Waltz", "level": 4}, {"id": 15413, "name": "Windblume Ode", "level": 4}, {"id": 15414, "name": "Hamayumi", "level": 4}, {"id": 15415, "name": "Predator", "level": 4}, {"id": 15416, "name": "Mouun's Moon", "level": 4}, {"id": 15501, "name": "Skyward Harp", "level": 5}, {"id": 15502, "name": "Amos' Bow", "level": 5}, {"id": 15503, "name": "Elegy for the End", "level": 5}, {"id": 15507, "name": "Polar Star", "level": 5}, {"id": 15509, "name": "Thundering Pulse", "level": 5}, {"id": 20001, "name": "", "level": 5}, {"id": 10002, "name": "", "level": 1}, {"id": 10003, "name": "", "level": 1}, {"id": 10004, "name": "", "level": 1}, {"id": 10005, "name": "", "level": 1}, {"id": 10006, "name": "", "level": 1}, {"id": 10008, "name": "", "level": 1}]; \ No newline at end of file diff --git a/scripts/cheat/quickcommand.js b/scripts/cheat/quickcommand.js index 53a8d7d..1c3bc85 100644 --- a/scripts/cheat/quickcommand.js +++ b/scripts/cheat/quickcommand.js @@ -1,5 +1,6 @@ qucick_command = [ {name: "Heal All Characters", command: "heal", args: []}, + {name: "Get current position", command: "position", args: []}, {name: "Give Mora", command: "give 202", args: [ {type: "number", default: 100000, width: 145} ]}, @@ -18,6 +19,16 @@ qucick_command = [ ]}, {name: "Give all items", command: "giveall", args: []}, {name: "Clear all items", command: "clear all", args: []}, + {name: "Set talent E", command: "talent e", args: [ + {type: "number", default: 10, width: 60} + ]}, + {name: "Set talent Q", command: "talent q", args: [ + {type: "number", default: 10, width: 60} + + ]}, + {name: "Set talent N", command: "talent n", args: [ + {type: "number", default: 10, width: 60} + ]}, ] function genQuickCommand() { diff --git a/scripts/cheat/weapon.js b/scripts/cheat/weapon.js new file mode 100644 index 0000000..71734d5 --- /dev/null +++ b/scripts/cheat/weapon.js @@ -0,0 +1,50 @@ + +function genWeapon() { + var panel = document.getElementById("panel"); + panel.innerHTML = `
+

Send Weapon to you

+ +
+ + +
+ + + + +
`; + + updateWeaponList(); + document.getElementById("weapon-filter").onchange = updateWeaponList; + document.getElementById("execute").onclick = () => { + var weaponId = document.getElementById("weapon-id").value; + var amount = document.getElementById("amount").value; + var level = document.getElementById("level").value; + var refine = document.getElementById("refine").value; + sendCommand(`give ${weaponId} ${amount} ${level} ${refine}`); + } +} + +function updateWeaponList() { + var filter = document.getElementById("weapon-filter").value; + console.log(filter); + var select = document.getElementById("weapon-id"); + select.innerHTML = ""; + weapon_list.forEach(element => { + if (filter == 0 || element.level == filter){ + var o = document.createElement("option"); + o.innerText = `${element.name} - ${element.id}`; ; + o.value = element.id; + select.appendChild(o); + } + + }); + +} diff --git a/scripts/parent.js b/scripts/parent.js index 0e50b6e..4ca9ad7 100644 --- a/scripts/parent.js +++ b/scripts/parent.js @@ -1,4 +1,4 @@ -async function sendCommand(payload, method="invoke", background=false) { +async function sendCommand(payload, method="invoke", background=false, persistent="auto") { const parent = window.parent - return await parent.sendCommand(payload, method, background) + return await parent.sendCommand(payload, method, background, persistent) } \ No newline at end of file diff --git a/styles/cheat.css b/styles/cheat.css index 2ef511c..3ab111a 100644 --- a/styles/cheat.css +++ b/styles/cheat.css @@ -14,7 +14,7 @@ margin-left: 3em; display: flex; flex-direction: column; - min-width: 70vw; + width: 70vw; overflow-y: auto; }