수동봇 렐따, 방스틸 및 오류 해결책
분류
봇관련
조회 수
1,847
추천 수
1
수동봇(d2jsp.exe)의 starter.d2j 파일을 수정하였습니다.
다음 내용은 추가사항입니다.
첫째. 렐름따운이 걸렸을시 베틀넷을 로그아웃하여 설정한 시간만큼 기다리면서
1분 간격으로 비프음을 3회 발생시키고 시간이 다 되면 베틀넷 접속을 시도합니다.
둘째. 방스틸을 당했을 경우 10초 기다린후 바로 다음방을 만듭니다.(방따시간 설정과 무관)
셋째. 이미 방만들기(Create)버튼이 눌러져 봇이 멈추는 현상을 해결하였습니다.
넷째. Please Wait 메시지와 Lost Connection 메시지로 인해 봇이 멈추는 현상을 해결하였습니다.
다섯째. thething님 정보를 바탕으로 치킨등으로 최소시간이 무시되는 현상을 해결하였습니다.(방따시간 기준)
변수선언부에 다음항목을 추가합니다.
var realm_down_time = 60; // 렐따시 대기시간(분)
var pleaseWaitCancelButton = [6,351,337,96,32];
var ladderButton = [6,614,490,80,20];
var LastGameLength = 0;
var TotalGameCreateDelay = 0;
var realm_down_retry = 5;
다음으로 ChooseCharacter함수를 아래와 같이 바꿉니다.
function ChooseCharacter() {
dprint("We're at the char select screen. Choosing character for " + d2_game_types[game_type] + ".",1);
realm_down_retry--;
if(realm_down_retry==0) {
dprint("Choose Character Faild to 'Realm Down', Waiting " + realm_down_time + " minutes.", 1);
if(!find_and_click_control(charbuttons[1])) return false;
for(i = 0; i <= realm_down_time; i++) {
beep(3);
delay(500);
beep(3);
delay(500);
beep(3);
delay(59000);
}
realm_down_retry=5;
}
delay( (game_type==SINGLE_PLAYER ? 500 : 3000) );
if(!find_and_click_control(CharPositions[charposition])) return false;
if(!find_and_click_control(charbuttons[0])) return false;
}
다음으로 main함수를 아래와 같이 바꿉니다.
function main() {
var LastGameStarted = -1;
delay(3000);
while(!findLocation()) delay(1000);
dprint("Successfully logged onto battle.net.");
dprint("Starting game creations.");
while(1) {
LastGameStarted = me.gamestarttime;
if(createGame(gamename + (++total_games), gamepass)) {
game_failed = false;
while(!me.ingame) {
now = getTickCount();
if(now - LastGameAttempt > CreateGameTimeout && me.gamestarttime==LastGameStarted) {
dprint("Last Game Creation timed out. Attempting to create another game in 10 seconds.");
total_failed++;
game_failed = true;
delay(10000);
break;
} else {
delay(500);
}
}
if(!game_failed) {
while(me.ingame) { // we're in game now, wait till we leave the game.
delay(500);
}
now = getTickCount();
LastGameLength = now - LastGameAttempt;
dprint("Game End Detected! Elapsed time: " + (LastGameLength/1000) + " seconds");
realm_down_retry = 5;
if(LastGameLength < CreateGameTimeout) {
TotalGameCreateDelay = CreateGameTimeout - LastGameLength + GameCreateDelay;
} else {
TotalGameCreateDelay = GameCreateDelay;
}
dprint("Waiting " + (TotalGameCreateDelay/1000) + " seconds before starting next game.");
delay(TotalGameCreateDelay);
}
} else {
dprint("Failed to find a control for game creation. Will attempt to find location in 10 seconds.");
delay(4000);
ladderClick();
delay(2000);
pleaseWaitCancel();
delay(4000);
while(!findLocation()) delay(1000);
}
runGC();
delay(500);
}
}
다음으로 main함수가 끝나는 부분 아래에 다음의 두가지 함수를 추가합니다.
function ladderClick() {
if(!find_and_click_control(ladderButton)) return false;
return true;
}
function pleaseWaitCancel() {
if(!find_and_click_control(pleaseWaitCancelButton)) return false;
dprint("Please Wait Cancel or Lost Connection OK Button Click Success.");
}
마지막으로 createGame함수를 아래와 같이 바꿉니다.
function createGame(name, pass) {
if(random_gamename) name = TDW_BASIC_GetRandomString(rnd(4,15));
if(random_password) pass = TDW_BASIC_GetRandomString(rnd(4,15));
delay(1000);
if(!find_and_click_control(buttons[0])) return false;
delay(1000);
if(!find_control_and_set_text(editboxes[0], name)) return false;
delay(500);
if(!find_control_and_set_text(editboxes[1], pass)) return false;
delay(500);
if(!find_and_click_control(radiobuttons[difficulty])) return false;
delay(1000);
if(!find_and_click_control(buttons[1])) return false;
delay(2000);
if(ladderClick()) return false;
LastGameAttempt = getTickCount();
dprint("Game #" + total_games + " Created, " + total_failed + " fails so far. Now waiting for game to start...");
return true;
}
위 내용이 적용된 starter.d2j 파일을 압축하여 자료실에 올려놓았습니다.
혹시 문제가 발견되면 댓글 부탁드립니다.