Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Request) Auto-JumpBug #938

Closed
daisuki333 opened this issue Jan 2, 2020 · 38 comments
Closed

(Request) Auto-JumpBug #938

daisuki333 opened this issue Jan 2, 2020 · 38 comments

Comments

@daisuki333
Copy link
Contributor

daisuki333 commented Jan 2, 2020

Hello,
This may be a overly requested feature/thing and I might be just digging a hole to myself, but if it is possible for to add an Auto-JumpBug feature would be greatly appreciated. I'm not much of a coder and am still trying to learn a lot of stuff, i did try to add this feature but.. well not knowing too much ended in me rage-quitting on trying to add it. I know a lot of you will be very triggered by this post and most will simply ignore it like rest of the other requests like this one.
I am really sorry but like I said I would love that feature being added to the cheat.
I apologise if this was a waste of time, as I do know many of you are busy people.
Thank you.

Here's some links to assist with code for this feature:
https://github.com/Matherunner/tastools/blob/master/injectlib/movement.cpp#L697
https://www.unknowncheats.me/forum/counterstrike-global-offensive/336573-jump-bug-stamina-bug.html (this one is a help kind of thing but it does have some code in it which could possibly help.)
https://hatebin.com/iqoihvrdbn
https://www.unknowncheats.me/forum/counterstrike-global-offensive/245186-jump-bug.html

I also have some lua files for coding this if someone is able to convert luas to code and add it.
Here's one if needed:

skeet_jumpbug_lua_v1.txt

PS. I am new to github and majority of the things so pls dont bully me.

I apologise for this trash post.

@daisuki333 daisuki333 changed the title **(Request)** Auto-JumpBug (Request) Auto-JumpBug Jan 2, 2020
@woah1337
Copy link

woah1337 commented Jan 2, 2020

need engine prediction for this btw ^^
also duplicate issue obviously #773

@notgoodusename
Copy link

need engine prediction for this btw ^^
also duplicate issue obviously #773

you may need engine prediction, in theory you can trace a ray to the ground, check the distance beetwen the ground and you ,and when close to (i think) 7 units uncrouch

@ghost
Copy link

ghost commented Jan 2, 2020

altough this is a duplicate, it is of quality and has references. (are you from stack overflow?)
i dont think anybody is going to add auto jumpbug as is because there are other things that need to be improved (resolver, legit aa)

@daisuki333
Copy link
Contributor Author

altough this is a duplicate, it is of quality and has references. (are you from stack overflow?)
i dont think anybody is going to add auto jumpbug as is because there are other things that need to be improved (resolver, legit aa)

Thank you for the reply, also what do you mean by stack overflow. It was just a request, I don't mind it not being accepted, although it may be a common asked thing.

@ghost ghost mentioned this issue Jan 6, 2020
@JacksonDon
Copy link

@notgoodusename close it ❤️

@ghost
Copy link

ghost commented Feb 12, 2020

thats not the original poster nor repo owner so they can't close it.

Repository owner deleted a comment from JacksonDon Feb 20, 2020
Repository owner deleted a comment Feb 20, 2020
Repository owner deleted a comment from KibbeWater Feb 20, 2020
Repository owner deleted a comment from JacksonDon Feb 20, 2020
Repository owner deleted a comment from JacksonDon Feb 20, 2020
Repository owner deleted a comment from KibbeWater Feb 20, 2020
Repository owner deleted a comment from JacksonDon Feb 20, 2020
Repository owner deleted a comment from KibbeWater Feb 20, 2020
Repository owner deleted a comment from JacksonDon Feb 21, 2020
@Vonr
Copy link

Vonr commented Feb 24, 2020

bool bDidJump;
bool unduck;

void Misc::jumpBug(UserCmd* cmd) noexcept
{

    //if (!config.misc.edgejump) return;

    const auto localPlayer = interfaces.entityList->getEntity(interfaces.engine->getLocalPlayer());

    if (!localPlayer || !localPlayer->isAlive())
        return;

    float max_radias = M_PI * 2;
    float step = max_radias / 128;
    float xThick = 23;

    if (/*!config.misc.bunnyHop && */GetAsyncKeyState(config.misc.jumpBugKey) && (localPlayer->flags() & (1 << 0))) {
        //config.misc.bunnyHop = false;

        const auto [width, height] = interfaces.surface->getScreenSize();
        if (unduck) {
            bDidJump = false;
            cmd->buttons |= UserCmd::IN_DUCK; // duck
            cmd->buttons |= UserCmd::IN_JUMP; // jump
            unduck = false;
        }
        Vector pos = localPlayer->origin();
        for (float a = 0.f; a < max_radias; a += step) {
            Vector pt;
            pt.x = (xThick * cos(a)) + pos.x;
            pt.y = (xThick * sin(a)) + pos.y;
            pt.z = pos.z;


            Vector pt2 = pt;
            pt2.z -= 6;

            Trace fag;

            Ray ray = Ray(pt, pt2);

            TraceFilter flt = localPlayer;

            interfaces.engineTrace->traceRay(ray, 0x1400B, flt, fag);

            if (fag.fraction != 1.f && fag.fraction != 0.f) {
                bDidJump = true;
                cmd->buttons |= UserCmd::IN_DUCK; // duck
                cmd->buttons |= UserCmd::IN_JUMP; // jump
                unduck = true;
            }
        }
        for (float a = 0.f; a < max_radias; a += step) {
            Vector pt;
            pt.x = ((xThick - 2.f) * cos(a)) + pos.x;
            pt.y = ((xThick - 2.f) * sin(a)) + pos.y;
            pt.z = pos.z;

            Vector pt2 = pt;
            pt2.z -= 6;

            Trace fag;

            Ray ray = Ray(pt, pt2);

            TraceFilter flt = localPlayer;
            interfaces.engineTrace->traceRay(ray, 0x1400B, flt, fag);

            if (fag.fraction != 1.f && fag.fraction != 0.f) {
                bDidJump = true;
                cmd->buttons |= UserCmd::IN_DUCK;; // duck
                cmd->buttons |= UserCmd::IN_JUMP; // jump
                unduck = true;
            }
        }
        for (float a = 0.f; a < max_radias; a += step) {
            Vector pt;
            pt.x = ((xThick - 20.f) * cos(a)) + pos.x;
            pt.y = ((xThick - 20.f) * sin(a)) + pos.y;
            pt.z = pos.z;

            Vector pt2 = pt;
            pt2.z -= 6;

            Trace fag;

            Ray ray = Ray(pt, pt2);

            TraceFilter flt = localPlayer;
            interfaces.engineTrace->traceRay(ray, 0x1400B, flt, fag);

            if (fag.fraction != 1.f && fag.fraction != 0.f) {
                bDidJump = true;
                cmd->buttons |= UserCmd::IN_DUCK; // duck
                cmd->buttons |= UserCmd::IN_JUMP; // jump
                unduck = true;
            }
        }
    }



    //else { config.misc.bunnyHop = true; }

}

need some help fixing up this code. it doesnt work but it should be close

@Vonr
Copy link

Vonr commented Feb 24, 2020

@streamshark would be nice if you could help out

@streamshark
Copy link

what doesn't work with it? what happens when you try to use that

@KibbeWater
Copy link

I would guess this part
Ray ray = Ray(pt, pt2);
that should be deleted

and this should be
interfaces.engineTrace->traceRay({pt, pt2}, 0x1400B, flt, fag); and probably something else flag related

@Vonr
Copy link

Vonr commented Feb 25, 2020

@streamshark it just jump crouches
@KibbeWater will try later

@KibbeWater
Copy link

@streamshark it just jump crouches
@KibbeWater will try later

I think theres a better code for this out there. A friend of mine sent source from void.to that I'm still trying to get to work but I'm learning atleast

@Vonr
Copy link

Vonr commented Feb 25, 2020

it's been updated to this

static bool bDidJump;
static bool unduck;
static bool bhopWasEnabled;

void Misc::jumpBug(UserCmd* cmd) noexcept
{

    if (!config.misc.jumpBug) return;

    const auto localPlayer = interfaces.entityList->getEntity(interfaces.engine->getLocalPlayer());

    if (!localPlayer || !localPlayer->isAlive())
        return;

    float max_radias = M_PI * 2;
    float step = max_radias / 128;
    float xThick = 23;

    if (GetAsyncKeyState(config.misc.jumpBugKey) && (localPlayer->flags() & (1 << 0))) {
        if (config.misc.bunnyHop) {
            config.misc.bunnyHop = false;
            bhopWasEnabled = true;
        }

        const auto [width, height] = interfaces.surface->getScreenSize();
        if (unduck) {
            bDidJump = false;
            cmd->buttons |= UserCmd::IN_DUCK; // duck
            cmd->buttons |= UserCmd::IN_JUMP; // jump
            unduck = false;
        }
        Vector pos = localPlayer->origin();
        for (float a = 0.f; a < max_radias; a += step) {
            Vector pt;
            pt.x = (xThick * cos(a)) + pos.x;
            pt.y = (xThick * sin(a)) + pos.y;
            pt.z = pos.z;


            Vector pt2 = pt;
            pt2.z -= 6;

            Trace fag;

            TraceFilter flt = localPlayer;

            interfaces.engineTrace->traceRay({pt, pt2}, 0x1400B, flt, fag);

            if (fag.fraction != 1.f && fag.fraction != 0.f) {
                bDidJump = true;
                cmd->buttons |= UserCmd::IN_DUCK; // duck
                cmd->buttons |= UserCmd::IN_JUMP; // jump
                unduck = true;
            }
        }
        for (float a = 0.f; a < max_radias; a += step) {
            Vector pt;
            pt.x = ((xThick - 2.f) * cos(a)) + pos.x;
            pt.y = ((xThick - 2.f) * sin(a)) + pos.y;
            pt.z = pos.z;

            Vector pt2 = pt;
            pt2.z -= 6;

            Trace fag;

            TraceFilter flt = localPlayer;
            interfaces.engineTrace->traceRay({ pt, pt2 }, 0x1400B, flt, fag);

            if (fag.fraction != 1.f && fag.fraction != 0.f) {
                bDidJump = true;
                cmd->buttons |= UserCmd::IN_DUCK;; // duck
                cmd->buttons |= UserCmd::IN_JUMP; // jump
                unduck = true;
            }
        }
        for (float a = 0.f; a < max_radias; a += step) {
            Vector pt;
            pt.x = ((xThick - 20.f) * cos(a)) + pos.x;
            pt.y = ((xThick - 20.f) * sin(a)) + pos.y;
            pt.z = pos.z;

            Vector pt2 = pt;
            pt2.z -= 6;

            Trace fag;

            TraceFilter flt = localPlayer;
            interfaces.engineTrace->traceRay({ pt, pt2 }, 0x1400B, flt, fag);

            if (fag.fraction != 1.f && fag.fraction != 0.f) {
                bDidJump = true;
                cmd->buttons |= UserCmd::IN_DUCK; // duck
                cmd->buttons |= UserCmd::IN_JUMP; // jump
                unduck = true;
            }
        }
    }



    else if (bhopWasEnabled) { 
        config.misc.bunnyHop = true; 
        bhopWasEnabled = false;
    }

}

still doesnt work though

@ghost
Copy link

ghost commented Feb 25, 2020

pasting isn't learning; you have to right your own code to learn.
void.to is literally a pasting website

@KibbeWater
Copy link

it's been updated to this

static bool bDidJump;
static bool unduck;
static bool bhopWasEnabled;

void Misc::jumpBug(UserCmd* cmd) noexcept
{

    if (!config.misc.jumpBug) return;

    const auto localPlayer = interfaces.entityList->getEntity(interfaces.engine->getLocalPlayer());

    if (!localPlayer || !localPlayer->isAlive())
        return;

    float max_radias = M_PI * 2;
    float step = max_radias / 128;
    float xThick = 23;

    if (GetAsyncKeyState(config.misc.jumpBugKey) && (localPlayer->flags() & (1 << 0))) {
        if (config.misc.bunnyHop) {
            config.misc.bunnyHop = false;
            bhopWasEnabled = true;
        }

        const auto [width, height] = interfaces.surface->getScreenSize();
        if (unduck) {
            bDidJump = false;
            cmd->buttons |= UserCmd::IN_DUCK; // duck
            cmd->buttons |= UserCmd::IN_JUMP; // jump
            unduck = false;
        }
        Vector pos = localPlayer->origin();
        for (float a = 0.f; a < max_radias; a += step) {
            Vector pt;
            pt.x = (xThick * cos(a)) + pos.x;
            pt.y = (xThick * sin(a)) + pos.y;
            pt.z = pos.z;


            Vector pt2 = pt;
            pt2.z -= 6;

            Trace fag;

            TraceFilter flt = localPlayer;

            interfaces.engineTrace->traceRay({pt, pt2}, 0x1400B, flt, fag);

            if (fag.fraction != 1.f && fag.fraction != 0.f) {
                bDidJump = true;
                cmd->buttons |= UserCmd::IN_DUCK; // duck
                cmd->buttons |= UserCmd::IN_JUMP; // jump
                unduck = true;
            }
        }
        for (float a = 0.f; a < max_radias; a += step) {
            Vector pt;
            pt.x = ((xThick - 2.f) * cos(a)) + pos.x;
            pt.y = ((xThick - 2.f) * sin(a)) + pos.y;
            pt.z = pos.z;

            Vector pt2 = pt;
            pt2.z -= 6;

            Trace fag;

            TraceFilter flt = localPlayer;
            interfaces.engineTrace->traceRay({ pt, pt2 }, 0x1400B, flt, fag);

            if (fag.fraction != 1.f && fag.fraction != 0.f) {
                bDidJump = true;
                cmd->buttons |= UserCmd::IN_DUCK;; // duck
                cmd->buttons |= UserCmd::IN_JUMP; // jump
                unduck = true;
            }
        }
        for (float a = 0.f; a < max_radias; a += step) {
            Vector pt;
            pt.x = ((xThick - 20.f) * cos(a)) + pos.x;
            pt.y = ((xThick - 20.f) * sin(a)) + pos.y;
            pt.z = pos.z;

            Vector pt2 = pt;
            pt2.z -= 6;

            Trace fag;

            TraceFilter flt = localPlayer;
            interfaces.engineTrace->traceRay({ pt, pt2 }, 0x1400B, flt, fag);

            if (fag.fraction != 1.f && fag.fraction != 0.f) {
                bDidJump = true;
                cmd->buttons |= UserCmd::IN_DUCK; // duck
                cmd->buttons |= UserCmd::IN_JUMP; // jump
                unduck = true;
            }
        }
    }



    else if (bhopWasEnabled) { 
        config.misc.bunnyHop = true; 
        bhopWasEnabled = false;
    }

}

still doesnt work though

what errors

@KibbeWater
Copy link

pasting isn't learning; you have to right your own code to learn.
void.to is literally a pasting website

I'm learning to adapt it to my own script. Just cause I'm pasting doesn't mean that I'm not doing anything. I still get some kind of understanding how to use c++

@Vonr
Copy link

Vonr commented Feb 25, 2020

no errors, it just doesnt function as expected in game

@KibbeWater
Copy link

Then I don't know what to do, So I will just leave it to others. good luck

@Vonr
Copy link

Vonr commented Feb 25, 2020

got it to work but needs even more work because it doesnt properly detect floors if they arent flat. we need circle detection.

   X  X  X
X           X
X     X     X
X           X
   X  X  X

@Vonr
Copy link

Vonr commented Feb 25, 2020

or if we can cast a really big ray that would probably also work

@Vonr
Copy link

Vonr commented Feb 25, 2020

if someone could tell me the size of the player feet collision box that would be really helpful

@Vonr
Copy link

Vonr commented Feb 25, 2020

on a seperate note im having trouble saving the keybind and checkbox of jumpbug

@noteffex
Copy link
Contributor

If player is on air start a ray from player's abs origin to 4 units down
When the ray touches the ground, tap the duck button.
Simple, dont overcomplicate stuff

@KibbeWater
Copy link

I just got my email blasted. Also people has gotten this to work like 80%-100% of the times so I really don't think theres anything with Osiris thats limiting

@streamshark
Copy link

Effex the issue is the duck needs to be precisely timed so any unevenness in landing surface can throw off timing. Single ray method is unreliable

@ghost
Copy link

ghost commented Feb 25, 2020

just scan in a radius around the player, orthographically, of course.
the highest value you get is where the floor is.

I don't know about cs but in tf2 the player collisions are cubes rather than capsules.
if you did a raycast every 4 units around a squares perimeter you would only have to do 32 casts.

@streamshark
Copy link

or if we can cast a really big ray that would probably also work

if possible this is better than casting a bunch of rays in a pattern

@streamshark
Copy link

https://sm.alliedmods.net/new-api/sdktools_trace/TR_TraceHull
from AlliedMods: player col box size is 32x32x72
mins {-16.0, -16.0, 0.0} maxs {16.0, 16.0, 72.0}

if someone can hook tracehull we could use the player col box size to just trace the size of it downwards

@ghost
Copy link

ghost commented Feb 26, 2020

is SourceMod a thing all servers run or is it a plugin? it might be server side only.

@streamshark
Copy link

source sdk uses UTIL_TRACEHULL frequently but it looks like you can use the regular enginetrace function to trace a hull if you set it up right, here's what I found on unknowncheats:

void TraceHull(Vector3 &src, Vector3 &end, trace_t &tr)
{
	Ray_t ray;
	ray.Init(src, end, Vector3(-2.0f, -2.0f, -2.0f), Vector3(2.0f, 2.0f, 2.0f));

	CTraceFilterWorldAndPropsOnly filter;

	g_pEngineTrace->TraceRay(ray, 0x200400B, &filter, &tr);
}

hard to find definition of UTIL_TRACEHULL for source sdk on github so it might just do this

@ghost
Copy link

ghost commented Feb 26, 2020

mp\src\game\shared\util_shared.h
line 227:

inline void UTIL_TraceHull( const Vector &vecAbsStart, const Vector &vecAbsEnd, const Vector &hullMin, const Vector &hullMax, unsigned int mask, const IHandleEntity *ignore, int collisionGroup, trace_t *ptr )

@5f5
Copy link

5f5 commented Mar 9, 2020

or if we can cast a really big ray that would probably also work

what is this supposed to mean lol

@streamshark
Copy link

or if we can cast a really big ray that would probably also work

what is this supposed to mean lol

he was referring to trace hull, like cast a large ray that spans the width of player collision box instead of a bunch of small rays

@Vonr
Copy link

Vonr commented Mar 9, 2020 via email

@ghost
Copy link

ghost commented Mar 9, 2020

nested while statements is O(n^2)?

@Vonr
Copy link

Vonr commented Mar 9, 2020 via email

@5f5
Copy link

5f5 commented Mar 11, 2020

would engine prediction be better or would tracerays be better in thie case

@Vonr
Copy link

Vonr commented Mar 11, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants