Giter Site home page Giter Site logo

Comments (7)

Jire avatar Jire commented on August 26, 2024 1

If you only want to have it work for non-automatics, you should be returning if the weapon is an automatic, not if it's not an automatic.

But using inclusivity (whitelisting) is easier than writing all the exclusives:

if (!weapon.pistol && !weapon.shotgun && !weapon.sniper) return

from abendigo.

punkjj avatar punkjj commented on August 26, 2024

Reply ?

from abendigo.

Jire avatar Jire commented on August 26, 2024

@punkjj Post your full plugin code with the insert code feature.

from abendigo.

punkjj avatar punkjj commented on August 26, 2024

`package org.abendigo.plugin.csgo

import org.abendigo.DEBUG
import org.abendigo.csgo.*
import org.abendigo.csgo.Client.clientDLL
import org.abendigo.csgo.Client.enemies
import org.abendigo.csgo.Engine.clientState
import org.abendigo.csgo.offsets.m_dwForceAttack
import java.lang.Math.*

object BoneTriggerPlugin : InGamePlugin("Bone Trigger", duration = 1) {

val TARGET_BONE = Bones.HEAD
private const val FOV = 10

private val aim = Vector(0F, 0F, 0F)
private var hold = false

override fun cycle() {
    val myPosition = +Me().position
    val angle = clientState(1024).angle()
    try {
        val weapon = (+Me().weapon).type!!
        if (!weapon.pistol && !weapon.sniper1) return
    } catch (t: Throwable) {
        if (DEBUG) t.printStackTrace()
    }


    var closestDelta = Int.MAX_VALUE
    for ((i, e) in enemies) {
        val ePos = e.bonePosition(TARGET_BONE.id)
        val distance = distance(myPosition, ePos)

        calculateAngle(Me(), myPosition, ePos, aim.reset())
        normalizeAngle(aim)

        val pitchDiff = abs(angle.x - aim.x)
        val yawDiff = abs(angle.y - aim.y)
        val diff = sin(toRadians(pitchDiff.toDouble())) + sin(toRadians(yawDiff.toDouble()))
        val delta = abs(diff * distance)

        if (delta <= FOV && delta < closestDelta) closestDelta = delta.toInt()
    }

    if (closestDelta <= FOV && !hold) {
        clientDLL[m_dwForceAttack] = 5.toByte()
        hold = true
    } else if (hold) {
        clientDLL[m_dwForceAttack] = 4.toByte()
        hold = false
    }
}

`}``

from abendigo.

punkjj avatar punkjj commented on August 26, 2024

Here sniper1 = SSG 08 or scout

from abendigo.

punkjj avatar punkjj commented on August 26, 2024

Can you edit and put a toggle function ? and Right now I removed !weapon.automatic

from abendigo.

punkjj avatar punkjj commented on August 26, 2024

@Jire ^^

from abendigo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.