Roukys / HHauto

GNU General Public License v3.0
45 stars 44 forks source link

AutoLogin #142

Closed RuperSama closed 3 years ago

RuperSama commented 3 years ago

Is your feature request related to a problem? Please describe. The game automatic log off

Describe the solution you'd like

in "hardened_start" i add this.

var loginPage = document.querySelector('[title="Conectar"]'); if(loginPage != null){ loginPage.click() return; }

with this, the main script dont start and the game go to the "login" page but i dont find how to write de mail and password text box (i was thinking in add in the begging 2 var for "hardcode" the email and password and the users of script should replace)

Roukys commented 3 years ago

Ive got another script for that but it is not really finished as they use ifram for another site for login. Security prevent to do some action

RuperSama commented 3 years ago

i make some test and this is working, but i need to make some "delay" between the steps for work, any idea for make the delay?

var loginPage = document.querySelector('[title="Conectar"]'); if(loginPage != null){ loginPage.click() document.getElementById("auth-email").value = document.getElementById("auth-password").value = document.getElementById("submit-authenticate").click()

return; }

Roukys commented 3 years ago

only delay I know in js is settimeout(function, timeinMilli)

delay is needed in between click and setvalues right ?

for loginPage you should use [rel="phoenix_member_login"] it will be independant of language

Roukys commented 3 years ago

for sure I'll not add it in the script, can be another script, but in script, updates would remove the harcoded password ...

Roukys commented 3 years ago

@RuperSama : any better ? I've got cross domain security issues when I want to modify fields ...

cossname commented 3 years ago

@Roukys Pre-Login

// ==UserScript==
// @name         HH_preLogin
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        htt*://www.hentaiheroes.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    if ($('#contains_all > header > div > a:nth-child(1) > img').length>0) {
        $('.igreen[rel=phoenix_member_login]')[0].click();
    }
})();

Post-Login

// ==UserScript==
// @name         HH_login
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        htt*://eggs-ext.kinkoid.com/*
// @grant        none
// ==/UserScript==
function HHLoginData(){
    if (document.getElementById('auth-email').value == "") {
        document.getElementById('auth-email').value = "user@mail.com";}
    if (document.getElementById('auth-password').value == "") {
        document.getElementById('auth-password').value = "password";}
     setTimeout(HHLoginProcess,2000);
}
function HHLoginProcess(){
    if (document.getElementById('auth-email').value != "" && document.getElementById('auth-password').value!= ""){
        document.getElementById('submit-authenticate').click();
    } else {
         setTimeout(HHLoginProcess,2000);
    }
}

document.addEventListener("DOMContentLoaded", function(event) {
    setTimeout(HHLoginData,4000);
});

setTimeout(HHLoginData,5000);
RuperSama commented 3 years ago

Sorry for dont answer @Roukys i make it in one script i upload it. the script need to be changed by the user for set the value of 2 var's (email and password) for kinkoid HH work fine (idk if the script work un gayheroes but in nutaku dont work because is diferente login)

Roukys commented 3 years ago

Hello @RuperSama @cossname,

Seems you have 2 differents implementation, could you cross check I'll publish it in a script appart as for sure it won't work for nutaku ...

cossname commented 3 years ago

Nutaku didnt need login each time, only page reload

RuperSama commented 3 years ago

Hello @RuperSama @cossname,

Seems you have 2 differents implementation, could you cross check I'll publish it in a script appart as for sure it won't work for nutaku ...

Nutaku version use Nutaku system for login so for that version need to check it how is the site structure of nutaku.

the @cossname implementation use two script i made it the same but in one only script.

but i upload my script to my own git with other mini-script that i use. https://github.com/RuperSama/HentaiHeroesScripts

so if you want to have this project just focused in the "auto-play" that will be fine