Instructions on how to give control of cards in spell/trap/field zones and summon spells/traps from the hand/deck/grave

If you have a suggestion for the site, create a topic here and telll us about it
Christen57
User avatar
Posts: 1014
Joined: Sun May 07, 2017 10:37 pm
Reputation: 114

Instructions on how to give control of cards in spell/trap/field zones and summon spells/traps from the hand/deck/grave

Post #1 by Christen57 » Mon Jun 28, 2021 4:51 am

Currently on duelingbook, there is no way to do any of the following:

  • Special Summon Spells/Traps that are in the hand, deck, graveyard, or banished except for a few specific ones such as the Paleozoic traps.
  • Give control of cards in your field zone or spell & trap zone to the opponent.
  • Special Summon, move to the spell & trap zone, or set to the spell & trap zone xyz materials attached to cards.
  • Set cards directly from your hand, deck, any graveyard, and among the banished cards to the spell & trap zone.

Now, with javascript, you can do all of these things. https://www.duelingbook.com/replay?id=58994-29585538

For this to work, you need to make sure javascript is enabled and allowed on your browser and on duelingbook, and refresh/reload the page if you have to, although javascript should be enabled and allowed by default on duelingbook.

Image

Create a new javascript bookmark and name it whatever you want. I will name mine "summon opponent's spells/traps".

In the address/URL/location box, copy and paste this code:

Code: Select all

javascript:function cardMenuE() { if (!Duelist()) { menu_reason = "You are not a duelist"; return; } var card = $(this).parent(); if (card.data("controller") != player1) { if (card.data("controller") == player3) { updateController(player1, card); updateOwner(player1, card); } } if (card == menu_card) { menu_reason = "card is menu_card"; return; } if (!viewing) { if (!isPlayer1(card.data("controller").username)) { menu_reason = "You don't control this card"; return; } if (isIn(card, player1.main_arr) >= 0) { menu_reason = "Card is in the Deck"; return; } if (isIn(card, player1.extra_arr) >= 0) { menu_reason = "Card is in the Extra Deck"; return; } }  if (automatic) { cardMenuE2(card); return; }  var menu = []; if (card.data("controller") != player1) { if (isIn(card, player1.opponent.grave_arr) >= 0 || isIn(card, player1.opponent.banished_arr) >= 0) { if (hasAvailableMonsterZones(player1)) { menu.push({label:"SS ATK",data:"SS ATK"}); if (card.data("cardfront").data("monster_color") != "Link") { menu.push({label:"SS DEF",data:"SS DEF"}); } } if (isIn(card, player1.opponent.grave_arr) >= 0) { menu.push({label:"Banish",data:"Banish"}); } else { menu.push({label:"To Grave",data:"To GY"}); } } if ((viewing == "Opponent's Deck (partial)" || viewing == "Opponent's Deck (Top 3 Cards)" || viewing == "Opponent's Deck (Top 5 Cards)") && isIn(card, player1.opponent.main_arr) >= 0) { if (findCard(["Destiny HERO - Dominance", "Flower Cardian Peony with Butterfly", "Goddess Skuld's Oracle", "Millennium Necklace", "SPYRAL GEAR - Drone"])) { menu.push({label:"To Top of Deck",data:"To T Deck 2"}); } if (findCard(["Flower Cardian Peony with Butterfly"])) { menu.push({label:"To Bottom of Deck",data:"To B Deck 2"}); } } } else { if (currentPhase == "BP" && turn_player.username == username && !card.data("face_down") && isMonster(player1, card)) { if (card.data("inATK")) { if (countMonsters(player2) > 0) { menu.push({label:"Attack",data:"Attack"}); } menu.push({label:"Attack Directly",data:"Attack directly"}); } else { switch (card.data("cardfront").data("name")) { default: if (card.data("cardfront").data("effect").indexOf("This card can attack while in face-up Defense Position") < 0) { break; } case "Elemental HERO Rampart Blaster": case "Invoked Cocytus": case "Superheavy Samurai Beast Kyubi": case "Superheavy Samurai Big Benkei": case "Superheavy Samurai General Jade": case "Superheavy Samurai Ninja Sarutobi": case "Superheavy Samurai Ogre Shutendoji": case "Superheavy Samurai Stealth Ninja": case "Superheavy Samurai Steam Train King": case "Superheavy Samurai Swordmaster Musashi": case "Superheavy Samurai Wagon": case "Superheavy Samurai Warlord Susanowo": case "Total Defense Shogun": if (countMonsters(player2) > 0) { menu.push({label:"Attack",data:"Attack"}); } menu.push({label:"Attack Directly",data:"Attack directly"}); } } } if (card.data("cardfront").data("type") == "Field" && !player1.fieldSpell && (isIn(card, player1.grave_arr) >= 0 || isIn(card, player1.banished_arr) >= 0)) { menu.push({label:"Activate",data:"Activate Field Spell"}); menu.push({label:"Set",data:"Set Field Spell"}); } if (isIn(card, player1.hand_arr) >= 0) { if (card.data("cardfront").data("pendulum")) { if (links && !player1.s1 || !links && !player1.pendulumLeft) { menu.push({label:"Activate Left",data:"Activate Pendulum Left"}); } if (links && !player1.s5 || !links && !player1.pendulumRight) { menu.push({label:"Activate Right",data:"Activate Pendulum Right"}); } } if (card.data("cardfront").data("type") != "Field" && card.data("cardfront").data("card_type") != "Monster" && hasAvailableSTZones(player1)) { if (card.data("cardfront").data("card_type") == "Spell") { menu.push({label:"Activate",data:"Activate ST"}); } menu.push({label:"Set",data:"Set ST"}); } if (card.data("cardfront").data("type") == "Field" && !player1.fieldSpell) { menu.push({label:"Activate",data:"Activate Field Spell"}); menu.push({label:"Set",data:"Set Field Spell"}); } if (hasAvailableMonsterZones(player1)) { if (card.data("cardfront").data("card_type") == "Monster") { menu.push({label:"Normal Summon",data:"Normal Summon"}); menu.push({label:"Set",data:"Set monster"}); } else if (findCard(["Magical Hats"])) { menu.push({label:"Set to Monster Zone",data:"Set monster"}); } } } if (card.data("cardfront").data("monster_color") == "Xyz" && isIn(card, player1.extra_arr) >= 0 && countOverlayOptions(player1) >= 1) { menu.push({label:"OL ATK",data:"OL ATK"}); menu.push({label:"OL DEF",data:"OL DEF"}); } if (hasAvailableMonsterZones(player1) && !card.data("isXyzMaterial") && !isMonster(player1, card) && !isST(player1, card)) { menu.push({label:"S. Summon ATK",data:"SS ATK"}); if (card.data("cardfront").data("monster_color") != "Link") { menu.push({label:"S. Summon DEF",data:"SS DEF"}); } } if (card.data("cardfront").data("monster_color") == "Token") { menu.push({label:"Remove",data:"Remove Token"}); if (isMonster(player1, card)) { if (card.data("inDEF")) { menu.push({label:"To ATK",data:"To ATK"}); } else if (card.data("cardfront").data("monster_color") != "Link") { menu.push({label:"To DEF",data:"To DEF"}); } } menu.push({label:"Change Control",data:"Change control"}); menu.push({label:"Move",data:"Move"}); } else { if (isST(player1, card) && card.data("face_down")) { menu.push({label:"Activate",data:"Activate ST"}); } if (player1.fieldSpell && card[0] == player1.fieldSpell[0] && card.data("face_down")) { menu.push({label:"Activate",data:"Activate Field Spell"}); } if (isIn(card, player1.main_arr) >= 0) { menu.push({label:"To Hand",data:"To hand"}); if (!player1.fieldSpell && card.data("cardfront").data("type") == "Field") { menu.push({label:"Activate",data:"Activate Field Spell"}); } } if (isIn(card, player1.grave_arr) < 0 && !card.data("isXyzMaterial")) { menu.push({label:"To Graveyard",data:"To GY"}); } if (!card.data("face_down")) { if (isMonster(player1, card) || isST(player1, card) || player1.fieldSpell && card[0] == player1.fieldSpell[0] || player1.pendulumLeft && card[0] == player1.pendulumLeft[0] || player1.pendulumRight && card[0] == player1.pendulumRight[0] || isIn(card, player1.grave_arr) >= 0 || isIn(card, player1.banished_arr) >= 0) { menu.push({label:"Declare",data:"Declare"}); } } if (isMonster(player1, card)) { if (card.data("inDEF")) { if (card.data("face_down")) { menu.push({label:"Flip Summon",data:"Flip Summon"}); menu.push({label:"Flip",data:"Flip"}); } else { menu.push({label:"To ATK",data:"To ATK"}); } } else if (card.data("cardfront").data("monster_color") != "Link") { menu.push({label:"To DEF",data:"To DEF"}); } if (!card.data("face_down") && card.data("cardfront").data("monster_color") != "Link") { menu.push({label:"Set",data:"Set monster"}); } } if (isST(player1, card) && !card.data("face_down")) { menu.push({label:"Set",data:"Set ST"}); } if (player1.fieldSpell && card[0] == player1.fieldSpell[0] && !card.data("face_down")) { menu.push({label:"Set",data:"Set Field Spell"}); } if (isIn(card, player1.hand_arr) < 0 && isIn(card, player1.main_arr) < 0 && !isExtraDeckCard(card) && card.data("cardfront").data("monster_color") != "Token" && !card.data("isXyzMaterial")) { menu.push({label:"To Hand",data:"To hand"}); } if (isIn(card, player1.banished_arr) < 0) { menu.push({label:"Banish",data:"Banish"}); if (findCard([ "Black Luster Soldier - Envoy of the Evening Twilight", "Blue Duston", "Chaos Scepter Blast", "Eater of Millions", "Elemental HERO Nebula Neos", "Evening Twilight Knight", "Evenly Matched", "Banquet of Millions", "Gizmek Orochi, the Serpentron Sky Slasher", "Lightforce Sword", "Necro Fusion", "Network Trap Hole", "Number 89: Diablosis the Mind Hacker", "PSY-Frame Overload", "Super Koi Koi", "Transmission Gear", "Treasure Panda", "Wind-Up Zenmaintenance", "Xyz Override" ], true) || isIn(card, player1.main_arr) >= 0 || isIn(card, player1.extra_arr) >= 0 || card.data("face_down")) { menu.push({label:"Banish FD",data:"Banish FD"}); } } if (player1.opponent == null) { player1.opponent = player2; } if ((isMonster(player1, card) || isST(player1, card) || (player1.fieldSpell && card[0] == player1.fieldSpell[0])) && hasAvailableMonsterZones(player1.opponent)) { menu.push({label:"Change Control",data:"Change control"}); } if (isExtraDeckCard(card) && isIn(card, player1.extra_arr) < 0) { menu.push({label:"To Extra Deck",data:"To ED"}); } if (card.data("cardfront").data("pendulum")) { menu.push({label:"To Extra Deck FU",data:"To ED FU"}); } if (!isExtraDeckCard(card) && isIn(card, player1.main_arr) < 0 && !card.data("isXyzMaterial")) { menu.push({label:"To Top of Deck",data:"To T Deck"}); if (isIn(card, player1.extra_arr) < 0) { menu.push({label:"To Bottom of Deck",data:"To B Deck"}); } } if (card.data("cardfront").data("pendulum") && !card.data("face_down") && (isMonster(player1, card) || isST(player1, card))) { if (!links) { if (!player1.pendulumRight) { menu.push({label:"To P. Right",data:"Activate Pendulum Right"}); } if (!player1.pendulumLeft) { menu.push({label:"To P. Left",data:"Activate Pendulum Left"}); } } }      if (isMonster(player1, card) || isST(player1, card) || (player1.fieldSpell && card[0] == player1.fieldSpell[0]) || (player1.pendulumRight && card[0] == player1.pendulumRight[0]) || (player1.pendulumLeft && card[0] == player1.pendulumLeft[0])) { menu.push({label:"Target",data:"Target"}); }    if (isMonster(player1, card) || isST(player1, card) || (player1.fieldSpell && card[0] == player1.fieldSpell[0]) && !card.data("face_down")) { menu.push({label:"Move",data:"Move"}); } if (isMonster(player1, card) && countOverlayOptions(player1) > 1 && !card.data("face_down")) { menu.push({label:"Overlay",data:"Overlay"}); } if ((isIn(card, player1.hand_arr) >= 0 && card.data("cardfront").data("card_type") != "Spell") || isIn(card, player1.main_arr) >= 0 || isIn(card, player1.grave_arr) >= 0 || isIn(card, player1.banished_arr) >= 0) { if (hasAvailableSTZones(player1) && card.data("cardfront").data("type") != "Field") { if (card.data("cardfront").data("card_type") == "Monster" || (isIn(card, player1.hand_arr) < 0 && isIn(card, player1.main_arr) < 0)) { menu.push({label:"Set (To S/T)",data:"Set ST"}); } menu.push({label:"To S/T",data:"To ST"}); } } if (isIn(card, player1.hand_arr) >= 0) { menu.push({label:"Declare",data:"Declare"}); } if (isIn(card, player1.hand_arr) >= 0 || isIn(card, player1.extra_arr) >= 0) { menu.push({label:"Reveal",data:"Reveal"}); } if (!card.data("face_down")) { if (isMonster(player1, card)) { switch (card.data("cardfront").data("name")) { case "Parasite Paracide": menu.push({label:"Resolve Effect",data:"To T Deck 2 FU"}); break; case "SPYRAL GEAR - Drone": if (player1.opponent.main_arr.length >= 3) { menu.push({label:"Look at cards",data:"Spyral event"}); } break; case "Destiny HERO - Dominance": if (player1.opponent.main_arr.length >= 5) { menu.push({label:"Look at opponent cards",data:"Dominance event"}); } break; case "Zolga the Prophet": if (player1.opponent.main_arr.length >= 1) { menu.push({label:"Look at opponent cards",data:"Zolga event"}); } break; case "Flower Cardian Peony with Butterfly": if (player1.opponent.main_arr.length >= 3) { menu.push({label:"Look at cards",data:"Peony event"}); } break; case "Aegaion the Sea Castrum": if (player1.opponent.extra_arr.length > 0) { menu.push({label:"Resolve Effect",data:"Random extra event"}); } break; case "Number 78: Number Archive": if (player1.extra_arr.length > 0) { menu.push({label:"Resolve Effect",data:"Banish random ED card"}); } break; case "Kozmo Tincan": case "Noble Knight Borz": if (player1.main_arr.length >= 3) { menu.push({label:"Resolve Effect",data:"Tincan effect"}); } break; case "Crowley, the First Propheseer": case "Power Tool Dragon": case "Machina Metalcruncher": if (player1.main_arr.length >= 3) { menu.push({label:"Resolve Effect",data:"Crescent effect"}); } break; case "Salamangreat Foxy": if (player1.main_arr.length >= 3) { menu.push({label:"Banish 3 Cards",data:"Banish top 3 cards"}); } break; case "Time Thief Redoer": if (player1.opponent.main_arr.length >= 1) { menu.push({label:"Resolve Effect",data:"Redoer event"}); } break; } if (card.data("cardfront").data("id") == 10190) { if (player1.extra_arr.length >= 1) { menu.push({label:"Banish Random Card",data:"Banish random ED card 2"}); } } } if (isST(player1, card)) { if (card.data("cardfront").data("name") == "Pot of Desires" && player1.main_arr.length >= 12) { menu.push({label:"Banish 10 Cards FD",data:"Banish top 10 cards FD"}); } if (card.data("cardfront").data("name") == "Pot of Extravagance" && countFaceDownExtraDeckCards(player1) >= 3) { menu.push({label:"Banish 3 ED Cards FD",data:"Banish 3 random ED cards FD"}); } if (card.data("cardfront").data("name") == "Pot of Extravagance" && countFaceDownExtraDeckCards(player1) >= 6) { menu.push({label:"Banish 6 ED Cards FD",data:"Banish 6 random ED cards FD"}); }  if (card.data("cardfront").data("name") == "Pot of Duality" && player1.main_arr.length >= 3) { menu.push({label:"Banish 3 Cards",data:"Banish top 3 cards"}); } if (card.data("cardfront").data("name") == "That Grass Looks Greener" && player1.main_arr.length > player1.opponent.main_arr.length) { menu.push({label:"Mill " + String(player1.main_arr.length - player1.opponent.main_arr.length),data:"Mill difference"}); } if (card.data("cardfront").data("name") == "Pharaoh's Treasure") { menu.push({label:"To Top of Deck face-up",data:"To T Deck FU"}); } if (card.data("cardfront").data("id") == 11111 && player1.main_arr.length >= 3) { } if (card.data("cardfront").data("name") == "Spellbook Library of the Crescent" && player1.main_arr.length >= 3) { menu.push({label:"Resolve Effect",data:"Crescent effect"}); } if (card.data("cardfront").data("name") == "Bingo Machine, Go!!!" && player1.main_arr.length >= 3) { menu.push({label:"Resolve Effect",data:"Crescent effect"}); } if (card.data("cardfront").data("name") == "Exchange") { } if (card.data("cardfront").data("name") == "Goddess Skuld's Oracle" && player2.main_arr.length >= 3) { menu.push({label:"Look at cards",data:"Oracle event"}); } if (card.data("cardfront").data("name") == "You're in Danger!" && player1.main_arr.length >= 3) { menu.push({label:"Resolve Effect",data:"Alphan effect"}); } if (card.data("cardfront").data("name") == "Toon Page-Flip" && player1.main_arr.length >= 3) { menu.push({label:"Resolve Effect",data:"Alphan effect"}); } if (card.data("cardfront").data("name") == "Ancient Telescope" && player2.main_arr.length >= 1) { menu.push({label:"Look at cards",data:"Telescope event"}); } if (card.data("cardfront").data("name") == "Senri Eye") { menu.push({label:"Look at cards",data:"Senri event"}); } if (card.data("cardfront").data("name") == "Draw of Fate") { menu.push({label:"Resolve Effect",data:"Fate effect"}); } if (card.data("cardfront").data("name") == "Old Mind") { menu.push({label:"To Opponent's Hand",data:"To hand 2"}); } if (card.data("cardfront").data("name") == "Transmission Gear" && moderator >= 2) { } } if (isIn(card, player1.grave_arr) >= 0 || isMonster(player1, card)) { if (card.data("cardfront").data("name") == "Lilith, Lady of Lament") { if (player1.main_arr.length >= 3 && hasAvailableSTZones(player1)) { menu.push({label:"Resolve Effect",data:"Lilith effect"}); } } if (card.data("cardfront").data("name") == "Super Quantal Fairy Alphan") { if (player1.main_arr.length >= 3 && hasAvailableSTZones(player1)) { menu.push({label:"Resolve Effect",data:"Alphan effect"}); } } if (card.data("cardfront").data("name") == "Gizmek Orochi, the Serpentron Sky Slasher") { if (player1.main_arr.length >= 8) { menu.push({label:"Banish 8 Cards FD",data:"Banish top 8 cards FD"}); } } } if (card.data("cardfront").data("name") == "Golden Castle of Stromberg" && player1.fieldSpell && card[0] == player1.fieldSpell[0] && player1.main_arr.length >= 10) { menu.push({label:"Banish 10 Cards FD",data:"Banish top 10 cards FD"}); } if (card.data("cardfront").data("name") == "Malefic World" && player1.fieldSpell && card[0] == player1.fieldSpell[0] && player1.main_arr.length >= 3) { menu.push({label:"Resolve Effect",data:"Crescent effect"}); } if (card.data("cardfront").data("name") == "Cynet Storm" && player1.fieldSpell && card[0] == player1.fieldSpell[0]) { menu.push({label:"Resolve Effect", data:"Cynet Storm"}); } if (card.data("cardfront").data("name") == "Prescience" && player1.opponent.main_arr.length > 0) { menu.push({label:"Resolve Effect",data:"View top card 2"}); } } if (card.data("cardfront").data("type") == "Field" && isIn(card, player1.main_arr) >= 0) { if (findCard(["Set Rotation"])) { if (player1.fieldSpell == null) { menu.push({label:"Set",data:"Set Field Spell"}); } if (player1.opponent.fieldSpell == null) { menu.push({label:"Set to other side",data:"Set Field Spell 2"}); } } if (findCard(["Dream Mirror Hypnagogia"])) { if (player1.opponent.fieldSpell == null) { menu.push({label:"Activate to other side",data:"Activate Field Spell 2"}); } } } if (isIn(card, player1.hand_arr) >= 0 && findCard(["Amazoness Chain Master", "Exchange", "Graceful Tear", "Lullaby of Obedience", "Gold Moon Coin", "Magical Contract Door"]) || isIn(card, player1.banished_arr) >= 0 && findCard(["Gift Exchange"], true, true)) { menu.push({label:"To Opponent's Hand",data:"To hand 2"}); } if (findCard(["Jack-In-The-Hand"])) { menu.push({label:"To Opponent's Hand",data:"To hand 2"}); } if (card.data("isXyzMaterial")) { menu = []; menu.push({label:"Detach",data:"Detach"}); menu.push({label:"Banish",data:"Banish"}); menu.push({label:"SS ATK",data:"SS ATK"}); if (card.data("cardfront").data("monster_color") != "Link") { menu.push({label:"SS DEF",data:"SS DEF"}); } if (!isExtraDeckCard(card)) { menu.push({label:"To T. Deck",data:"To T Deck"}); } if (isExtraDeckCard(card)) { menu.push({label:"To Extra Deck",data:"To ED"}); } if (card.data("cardfront").data("pendulum")) { menu.push({label:"To Extra Deck FU",data:"To ED FU"}); } menu.push({label:"Set (To S/T)",data:"Set ST"}); menu.push({label:"To S/T",data:"To ST"}); } if ((viewing == "Deck (Picking 3 Cards)" || viewing == "Deck (Picking Card)") && (isIn(card, player1.main_arr) >= 0 || isIn(card, player1.opponent.main_arr) >= 0)) { menu = []; if (player1.temp_arr.indexOf(card.data("id")) < 0) { menu.push({label:"Choose",data:"Choose card"}); } } if (player1.skillCard && card[0] == player1.skillCard[0]) { menu = []; if (card.data("face_down")) { menu.push({label:"Activate",data:"Activate Skill"}); } else { menu.push({label:"Set",data:"Set Skill"}); if (card.data("cardfront").data("name") == "Millennium Necklace") { menu.push({label:"Look at cards",data:"Necklace event"}); } } } if (moderator >= 2 && isIn(card, player1.hand_arr) >= 0) { menu.push({label:"Swap",data:"Swap"}); } } } showMenu(card, menu); };function findCard(a) {if (a != "Question" && a != "Jack-In-The-Hand" && a != "Gift Exchange") {return true} else {return false}}


Save your bookmark.

Image

Now, when you go onto duelingbook and login, before you click on the big "DUEL!" arrow, click on your bookmark. After that, click on the big "DUEL!" arrow to login, and then while you're in any duels, you'll be able to any of the 4 things I listed at the beginning of this post.

Why would you want to do any of these things though? What are some uses for this javascript code?

There are quite a bit of uses for this code.

For example, let's say you want to set an opponent's spell/trap from their graveyard with the effect of Superheavy Samurai Warlord Susanowo.

The normal way you do this would be to have your opponent put the spell/trap in their spell & trap zone, then put it in their monster zone, then give control of it to you so you can then put it in your own spell & trap zone and set it. The problem is that that's a lot of steps for just 1 effect. Now, with this javascript code, you can resolve that effect much quicker by simply special summoning the opponent's spell/trap to your field, then moving it to your spell & trap zone and setting it.

Image

Another use for this code would be to quickly attach cards from your opponent's graveyard to an xyz monster you control without having to wait for the opponent to bring the card to your field first.

Image

Another use for this code would be to quickly put any 1 of your opponent's face-down banished cards back in the graveyard with something like Psy-Framelord Omega, instead of having to manually tell your opponent you want to put one of their banished card back in the grave and waiting for them to do it for you.

Image

Another use for this code would be to quickly attach a card from your deck to an xyz monster off of an effect like Number 90: Galaxy-Eyes Photon Lord. Instead of having to put the card in your spell & trap zone, then move it to your main monster zone, then attach it, you can just special summon it straight to the field and attach it, which is faster.

Image

Another use for this code would be to quickly special summon an xyz material with an effect like Cyber Dragon Nova or Odd-Eyes Absolute Dragon, instead of having to detach the material then open up your graveyard just to special summon what you detached.

Image

Another use for this code would be to quickly set an Artifact monster from the graveyard or a Sky Striker card from the graveyard without having to place it face-up in the spell & trap zone first.

Image

Another use for this code would be to quickly activate an F.A. field spell from the graveyard with the effect of F.A. Overheat without having to put the field spell in your hand first to activate it.

Image

Hopefully they just make it possible to do all these things I mentioned without people having to run this code. Also, for some reason, duelingbook currently but deliberately disallows players to set each other's spells/traps that are banished or in the graveyard to their own field no matter what, so I couldn't get this code to let me do that unfortunately. I have to special summon the opponent's spells/traps then manually move and set them.

robinatk
User avatar
Posts: 71
Joined: Sun Mar 19, 2017 12:08 am
Reputation: 6

Post #2 by robinatk » Mon Jul 05, 2021 4:43 pm

Tried on Chrome but all it does is perm give me the options from the over javascript that allows green buttons from cards such as Jack in the Hand/Question

Christen57
User avatar
Posts: 1014
Joined: Sun May 07, 2017 10:37 pm
Reputation: 114

Post #3 by Christen57 » Tue Jul 06, 2021 1:27 pm

robinatk wrote:Tried on Chrome but all it does is perm give me the options from the over javascript that allows green buttons from cards such as Jack in the Hand/Question


You're supposed to do it when you're right here in the login screen, before you click the "DUEL!" arrow.

Image

robinatk
User avatar
Posts: 71
Joined: Sun Mar 19, 2017 12:08 am
Reputation: 6

Post #4 by robinatk » Wed Jul 07, 2021 3:12 pm

Christen57 wrote:
robinatk wrote:Tried on Chrome but all it does is perm give me the options from the over javascript that allows green buttons from cards such as Jack in the Hand/Question


You're supposed to do it when you're right here in the login screen, before you click the "DUEL!" arrow.

Image


Yes I did that, still the same

Christen57
User avatar
Posts: 1014
Joined: Sun May 07, 2017 10:37 pm
Reputation: 114

Post #5 by Christen57 » Wed Jul 07, 2021 5:13 pm

What you need to do, in this specific order, is this:

Refresh/reload the duelingbook page.

Image

Then, before you login, click the bookmark.

Image

After that, login, go to a duel or solo mode, and see if you're able to special summon spells/traps from your hand.

Image

Christen57
User avatar
Posts: 1014
Joined: Sun May 07, 2017 10:37 pm
Reputation: 114

Post #6 by Christen57 » Thu Jul 15, 2021 2:43 pm

robinatk wrote:
Christen57 wrote:
robinatk wrote:Tried on Chrome but all it does is perm give me the options from the over javascript that allows green buttons from cards such as Jack in the Hand/Question


You're supposed to do it when you're right here in the login screen, before you click the "DUEL!" arrow.

Image


Yes I did that, still the same


See my above reply. I forgot to quote you so you get notified about it.

robinatk
User avatar
Posts: 71
Joined: Sun Mar 19, 2017 12:08 am
Reputation: 6

Post #7 by robinatk » Thu Jul 15, 2021 7:32 pm

Christen57 wrote:
robinatk wrote:
Christen57 wrote:
You're supposed to do it when you're right here in the login screen, before you click the "DUEL!" arrow.

Image


Yes I did that, still the same


See my above reply. I forgot to quote you so you get notified about it.


Yep it just started working all over a sudden, no idea why.
My log in credentials seem to be cached by chrome so it auto logs me in every time before I can do anything but doing it before pressing Duel seems to still work

Christen57
User avatar
Posts: 1014
Joined: Sun May 07, 2017 10:37 pm
Reputation: 114

Post #8 by Christen57 » Sat Nov 13, 2021 5:01 pm

Duelingbook received multiple updates since I last started this thread. One of the updates is that you can now, by default, give control of cards in the field zone and spell/trap zone to the opponent, without the need for any javascript commands, using the "Move" button.

However, some of duelingbook's other updates include that you can no longer (with or without javascript) move any of the opponent's face-down banished cards to any location other than the graveyard nor summon/set/add any xyz materials straight to the field or hand/deck, both of which you could previously do with javascript. This means that stuff like this is no longer possible.

Because of these updates, I've decided that updating my code is necessary here.

Code: Select all

javascript:function cardMenuE() {
   if (!Duelist()) {
      menu_reason = "You are not a duelist";
      return;
   }
   var card = $(this).parent();
   if (card.data("controller") != player1) {
      if (card.data("controller") == player3) {
         updateController(player1, card);
         updateOwner(player1, card);
      }
   }
   if (card == menu_card) {
      menu_reason = "card is menu_card";
      return;
   }
   if (!viewing) {
      if (!isPlayer1(card.data("controller").username)) {
         menu_reason = "You don't control this card";
         return;
      }
      if (isIn(card, player1.main_arr) >= 0) {
         menu_reason = "Card is in the Deck";
         return;
      }
      if (isIn(card, player1.extra_arr) >= 0) {
         menu_reason = "Card is in the Extra Deck";
         return;
      }
   }
   
   if (automatic) {
      cardMenuE2(card);
      return;
   }
   
   var menu = [];
   if (card.data("controller") != player1) {
      if (isIn(card, player1.opponent.grave_arr) >= 0 || isIn(card, player1.opponent.banished_arr) >= 0) {
         if ((card.data("cardfront").data("card_type") == "Monster") || (card.data("cardfront").data("card_type") == "Spell") || (card.data("cardfront").data("card_type") == "Trap")) {
            if (hasAvailableMonsterZones(player1)) {
               menu.push({label:"SS ATK",data:"SS ATK"});
               if (card.data("cardfront").data("monster_color") != "Link") {
                  menu.push({label:"SS DEF",data:"SS DEF"});
               }
            }
         }
         if (isIn(card, player1.opponent.grave_arr) >= 0) {
            menu.push({label:"Banish",data:"Banish"});
         }
         else {
            menu.push({label:"To Grave",data:"To GY"});
         }
      }
      if ((viewing == "Opponent's Deck (partial)" || viewing == "Opponent's Deck (Top 3 Cards)" || viewing == "Opponent's Deck (Top 5 Cards)") && isIn(card, player1.opponent.main_arr) >= 0) {
         if (findCard(["Destiny HERO - Dominance", "Flower Cardian Peony with Butterfly", "Goddess Skuld's Oracle", "Millennium Necklace", "SPYRAL GEAR - Drone"])) {
            menu.push({label:"To Top of Deck",data:"To T Deck 2"});
         }
         if (findCard(["Flower Cardian Peony with Butterfly"])) {
            menu.push({label:"To Bottom of Deck",data:"To B Deck 2"});
         }
      }
   }
   else {
      if (currentPhase == "BP" && turn_player.username == username && !card.data("face_down") && isMonster(player1, card)) {
         if (card.data("inATK")) {
            if (countMonsters(player2) > 0) {
               menu.push({label:"Attack",data:"Attack"});
            }
            menu.push({label:"Attack Directly",data:"Attack directly"});
         }
         else {
            switch (card.data("cardfront").data("name")) {
               default:
                  if (card.data("cardfront").data("effect").indexOf("This card can attack while in face-up Defense Position") < 0) {
                     break;
                  }
               case "Elemental HERO Rampart Blaster":
               case "Invoked Cocytus":
               case "Superheavy Samurai Beast Kyubi":
               case "Superheavy Samurai Big Benkei":
               case "Superheavy Samurai General Jade":
               case "Superheavy Samurai Ninja Sarutobi":
               case "Superheavy Samurai Ogre Shutendoji":
               case "Superheavy Samurai Stealth Ninja":
               case "Superheavy Samurai Steam Train King":
               case "Superheavy Samurai Swordmaster Musashi":
               case "Superheavy Samurai Wagon":
               case "Superheavy Samurai Warlord Susanowo":
               case "Total Defense Shogun":
                  if (countMonsters(player2) > 0) {
                     menu.push({label:"Attack",data:"Attack"});
                  }
                  menu.push({label:"Attack Directly",data:"Attack directly"});
            }
         }
      }
      if (isIn(card, player1.hand_arr) >= 0) {
         if (hasAvailableSTZones(player1) && card.data("cardfront").data("effect").indexOf("You can Set this card from your hand to your Spell") >= 0) {
            menu.push({label:"Set (To S/T)",data:"Set ST"});
         }
         if (card.data("cardfront").data("pendulum")) {
            if (links && (!player1.s1 || !player1.s5)) {
               menu.push({label:"Activate",data:player1.s1 && !player1.s5 ? "Activate Pendulum Right" : (!player1.s1 && player1.s5 ? "Activate Pendulum Left" : "Activate Pendulum")});
            }
            else if (!links) {
               if (!player1.pendulumLeft) {
                  menu.push({label:"Activate Left",data:"Activate Pendulum Left"});
               }
               if (!player1.pendulumRight) {
                  menu.push({label:"Activate Right",data:"Activate Pendulum Right"});
               }
            }
         }
         if (card.data("cardfront").data("type") != "Field" && card.data("cardfront").data("card_type") != "Monster" && hasAvailableSTZones(player1)) {
            if (card.data("cardfront").data("card_type") == "Spell") {
               menu.push({label:"Activate",data:"Activate ST"});
            }
            menu.push({label:"Set",data:"Set ST"});
         }
         if (card.data("cardfront").data("type") == "Field" && !player1.fieldSpell) {
            menu.push({label:"Activate",data:"Activate Field Spell"});
            menu.push({label:"Set",data:"Set Field Spell"});
         }
         if (hasAvailableMonsterZones(player1)) {
            if (card.data("cardfront").data("card_type") == "Monster") {
               menu.push({label:"Normal Summon",data:"Normal Summon"});
               menu.push({label:"Set",data:"Set monster"});
            }
            else if (findCard(["Magical Hats"])) {
               menu.push({label:"Set to Monster Zone",data:"Set monster"});
            }
         }
      }
      if (card.data("cardfront").data("monster_color") == "Xyz" && isIn(card, player1.extra_arr) >= 0 && countOverlayOptions(player1) >= 1) {
         menu.push({label:"OL ATK",data:"OL ATK"});
         menu.push({label:"OL DEF",data:"OL DEF"});
      }
      if ((hasAvailableMonsterZones(player1) || links && (!linkLeft || !linkRight) && isIn(card, player1.extra_arr) >= 0) && card.data("cardfront").data("card_type") == "Monster" && !card.data("isXyzMaterial") && !isMonster(player1, card) && !isST(player1, card)) {
         menu.push({label:"S. Summon ATK",data:"SS ATK"});
         if (card.data("cardfront").data("monster_color") != "Link") {
            menu.push({label:"S. Summon DEF",data:"SS DEF"});
         }
      }
      if ((isIn(card, player1.hand_arr) >= 0 || isIn(card, player1.grave_arr) >= 0 || isIn(card, player1.banished_arr) >= 0 || (document.getElementById("view").style.display == "block" && document.getElementById("view").getElementsByClassName("title_txt arial_rounded20")[0].innerHTML == "Viewing Deck")) && hasAvailableMonsterZones(player1)) {
         switch (card.data("cardfront").data("card_type")) {
            case "Spell":
            case "Trap":
               menu.push({label:"SS ATK",data:"SS ATK"});
               menu.push({label:"SS DEF",data:"SS DEF"});
               break;
         }
      }
      if (card.data("cardfront").data("monster_color") == "Token") {
         menu.push({label:"Remove",data:"Remove Token"});
         if (isMonster(player1, card)) {
            if (card.data("inDEF")) {
               menu.push({label:"To ATK",data:"To ATK"});
            }
            else if (card.data("cardfront").data("monster_color") != "Link") {
               menu.push({label:"To DEF",data:"To DEF"});
            }
         }
         menu.push({label:"Move",data:"Move"});
      }
      else {
         if (isST(player1, card) && card.data("face_down")) {
            menu.push({label:"Activate",data:"Activate ST"});
         }
         if (player1.fieldSpell && card[0] == player1.fieldSpell[0] && card.data("face_down")) {
            menu.push({label:"Activate",data:"Activate Field Spell"});
         }
         if (isIn(card, player1.main_arr) >= 0) {
            menu.push({label:"To Hand",data:"To hand"});
            if (!player1.fieldSpell && card.data("cardfront").data("type") == "Field") {
               menu.push({label:"Activate",data:"Activate Field Spell"});
            }
         }
         if (isIn(card, player1.grave_arr) < 0 && !card.data("isXyzMaterial")) {
            menu.push({label:"To Graveyard",data:"To GY"});
         }
         if (!card.data("face_down")) {
            if (isMonster(player1, card) || isST(player1, card) || player1.fieldSpell && card[0] == player1.fieldSpell[0] || player1.pendulumLeft && card[0] == player1.pendulumLeft[0] || player1.pendulumRight && card[0] == player1.pendulumRight[0] || isIn(card, player1.grave_arr) >= 0 || isIn(card, player1.banished_arr) >= 0) {
               menu.push({label:"Declare",data:"Declare"});
            }
         }
         if (!links && card.data("cardfront").data("pendulum") && isIn(card, player1.hand_arr) < 0) {
            if (!player1.pendulumLeft) {
               menu.push({label:"Activate Left",data:"Activate Pendulum Left"});
            }
            if (!player1.pendulumRight) {
               menu.push({label:"Activate Right",data:"Activate Pendulum Right"});
            }
         }
         if (isMonster(player1, card)) {
            if (card.data("inDEF")) {
               if (card.data("face_down")) {
                  menu.push({label:"Flip Summon",data:"Flip Summon"});
                  menu.push({label:"Flip",data:"Flip"});
               }
               else {
                  menu.push({label:"To ATK",data:"To ATK"});
               }
            }
            else if (card.data("cardfront").data("monster_color") != "Link") {
               menu.push({label:"To DEF",data:"To DEF"});
            }
            if (!card.data("face_down") && card.data("cardfront").data("monster_color") != "Link") {
               menu.push({label:"Set",data:"Set monster"});
            }
         }
         if (isST(player1, card) && !card.data("face_down")) {
            menu.push({label:"Set",data:"Set ST"});
         }
         if (player1.fieldSpell && card[0] == player1.fieldSpell[0] && !card.data("face_down")) {
            menu.push({label:"Set",data:"Set Field Spell"});
         }
         if (isIn(card, player1.hand_arr) < 0 && isIn(card, player1.main_arr) < 0 && !isExtraDeckCard(card) && card.data("cardfront").data("monster_color") != "Token" && !card.data("isXyzMaterial")) {
            menu.push({label:"To Hand",data:"To hand"});
         }
         if (isIn(card, player1.banished_arr) < 0) {
            menu.push({label:"Banish",data:"Banish"});
            if (findCard([
               "Black Luster Soldier - Envoy of the Evening Twilight",
               "Blue Duston",
               "Chaos Scepter Blast",
               "Eater of Millions",
               "Elemental HERO Nebula Neos",
               "Evening Twilight Knight",
               "Evenly Matched",
               "Banquet of Millions",
               "Gizmek Orochi, the Serpentron Sky Slasher",
               "Lightforce Sword",
               "Necro Fusion",
               "Network Trap Hole",
               "Number 89: Diablosis the Mind Hacker",
               "PSY-Frame Overload",
               "Small World",
               "Super Koi Koi",
               "Transmission Gear",
               "Treasure Panda",
               "Wind-Up Zenmaintenance",
               "Xyz Override"
            ], true) || isIn(card, player1.main_arr) >= 0 || isIn(card, player1.extra_arr) >= 0 || card.data("face_down")) {
               menu.push({label:"Banish FD",data:"Banish FD"});
            }
         }
         if (player1.opponent == null) {
            player1.opponent = player2;
         }
         if (isMonster(player1, card) && hasAvailableMonsterZones(player1.opponent)) {
         }
         if (isExtraDeckCard(card) && isIn(card, player1.extra_arr) < 0) {
            menu.push({label:"To Extra Deck",data:"To ED"});
         }
         if (card.data("cardfront").data("pendulum") && isIn(card, player1.main_arr) < 0 && isIn(card, player1.hand_arr) < 0) {
            menu.push({label:"To Extra Deck FU",data:"To ED FU"});
         }
         if (!isExtraDeckCard(card) && isIn(card, player1.main_arr) < 0 && !card.data("isXyzMaterial")) {
            menu.push({label:"To Top of Deck",data:"To T Deck"});
            if (findEffect("bottom", true, true, true) && isIn(card, player1.extra_arr) < 0) {
               menu.push({label:"To Bottom of Deck",data:"To B Deck"});
            }
         }
         if (isMonster(player1, card) || isST(player1, card) || (player1.fieldSpell && card[0] == player1.fieldSpell[0]) || (player1.pendulumRight && card[0] == player1.pendulumRight[0]) || (player1.pendulumLeft && card[0] == player1.pendulumLeft[0])) {
            menu.push({label:"Target",data:"Target"});
         }
         if (isMonster(player1, card) || isST(player1, card) || (player1.fieldSpell && card[0] == player1.fieldSpell[0]) && !card.data("face_down")) {
            menu.push({label:"Move",data:"Move"});
         }
         if (isMonster(player1, card) && countOverlayOptions(player1) > 1 && !card.data("face_down")) {
            menu.push({label:"Overlay",data:"Overlay"});
         }
         if ((isIn(card, player1.hand_arr) >= 0 && card.data("cardfront").data("card_type") != "Spell") || isIn(card, player1.main_arr) >= 0 || isIn(card, player1.grave_arr) >= 0 || isIn(card, player1.banished_arr) >= 0) {
            if (hasAvailableSTZones(player1)) {
               menu.push({label:"To S/T",data:"To ST"});
            }
         }
         if (isIn(card, player1.hand_arr) >= 0) {
            menu.push({label:"Declare",data:"Declare"});
         }
         if (isIn(card, player1.hand_arr) >= 0 || isIn(card, player1.extra_arr) >= 0 || isIn(card, player1.main_arr) >= 0 && findCard(["Small World"])) {
            menu.push({label:"Reveal",data:"Reveal"});
         }
         if (!card.data("face_down")) {
            if (isMonster(player1, card)) {
               switch (card.data("cardfront").data("name")) {
                  case "Parasite Paracide":
                     menu.push({label:"Resolve Effect",data:"To T Deck 2 FU"});
                     break;
                  case "SPYRAL GEAR - Drone":
                     if (player1.opponent.main_arr.length >= 3) {
                        menu.push({label:"Look at cards",data:"Spyral event"});
                     }
                     break;
                  case "Destiny HERO - Dominance":
                     if (player1.opponent.main_arr.length >= 5) {
                        menu.push({label:"Look at opponent cards",data:"Dominance event"});
                     }
                     break;
                  case "Zolga the Prophet":
                     if (player1.opponent.main_arr.length >= 1) {
                        menu.push({label:"Look at opponent cards",data:"Zolga event"});
                     }
                     break;
                  case "Flower Cardian Peony with Butterfly":
                     if (player1.opponent.main_arr.length >= 3) {
                        menu.push({label:"Look at cards",data:"Peony event"});
                     }
                     break;
                  case "Aegaion the Sea Castrum":
                     if (player1.opponent.extra_arr.length > 0) {
                        menu.push({label:"Resolve Effect",data:"Random extra event"});
                     }
                     break;
                  case "Number 78: Number Archive":
                     if (player1.extra_arr.length > 0) {
                        menu.push({label:"Resolve Effect",data:"Banish random ED card"});
                     }
                     break;
                  case "Kozmo Tincan":
                  case "Noble Knight Borz":
                     if (player1.main_arr.length >= 3) {
                        menu.push({label:"Resolve Effect",data:"Tincan effect"});
                     }
                     break;
                  case "Crowley, the First Propheseer":
                  case "Power Tool Dragon":
                  case "Machina Metalcruncher":
                     if (player1.main_arr.length >= 3) {
                        menu.push({label:"Resolve Effect",data:"Crescent effect"});
                     }
                     break;
                  case "Salamangreat Foxy":
                     if (player1.main_arr.length >= 3) {
                        menu.push({label:"Banish 3 Cards",data:"Banish top 3 cards"});
                     }
                     break;
                  case "Time Thief Redoer":
                     if (player1.opponent.main_arr.length >= 1) {
                        menu.push({label:"Resolve Effect",data:"Redoer event"});
                     }
                     break;
                  case "Necroface":
                     if (player1.opponent.banished_arr.length >= 1 || player2.opponent.banished_arr.length >= 1) {
                        menu.push({label:"Resolve Effect",data:"Necroface event"});
                     }
                     break;
               }
               if (card.data("cardfront").data("id") == 10190) {
                  if (player1.extra_arr.length >= 1) {
                     menu.push({label:"Banish Random Card",data:"Banish random ED card 2"});
                  }
               }
            }
            if (isST(player1, card)) {
               if (card.data("cardfront").data("name") == "Pot of Desires" && player1.main_arr.length >= 12) {
                  menu.push({label:"Banish 10 Cards FD",data:"Banish top 10 cards FD"});
               }
               if (card.data("cardfront").data("name") == "Pot of Extravagance" && countFaceDownExtraDeckCards(player1) >= 3) {
                  menu.push({label:"Banish 3 ED Cards FD",data:"Banish 3 random ED cards FD"});
               }
               if (card.data("cardfront").data("name") == "Pot of Extravagance" && countFaceDownExtraDeckCards(player1) >= 6) {
                  menu.push({label:"Banish 6 ED Cards FD",data:"Banish 6 random ED cards FD"});
               }
               
               if (card.data("cardfront").data("name") == "Pot of Duality" && player1.main_arr.length >= 3) {
                  menu.push({label:"Banish 3 Cards",data:"Banish top 3 cards"});
               }
               if (card.data("cardfront").data("name") == "That Grass Looks Greener" && player1.main_arr.length > player1.opponent.main_arr.length) {
                  menu.push({label:"Mill " + String(player1.main_arr.length - player1.opponent.main_arr.length),data:"Mill difference"});
               }
               if (card.data("cardfront").data("name") == "Pharaoh's Treasure") {
                  menu.push({label:"To Top of Deck face-up",data:"To T Deck FU"});
               }
               if (card.data("cardfront").data("id") == 11111 && player1.main_arr.length >= 3) {
               }
               if (card.data("cardfront").data("name") == "Spellbook Library of the Crescent" && player1.main_arr.length >= 3) {
                  menu.push({label:"Resolve Effect",data:"Crescent effect"});
               }
               if (card.data("cardfront").data("name") == "Bingo Machine, Go!!!" && player1.main_arr.length >= 3) {
                  menu.push({label:"Resolve Effect",data:"Crescent effect"});
               }
               if (card.data("cardfront").data("name") == "Exchange") {
               }
               if (card.data("cardfront").data("name") == "Goddess Skuld's Oracle" && player2.main_arr.length >= 3) {
                  menu.push({label:"Look at cards",data:"Oracle event"});
               }
               if (card.data("cardfront").data("name") == "You're in Danger!" && player1.main_arr.length >= 3) {
                  menu.push({label:"Resolve Effect",data:"Page-Flip effect"});
               }
               if (card.data("cardfront").data("name") == "Toon Page-Flip" && player1.main_arr.length >= 3) {
                  menu.push({label:"Resolve Effect",data:"Page-Flip effect"});
               }
               if (card.data("cardfront").data("name") == "Ancient Telescope" && player2.main_arr.length >= 1) {
                  menu.push({label:"Look at cards",data:"Telescope event"});
               }
               if (card.data("cardfront").data("name") == "Senri Eye") {
                  menu.push({label:"Look at cards",data:"Senri event"});
               }
               if (card.data("cardfront").data("name") == "Draw of Fate") {
                  menu.push({label:"Resolve Effect",data:"Fate effect"});
               }
               if (card.data("cardfront").data("name") == "Old Mind") {
                  menu.push({label:"To Opponent's Hand",data:"To hand 2"});
               }
               if (card.data("cardfront").data("name") == "Transmission Gear" && moderator >= 2) {
               }
               if (card.data("cardfront").data("name") == "Fusion Guard") {
                  menu.push({label:"Resolve Effect",data:"Banish random Fusion card"});
               }
            }
            if (isIn(card, player1.grave_arr) >= 0 || isMonster(player1, card)) {
               if (card.data("cardfront").data("name") == "Lilith, Lady of Lament") {
                  if (player1.main_arr.length >= 3 && hasAvailableSTZones(player1)) {
                     menu.push({label:"Resolve Effect",data:"Lilith effect"});
                  }
               }
               if (card.data("cardfront").data("name") == "Super Quantal Fairy Alphan") {
                  if (player1.main_arr.length >= 3 && hasAvailableSTZones(player1)) {
                     menu.push({label:"Resolve Effect",data:"Alphan effect"});
                  }
               }
               if (card.data("cardfront").data("name") == "Gizmek Orochi, the Serpentron Sky Slasher") {
                  if (player1.main_arr.length >= 8) {
                     menu.push({label:"Banish 8 Cards FD",data:"Banish top 8 cards FD"});
                  }
               }
            }
            if (card.data("cardfront").data("name") == "Golden Castle of Stromberg" && player1.fieldSpell && card[0] == player1.fieldSpell[0] && player1.main_arr.length >= 10) {
               menu.push({label:"Banish 10 Cards FD",data:"Banish top 10 cards FD"});
            }
            if (card.data("cardfront").data("name") == "Malefic World" && player1.fieldSpell && card[0] == player1.fieldSpell[0] && player1.main_arr.length >= 3) {
               menu.push({label:"Resolve Effect",data:"Crescent effect"});
            }
            if (card.data("cardfront").data("name") == "Cynet Storm" && player1.fieldSpell && card[0] == player1.fieldSpell[0]) {
               menu.push({label:"Resolve Effect", data:"Cynet Storm"});
            }
            if (card.data("cardfront").data("name") == "Prescience" && player1.opponent.main_arr.length > 0) {
               menu.push({label:"Resolve Effect",data:"View top card 2"});
            }
         }
         if (card.data("cardfront").data("type") == "Field" && isIn(card, player1.main_arr) >= 0) {
            if (findCard(["Set Rotation"])) {
               if (player1.fieldSpell == null) {
                  menu.push({label:"Set",data:"Set Field Spell"});
               }
               if (player1.opponent.fieldSpell == null) {
                  menu.push({label:"Set to other side",data:"Set Field Spell 2"});
               }
            }
            if (findCard(["Dream Mirror Hypnagogia"])) {
               if (player1.opponent.fieldSpell == null) {
                  menu.push({label:"Activate to other side",data:"Activate Field Spell 2"});
               }
            }
         }
         if (isIn(card, player1.hand_arr) >= 0 && findCard(["Amazoness Chain Master", "Exchange", "Graceful Tear", "Lullaby of Obedience", "Gold Moon Coin", "Magical Contract Door"]) || isIn(card, player1.banished_arr) >= 0 && findCard(["Gift Exchange"], true, true)) {
            menu.push({label:"To Opponent's Hand",data:"To hand 2"});
         }
         if (findCard(["Jack-In-The-Hand"])) {
            menu.push({label:"To Opponent's Hand",data:"To hand 2"});
         }
         if (card.data("isXyzMaterial")) {
            menu = [];
            menu.push({label:"Detach",data:"Detach"});
            menu.push({label:"Banish",data:"Banish"});
         }
         if ((viewing == "Deck (Picking 3 Cards)" || viewing == "Deck (Picking Card)") && (isIn(card, player1.main_arr) >= 0 || isIn(card, player1.opponent.main_arr) >= 0)) {
            menu = [];
            if (player1.temp_arr.indexOf(card.data("id")) < 0) {
               menu.push({label:"Choose",data:"Choose card"});
            }
         }
         if (player1.skillCard && card[0] == player1.skillCard[0]) {
            menu = [];
            if (card.data("face_down")) {
               menu.push({label:"Activate",data:"Activate Skill"});
            }
            else {
               menu.push({label:"Set",data:"Set Skill"});
               if (card.data("cardfront").data("name") == "Millennium Necklace") {
                  menu.push({label:"Look at cards",data:"Necklace event"});
               }
            }
         }
         if (moderator >= 2 && isIn(card, player1.hand_arr) >= 0) {
            menu.push({label:"Swap",data:"Swap"});
         }
      }
   }
   showMenu(card, menu);
};
function findCard(a) {if (a != "Question" && a != "Jack-In-The-Hand" && a != "Gift Exchange") {return true} else {return false}};


This is my updated code. In order for this to work, I believe that you no longer need to be specifically in the login screen as before, and instead just need to not be in a duel, when you run it.

With this updated code, you'll still be able to do some of what you could do with the previous code that you currently can't normally do by default on duelingbook:

  • Special Summon spells/traps from your hand or deck, as well as any spell/trap that is banished face-up or in either player's graveyard
  • Move any of your banished cards straight to your spell/trap zone
  • Move any opponent's banished card, whether it's face-up or face-down, to the graveyard

s.nickid
Posts: 49
Joined: Mon Jun 19, 2017 4:31 am
Reputation: 0

Post #9 by s.nickid » Wed Nov 24, 2021 10:20 pm

Is this not a bit risky, can people abuse the java script, to allowed them to change whatever they draw, and also change whatever his opponent draws, since the java script allowed to special summoned a spell card and neither a trap which you can't do that unless you used magical hat. I remember having 2 duel in a row where I was drawing nothing but spell card for 30 turns strait in both duel, so if it happen a 2nd time, he was problely abusing the java script, the first time it happen I give him the benefit of the doubt, just in-case it was bad luck, but then in happen on the second duel also, so to me that look suppicious that he was abusing the Java Script to cheat so I only draw spell card, I already did report him in the abuse report, and it was probebly like 3 or 4 month ago.

Christen57
User avatar
Posts: 1014
Joined: Sun May 07, 2017 10:37 pm
Reputation: 114

Post #10 by Christen57 » Wed Nov 24, 2021 11:23 pm

s.nickid wrote:Is this not a bit risky, can people abuse the java script, to allowed them to change whatever they draw, and also change whatever his opponent draws, since the java script allowed to special summoned a spell card and neither a trap which you can't do that unless you used magical hat. I remember having 2 duel in a row where I was drawing nothing but spell card for 30 turns strait in both duel, so if it happen a 2nd time, he was problely abusing the java script, the first time it happen I give him the benefit of the doubt, just in-case it was bad luck, but then in happen on the second duel also, so to me that look suppicious that he was abusing the Java Script to cheat so I only draw spell card, I already did report him in the abuse report, and it was probebly like 3 or 4 month ago.


As far as I'm aware, duelingbook is protected against those kinds of things and you can't use javascript to outright cheat like that, only to perform tedious tasks much more easily and efficiently. If you're drawing only spells for 30 turns straight, you probably just have too many spells in your deck in general.

s.nickid
Posts: 49
Joined: Mon Jun 19, 2017 4:31 am
Reputation: 0

Post #11 by s.nickid » Wed Nov 24, 2021 11:33 pm

then it was really weird that it cause me to only draw spell cards for 2 duel strait, the 2nd duel we did not leave, we stay. the third duel was a diffrent person and it did not happen again.


Return to “Suggestions”

Who is online

Users browsing this forum: Debt and 46 guests