Skip to content

Commit

Permalink
1.8.4 Beta
Browse files Browse the repository at this point in the history
* Added autoaccept
* Added BlockBot
* Fixed nearest bone not working in appless
  • Loading branch information
SPRAVEDLIVO committed Feb 21, 2021
1 parent 0013461 commit 358497f
Show file tree
Hide file tree
Showing 11 changed files with 143 additions and 9 deletions.
6 changes: 5 additions & 1 deletion settings/Localizations/locale_en_US.locale
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ HITMARKER_COLOR = Color
HITMARKER_COMBO_COLOR = Combo Color


//Category: Misc tab
//Category: Others tab
DISABLE_POST_PROCESSING = Disable Post Processing
D_SPAM = Door Spam
D_SPAM_KEY = Door Spam Key
Expand All @@ -485,6 +485,8 @@ Self-Nade = Self Nade
KILL_BIND = Kill Bind
KILL_BIND_KEY = Key
Name-Change = Temporary Name Change
AUTOACCEPT = Auto Accept
AUTOACCEPT_TOGGLE_KEY = Auto Accept Toggle Key

//Category: Fonts
LOAD_FONT = Load Font
Expand Down Expand Up @@ -607,6 +609,8 @@ HEAD_WALK = Head Walk
SAME = SAME
OPPOSITE = OPPOSITE
BHOP_HITCHANCE = Hitchance
BLOCK_BOT = Block Bot
BLOCK_BOT_KEY = Block Bot Key

//Category: FOV changer tab
ENABLE_FOV_CHANGER = FOV Changer
Expand Down
5 changes: 5 additions & 0 deletions settings/MiscScripts.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ MUSIC_KIT_SPOOFER = false
MUSIC_KIT_ID = 11
KILLSOUND_VOLUME = 0.1
KILL_BIND_KEY = -1

BLOCK_BOT = false
BLOCK_BOT_KEY = -1
AUTOACCEPT = false
AUTOACCEPT_TOGGLE_KEY = -1
2 changes: 2 additions & 0 deletions src/main/kotlin/rat/poison/RatPoison.kt
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ fun main() {
if (dbg) { println("[DEBUG] Initializing Name Changer") }; nameChanger()
if (dbg) { println("[DEBUG] Initializing Kill Sound") }; killSoundEsp()
if (dbg) { println("[DEBUG] Initializing MusicKit Spoofer") }; musicKitSpoofer()
if (dbg) { println("[DEBUG] Initializing Block Bot") }; blockBot()
if (dbg) { println("[DEBUG] Initializing Auto Accept") }; autoAccept()
if (dbg) { println("[DEBUG] dwbSendPackets: $dwbSendPackets")}

//if (EXPERIMENTAL) {
Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/rat/poison/game/WorldToScreen.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package rat.poison.game

import rat.poison.appless
import rat.poison.curSettings
import rat.poison.game.CSGO.clientDLL
import rat.poison.game.CSGO.gameHeight
Expand All @@ -11,7 +12,7 @@ import rat.poison.utils.generalUtil.strToBool
val w2sViewMatrix = Array(4) { DoubleArray(4) }

fun worldToScreen(from: Vector, vOut: Vector): Boolean {
if (!curSettings["MENU"].strToBool()) {
if (!curSettings["MENU"].strToBool() || appless) {
updateViewMatrix()
}

Expand Down
7 changes: 7 additions & 0 deletions src/main/kotlin/rat/poison/overlay/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import rat.poison.scripts.aim.meDead
import rat.poison.scripts.visuals.espToggleCallback
import rat.poison.settings.DANGER_ZONE
import rat.poison.settings.MENUTOG
import rat.poison.ui.tabs.othersTab
import rat.poison.ui.tabs.updateDisableAim
import rat.poison.ui.uiPanels.*
import rat.poison.ui.uiUpdate
Expand All @@ -50,6 +51,7 @@ var opened = false
var overlayMenuKey = ObservableBoolean({ keyPressed(curSettings["MENU_KEY"].toInt()) })
var toggleAimKey = ObservableBoolean({ keyPressed(curSettings["AIM_TOGGLE_KEY"].toInt()) })
var visualsToggleKey = ObservableBoolean({ keyPressed(curSettings["VISUALS_TOGGLE_KEY"].toInt()) })
var autoacceptToggleKey = ObservableBoolean({ keyPressed(curSettings["AUTOACCEPT_TOGGLE_KEY"].toInt()) })


var syncTime = 0L
Expand Down Expand Up @@ -289,6 +291,11 @@ object App : ApplicationAdapter() {
espToggleCallback()
}

autoacceptToggleKey.update()
if (autoacceptToggleKey.justBecameTrue) {
othersTab.autoAccept.isChecked = !othersTab.autoAccept.isChecked
}


if (!appless) {
val w = overlay.width
Expand Down
15 changes: 15 additions & 0 deletions src/main/kotlin/rat/poison/scripts/AutoAccept.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package rat.poison.scripts

import rat.poison.curSettings
import rat.poison.game.CSGO.gameHeight
import rat.poison.game.CSGO.gameWidth
import rat.poison.robot
import rat.poison.utils.every
import rat.poison.utils.generalUtil.strToBool
import rat.poison.utils.inGame

fun autoAccept() = every(1000) {
if (!curSettings["AUTOACCEPT"].strToBool() || inGame) return@every
robot.mouseMove(gameWidth/2, gameHeight/2)
rightClick()
}
87 changes: 87 additions & 0 deletions src/main/kotlin/rat/poison/scripts/BlockBot.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
package rat.poison.scripts

import rat.poison.curSettings
import rat.poison.game.entity.*
import rat.poison.game.me
import rat.poison.robot
import rat.poison.scripts.aim.findTarget
import rat.poison.utils.Angle
import rat.poison.utils.every
import rat.poison.utils.generalUtil.strToBool
import rat.poison.utils.keyPressed
import java.awt.event.KeyEvent
import kotlin.math.atan2

fun yaw3(v: Angle): Double {
return atan2(v.y, v.x) * 180 / Math.PI
}

fun sub3(a: Angle, b: Angle): Angle {
return Angle(a.x - b.x, a.y - b.y, a.z - b.z)
}

private var pressingA = false
private var pressingD = false

private fun unPressA() {
if (pressingA) {
robot.keyRelease(KeyEvent.VK_A)
pressingA = false
}
}

private fun unPressD() {
if (pressingD) {
robot.keyRelease(KeyEvent.VK_D)
pressingD = false
}
}

fun unPress() {
unPressA()
unPressD()
}

fun blockBot() = every(2, inGameCheck = true) {
if (!curSettings["BLOCK_BOT"].strToBool() || !keyPressed(curSettings["BLOCK_BOT_KEY"].toInt())) {
unPress()
return@every
}

val localAngles = me.eyeAngle()
var myPosition = me.position()
val closestTarget = findTarget(myPosition, localAngles, false, 90F, 6, teamCheck = false)

if (closestTarget == -1L) return@every

val vecForward = sub3(closestTarget.position(), myPosition)
val otherYaw = yaw3(vecForward)
//val targetVelocity = closestTarget.velocity()
//val targetSpeed = sqrt(targetVelocity.x * targetVelocity.x + targetVelocity.y * targetVelocity.y)

var diffYaw = otherYaw - localAngles.y


if (diffYaw > 180) {
diffYaw -= 360
}
else if (diffYaw < -180) {
diffYaw += 360
}

when {
diffYaw > 0.25 -> {
unPressD()
robot.keyPress(KeyEvent.VK_A)
pressingA = true
}
diffYaw < -0.25 -> {
unPressA()
robot.keyPress(KeyEvent.VK_D)
pressingD = true
}
else -> {
unPress()
}
}
}
9 changes: 4 additions & 5 deletions src/main/kotlin/rat/poison/scripts/aim/General.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@ fun reset(resetTarget: Boolean = true) {
}

fun findTarget(position: Angle, angle: Angle, allowPerfect: Boolean,
lockFOV: Float = curSettings["AIM_FOV"].toFloat(), BONE: Int = curSettings["AIM_BONE"].toInt(), visCheck: Boolean = true): Player {
lockFOV: Float = curSettings["AIM_FOV"].toFloat(), BONE: Int = curSettings["AIM_BONE"].toInt(), visCheck: Boolean = true, teamCheck: Boolean = true): Player {
var closestFOV = Float.MAX_VALUE
var closestDelta = Float.MAX_VALUE
var closestPlayer = -1L

forEntities(EntityType.CCSPlayer) {
val entity = it.entity

if (entity <= 0 || entity == me || !entity.canShoot(visCheck)) {
if (entity <= 0 || entity == me || !entity.canShoot(visCheck, teamCheck)) {
return@forEntities
}

Expand Down Expand Up @@ -118,10 +117,10 @@ fun Entity.inMyTeam() =
me.survivalTeam().let { it > -1 && it == this.survivalTeam() }
} else me.team() == team()

fun Entity.canShoot(visCheck: Boolean = true) = ((if (DANGER_ZONE) { true } else if (visCheck) { spotted() || (curSettings["TEAMMATES_ARE_ENEMIES"].strToBool() && team() == me.team()) } else { true })
fun Entity.canShoot(visCheck: Boolean = true, teamCheck: Boolean = true) = ((if (DANGER_ZONE) { true } else if (visCheck) { spotted() || (curSettings["TEAMMATES_ARE_ENEMIES"].strToBool() && team() == me.team() || !teamCheck) } else { true })
&& !dormant()
&& !dead()
&& !inMyTeam()
&& (!inMyTeam() || !teamCheck)
&& !isProtected()
&& !meDead)

Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/rat/poison/ui/tabs/RanksTab.kt
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ class RanksTab : Tab(false, false) {
tmpName = tmpName.substring(0, if (tmpName.length > 23) 23 else tmpName.length)

if (player.steamID != 0) { //Bot check
namesTable.add(LinkLabel(tmpName, "https://steamcommunity.com/profiles/%5BU:1:" + player.steamID + "%5B/")).height(10f).left().row()
namesTable.add(LinkLabel(tmpName, "https://steamcommunity.com/profiles/%5BU:1:" + player.steamID + "%5B/")).height(20f).left().row()
} else {
namesTable.add(tmpName).height(21f).left().row()
namesTable.add(tmpName).height(20f).left().row()
}
ranksLabel.setText(ranksLabel.text.toString() + player.rank + " \n")
killsLabel.setText(killsLabel.text.toString() + player.kills + " \n")
Expand Down
7 changes: 7 additions & 0 deletions src/main/kotlin/rat/poison/ui/tabs/misctabs/MovementTab.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class MovementTab : Tab(false, false) {
val fastStop = VisCheckBoxCustom("Fast Stop", "FAST_STOP")
val headWalk = VisCheckBoxCustom("Head Walk", "HEAD_WALK")
val knifeBot = VisCheckBoxCustom("Knife Bot", "ENABLE_AUTO_KNIFE")
val blockBot = VisCheckBoxCustom("Block Bot", "BLOCK_BOT")
val blockBotKey = VisBindTableCustom("Block Bot Key", "BLOCK_BOT_KEY")

init {
table.padLeft(25F)
Expand All @@ -35,6 +37,9 @@ class MovementTab : Tab(false, false) {
table.add(fastStop).left().row()
table.add(headWalk).left().row()
table.add(knifeBot).left().row()
table.addSeparator().row()
table.add(blockBot).left().row()
table.add(blockBotKey).left().row()
}

override fun getTabTitle(): String {
Expand All @@ -56,5 +61,7 @@ fun movementTabUpdate() {
fastStop.update()
headWalk.update()
knifeBot.update()
blockBot.update()
blockBotKey.update()
}
}
7 changes: 7 additions & 0 deletions src/main/kotlin/rat/poison/ui/tabs/misctabs/OthersTab.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ class OthersTab: Tab(false, false) {
val postProcessingDisable = VisCheckBoxCustom("DISABLE_POST_PROCESSING".toLocale(), "DISABLE_POST_PROCESSING")
val spectatorList = VisCheckBoxCustom("Spectator List", "SPECTATOR_LIST")
val enableMusicKitSpoofer = VisCheckBoxCustom("Music Kit Spoofer", "MUSIC_KIT_SPOOFER")
val autoAccept = VisCheckBoxCustom("Auto Accept", "AUTOACCEPT")
val autoAcceptToggleKey = VisBindTableCustom("Auto Accept Toggle Key", "AUTOACCEPT_TOGGLE_KEY")
// me when the suggestions
private var musicKitsAdapter = ListAdapter(ArrayList())
private var musicKitsSelection = ListView(musicKitsAdapter)
Expand Down Expand Up @@ -111,6 +113,9 @@ class OthersTab: Tab(false, false) {
table.addSeparator().row()
table.add(spectatorList).left().row()
table.addSeparator().row()
table.add(autoAccept).left().row()
table.add(autoAcceptToggleKey).left().row()
table.addSeparator().row()
table.add(enableMusicKitSpoofer).left().row()
table.add(currentlySelected).left().row()
table.add(musicKitsSelection.mainTable).left().height(120F).row()
Expand Down Expand Up @@ -215,6 +220,8 @@ fun othersTabUpdate() {
postProcessingDisable.update()
spectatorList.update()
enableMusicKitSpoofer.update()
autoAcceptToggleKey.update()
autoAccept.update()
updateHitSoundsList()
}
}
Expand Down

0 comments on commit 358497f

Please sign in to comment.