복권 11회 S

수또를 자동으로 반복해서 돌려줍니다

目前為 2019-03-12 提交的版本,檢視 最新版本

// ==UserScript==
// @name     복권 11회 S
// @version  1.1R
// @include https://www.suyongso.com/lottery*
// @include https://www.suyongso.com/index.php?mid=lottery*
// @author 리드(https://www.suyongso.com)
// @description 수또를 자동으로 반복해서 돌려줍니다
// @grant    none
// @namespace https://greasyfork.org/users/226807
// ==/UserScript==

// myAjax 코오드 출처 https://www.suyongso.com/anidong/25599804
function myAjax(count) {
	if (count >= 13) {
    alert("복권 11회 완료! 이제 새로고침하면 됩니다.");
    return;
  }
  
	$.ajax({
		type: 'POST',
		url: 'https://www.suyongso.com/index.php',
		data : {moduel : "loterrylotto", act : "procLotterylottoBuyLottery"},
		success: function(){
			count++;
			myAjax(count);
      console.log(count);
		}
	});
}

// 아래 lotteryCountMaximum은 복권을 몇 장 샀는지 체크합니다. 11매일 경우 그냥 코드가 종료됩니다.
var lotteryCountMaximum = document.getElementsByClassName("r_info")[2].textContent;

if(lotteryCountMaximum === "11 매"){ 
  return;
}else{
  var r = confirm("확인을 누르시면 복권을 11장 구매합니다. 확인을 누른 뒤에는 조금만 기다려주세요.");
  if (r == true) {
    myAjax(0);
  } else {
    console.log("취소하셨습니다.");
  } 
}