Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

BoneTriggerBot Problem , Can't Spray with Automatic Weapons #16

Closed
punkjj opened this issue Jul 19, 2016 · 7 comments
Closed

BoneTriggerBot Problem , Can't Spray with Automatic Weapons #16

punkjj opened this issue Jul 19, 2016 · 7 comments

Comments

@punkjj
Copy link

punkjj commented Jul 19, 2016

I cant Spray while using Automatic weapons 😢 Im using it for !weapon.pistol and !weapon.automatic

@punkjj
Copy link
Author

punkjj commented Jul 20, 2016

Reply ?

@Jire
Copy link
Owner

Jire commented Jul 20, 2016

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

@punkjj
Copy link
Author

punkjj commented Jul 20, 2016

`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
    }
}

`}``

@punkjj
Copy link
Author

punkjj commented Jul 20, 2016

Here sniper1 = SSG 08 or scout

@punkjj
Copy link
Author

punkjj commented Jul 20, 2016

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

@punkjj
Copy link
Author

punkjj commented Jul 21, 2016

@Jire ^^

@Jire
Copy link
Owner

Jire commented Jul 21, 2016

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

@Jire Jire closed this as completed Jul 24, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants