골 D 로저 [1231053] · MS 2023 · 쪽지

2025-07-29 06:48:40
조회수 132

복권 매크로 코드

게시글 주소: https://orbi.kr/00074043417

window.alert = function() {}; 

let repeatId = null; // 반복 타이머 ID

let isPaused = false; // 중단 여부 상태


function sendBatchRequests() {

  if (isPaused) return;


  const promises = [];

  let has403 = false;

  let successCount = 0;


  const startTime = new Date();


  for (let i = 0; i < 30; i++) {

    const p = fetch("https://orbi.kr/amusement/lottery/buy_ticket", {

      method: "POST",

      headers: {

        "Content-Type": "application/json",

        "Accept": "application/json, text/plain, */*",

        "Origin": "https://orbi.kr",

        "Referer": "https://orbi.kr/amusement/lottery",

        "Cookie": document.cookie

      }

    })

    .then(res => {

      if (res.status === 403) {

        has403 = true;

        throw new Error("403 Forbidden");

      } else if (!res.ok) {

        // 200~299 범위가 아닌 경우

        throw new Error(`HTTP Error ${res.status}`);

      }

      return res.json();

    })

    .then(() => {

      successCount++;

    })

    .catch((err) => {

      // 400 등의 에러 포함됨

      console.warn(`⚠️ 요청 실패: ${err.message}`);

    });


    promises.push(p);

  }


  Promise.all(promises).then(() => {

    const endTime = new Date();

    const timeStr = endTime.toLocaleString();


    if (has403) {

      console.warn(`? 403 오류 감지됨. 2분 동안 중단합니다. (${timeStr})`);

      clearInterval(repeatId);

      isPaused = true;


      setTimeout(() => {

        console.log("⏳ 2분 경과. 반복 실행 재개합니다.");

        isPaused = false;

        repeatId = setInterval(sendBatchRequests, 60000);

        sendBatchRequests();

      }, 2 * 60 * 1000);

    } else {

      console.log(`✅ 요청 완료 (${timeStr}) - 성공: ${successCount}/30`);

    }

  });

}


// 최초 실행

repeatId = setInterval(sendBatchRequests, 60000);

sendBatchRequests();

rare-아이묭 rare-대성마이맥 rare-한컴오피스 한글 rare-춘식이

0 XDK (+0)

  1. 유익한 글을 읽었다면 작성자에게 XDK를 선물하세요.