iArtorias / speedhack-cpp

An utility to set the desired speed for your favorite game.
GNU General Public License v3.0
24 stars 4 forks source link

Add SpeedHack Audio #1

Open cheznewa opened 2 years ago

cheznewa commented 2 years ago

hello, this project is super i waiting one it!, and is possible to add speedhack but with audio pitch?

thanks, Newa Our Master.

iArtorias commented 2 years ago

Hi, the idea is interesting. I will think about it.

Trxmor commented 10 months ago

Hi iArtoias, I compare other couple of similar works but I prefer yours because of you meticulous coding and the stub. Do you mind add a keyboard shortcut? Thanks!

Trxmor commented 10 months ago

I tried this but it doesn't work CSpeedHack() { // Try reading the 'speedhack.txt' to obtain the speed multiplier for our speedhack std::wfstream stream( CProxyStub::instance().m_proxy_path / "speedhack.txt" );

    if (stream.good() || !stream.fail())
    {
        std::wstring _speed;
        std::getline( stream, _speed );

        if (!_speed.empty())
        {
            try
            {
                size_t ldx;
                auto speed = std::stod( _speed, &ldx );

                m_speed_multiplier = speed;

                if (GetAsyncKeyState(VK_DOWN) & 1) {
                    speed = 3.0;
                }
                if (GetAsyncKeyState(VK_UP) & 1) {
                    m_speed_multiplier = 3.0;
                }
            }
            catch (const std::invalid_argument&)
            {}
        }
    }
};
iArtorias commented 10 months ago

Hi, I can add it since it was in my to-do list anyway. The reason why your code isn't working is because you only run it once upon the function initialization. TL;DR you have to create a separate running thread where you can constantly check for the pressed key event.

Trxmor commented 10 months ago

Hi, I can add it since it was in my to-do list anyway. The reason why your code isn't working is because you only run it once upon the function initialization. TL;DR you have to create a separate running thread where you can constantly check for the pressed key event.

Thank you so much for replying, iArtorias!

However, this is beyond my knowledge and have little clue of what you're saying. I'm currently at a learning stage, a noob.

Trxmor commented 10 months ago

I could go on others that have the keyboard feature. It works but of course your works portray you mindset and your are simply unique & creative to me. And I really doubt when I see their coding styles not mentioning compilation errors and the fact, it's obvious have no originality or ripped off upon ripped off snippets.

Please create one or at least a snippet for newbie like me. Thank you so much!