Atsumaru Trick or Trade autoplay bot
Trick or Trade Autoplay (bookmarklet)
Estimated win rate: ~55-60%
Auto plays Haunt matches on atsu.moe/halloween. It reads your hand each round, waits 2 seconds, plays a card, and starts a new match 5 seconds after each one ends. It keeps going until you click the bookmark again.
Install
- Create a new bookmark in your browser (any name, e.g.
Atsu Autoplay). - Paste the code below into the bookmark's URL field.
- Open the Haunt tab on atsu.moe/halloween and click the bookmark. Click it again to stop.
javascript:(async()=%3E{if(window.__totStop)return%20void%20window.__totStop();if(!/%5C/halloween/.test(location.pathname))return%20void%20alert(%22Open%20atsu.moe/halloween%20(Haunt%20tab)%20first,%20then%20click%20the%20bookmark.%22);const%20t=1/0;let%20e=!1;window.__totStop=()=%3E{e=!0,c(%22Stopping%20after%20this%20move...%22)};const%20n=[%22Chapters%22,%22Comments%22,%22Rep%22,%22Days%22],o=t=%3Enew%20Promise(e=%3EsetTimeout(e,t)),a=async%20t=%3E{const%20n=Date.now()+t;for(;!e&&Date.now()%3Cn;)await%20o(100)},s=(t,e)=%3Et+Math.random()*(e-t),i=t=%3E[...document.querySelectorAll(%22button%22)].find(e=%3Et.test(e.innerText.trim()));let%20r=document.getElementById(%22__tot_toast%22);r||(r=document.createElement(%22div%22),r.id=%22__tot_toast%22,r.style.cssText=%22position:fixed;z-index:99999;right:12px;bottom:12px;max-width:360px;padding:10px%2014px;border-radius:10px;background:%231b1b1f;color:%23eee;font:13px/1.4%20system-ui,sans-serif;border:1px%20solid%20%236b5bd6;box-shadow:0%204px%2018px%20%230008;white-space:pre-line%22,document.body.appendChild(r));const%20c=t=%3E{r.textContent=t,console.log(%22[ToT]%22,t)},l=()=%3E{const%20t=[...document.querySelectorAll(%22div.card%22)].find(t=%3E/^Round%20%5Cd+%20of%20%5Cd+/.test(t.innerText.trim()));if(!t)return%20null;const%20e=t.innerText.split(%22%5Cn%22).map(t=%3Et.trim()).filter(Boolean),o=e[0].match(/Round%20(%5Cd+)%20of%20(%5Cd+)/),a=(e.find(t=%3E/points?$/.test(t))||%22%22).match(/%5Cd+/),s=e.find(t=%3En.includes(t));return{n:+o[1],of:+o[2],pts:a?+a[0]:1,stat:s,bar:t}},d=t=%3E{const%20e=(n=t,(n||%22%22).replace(/[%E2%88%92%E2%80%93%E2%80%94]/g,%22-%22)).toLowerCase();var%20n;const%20o={bonusRounds:{},onLoseOppPenalty:0,raw:t};let%20a=e.match(/%5C+(%5Cd+)%20in%20rounds?%20([%5Cd,%5Cs&and]+)/);return%20a&&(a[2].match(/%5Cd+/g)||[]).forEach(t=%3Eo.bonusRounds[+t]=(o.bonusRounds[+t]||0)+%20+a[1]),a=e.match(/if%20this%20loses,%20the%20opponent'?s%20next%20card%20gets%20-(%5Cd+)/),a&&(o.onLoseOppPenalty=+a[1]),o},p=t=%3E[...t.nextElementSibling.querySelectorAll(%22button.hw-card%22)].map(t=%3E{const%20e=t.innerText,o={};n.forEach(t=%3E{const%20n=e.match(new%20RegExp(t+%22%5C%5Cs*%5C%5Cn%5C%5Cs*(%5C%5Cd+)%22));o[t]=n?+n[1]:0});const%20a=e.split(%22%5Cn%22).map(t=%3Et.trim()).filter(Boolean),s=a.findIndex(t=%3E/%5Cbch%5Cb.*%5Cbcm%5Cb/.test(t)),i=(t.querySelector(%22.truncate%22)||{}).textContent||a[1]||%22?%22;return{el:t,name:i.trim(),stats:o,ability:d(s%3E=0?a.slice(s+1).join(%22%20%22):%22%22),mean:(o.Chapters+o.Comments+o.Rep+o.Days)/4}}),u=t=%3E{return%20e=(t-6)/2.6,.5*(1+Math.tanh(.7978845608*(e+.044715*e*e*e)));var%20e};let%20m=0,f=0;let%20h=[],b=0;const%20y=(t,e)=%3E{const%20n=t.of-t.n+1,o=5===t.of&&h.length===t.n-1&&Array.from(h).every(t=%3Et%3E=1&&t%3C=5),a=[1,2,3,4,5].filter(e=%3Ee!==t.pts-b&&!h.includes(e)),s=o&&a.length?a.reduce((t,e)=%3Et+e,0)/a.length:3,i=n%3E1?s*(n-1)/Math.max(1,e.length-1):0;let%20r=null;for(const%20n%20of%20e){const%20e=n.stats[t.stat]+(n.ability.bonusRounds[t.n]||0)+m-f;let%20o=n.mean;for(const[e,a]of%20Object.entries(n.ability.bonusRounds))+e%3Et.n&&(o+=.5*a);const%20a=n.ability.onLoseOppPenalty/4*(1-u(e))*.35*3,s=t.pts*u(e)+a-i*u(o);n.v=e,(!r||s%3Er.score)&&(r={c:n,score:s})}return%20r.c},w=async%20t=%3E{for(let%20n=0;n%3C40&&!e;n++){await%20o(150);const%20e=l();if(!e||e.n+%22|%22+e.pts+%22|%22+e.stat!==t)return}};let%20x=0,g=0,k=0,S=0,$=!1;const%20_=()=%3E%60W%20${g}%20/%20L%20${k}%60+(S?%60%20/%20other%20${S}%60:%22%22)+%60%20%20(${x}%20matches%20played)%60;for(c(%22Autoplay%20on.%20Click%20the%20bookmark%20again%20to%20stop.%22);!e;){const%20n=l();if(n){const%20t=p(n.bar);if(!t.length){await%20o(400);continue}$=!0,1===n.n&&(h=[],b=0);const%20i=n.pts-b,r=y(n,t);if(c(%60Match%20${x+1}:%20round%20${n.n}/${n.of},%20${n.pts}%20pts%20on%20${n.stat}%5CnPlaying%20${r.name}%20(${r.v})%5Cn${_()}%60),await%20a(2e3),e)break;const%20l=n.n+%22|%22+n.pts+%22|%22+n.stat;r.el.click(),await%20w(l),await%20o(s(250,600));const%20d=document.querySelector(%22div.grid.gap-8%22),u=d&&d.children[0],g=u?u.innerText:%22%22,k=g&&!/You%20take/i.test(g)&&!/Tie/i.test(g),S=/You%20take/i.test(g);m=k&&r.ability.onLoseOppPenalty?r.ability.onLoseOppPenalty:0;const%20v=u?[...u.querySelectorAll(%22span.font-serif%22)].pop():null;f=S&&v&&/Banshee/i.test(v.textContent)?2.5:0,h[n.n-1]=i,b=/Tie/i.test(g)?n.pts:0;continue}const%20r=i(/^Play%20again$/);if(r){if($){const%20t=document.body.innerText;/You%20won/i.test(t)?g++:/You%20lost/i.test(t)?k++:S++,x++,$=!1}if(m=0,f=0,x%3E=t){c(%22Done.%20%22+_());break}if(c(%22Match%20over.%20%22+_()+%22%5CnNext%20match%20in%205s...%22),await%20a(5e3),e)break;r.click(),await%20o(1200);continue}const%20d=i(/^Live%20duel$/),u=d&&[...d.parentElement.querySelectorAll(%22button%22)].find(t=%3E%22Haunt%22===t.innerText.trim());if(!(u&&x%3Ct)){c(%22Nothing%20to%20play%20right%20now.%20%22+_());break}if(c(%22Starting%20a%20Haunt%20match...%22),u.click(),await%20o(1500),!l()){c(%22Could%20not%20start%20a%20match%20(limit%20reached?).%20%22+_());break}}e&&c(%22Stopped.%20%22+_()),delete%20window.__totStop})();
What it does
- Plays house (Haunt) matches only. It does not touch Forfeit, Live duel, Challenge or Seal, and it does not edit your deck.
- Picks the best card for the round, but holds strong cards back on low-point rounds. Prizes are always 1-5, so it tracks which are left.
- Abilities it models:
| Ability | Text | How it is used |
|---|---|---|
| Insomniac | +n in rounds X and Y | Counted in those rounds, and kept for them |
| Banshee | If this loses, the opponent's next card gets -n | Used as a sacrifice card on low-stakes rounds, its penalty is applied to the opponent's next card when it loses |
| Opponent Banshee | Varies | After an opponent's Banshee loses, it assumes a -2.5 penalty on your next card |
- Any other ability is treated as no effect. It'll be modeled soon done worry
- It cannot see the opponent's hand, so matches will obviously be lost.
Source
Let me finish it first I'll add it soon dw
评论
?
参与讨论