|
| 1 | +name = "SlashKill Aura" |
| 2 | +description = "Automatically kills mobs around you." |
| 3 | + |
| 4 | +mainSettings = client.settings.addCategory("Main Settings") |
| 5 | +mob = client.settings.addNamelessTextbox("Mob", "") |
| 6 | +clearItems = client.settings.addNamelessBool("Clear Items", false) |
| 7 | + |
| 8 | +client.settings.addAir(5) |
| 9 | +chatSettings = client.settings.addCategory("Chat Settings") |
| 10 | +hideNoTargetsMatchedSelector = client.settings.addNamelessBool("Hide \"No targets matched selector\" message", true) |
| 11 | +hideSyntaxErrorUnexpected = client.settings.addNamelessBool("Hide \"Syntax error, unexpected\" message", true) |
| 12 | + |
| 13 | +client.settings.addAir(5) |
| 14 | +viewSettings = client.settings.addCategory("View Settings") |
| 15 | +showThroughWalls = client.settings.addNamelessBool("Show Through Walls", false) |
| 16 | +client.settings.addAir(2) |
| 17 | +circleQuality = client.settings.addNamelessFloat("Circle Quality (1 is highest quality, do NOT slide the slider, either set an exact value or click once!)", 1, 20, 1) |
| 18 | +showMovingCircle = client.settings.addNamelessBool("Show Moving Circle", true) |
| 19 | +showStaticCircle = client.settings.addNamelessBool("Show Static Circle", true) |
| 20 | + |
| 21 | +client.settings.addAir(2) |
| 22 | +showMovingCross = client.settings.addNamelessBool("Show Moving Cross", true) |
| 23 | +showStaticCross = client.settings.addNamelessBool("Show Static Cross", true) |
| 24 | + |
| 25 | +client.settings.addAir(5) |
| 26 | +miscSettings = client.settings.addCategory("Misc Settings") |
| 27 | +range = client.settings.addNamelessFloat("Range (Please disable mod before making any changes!)", 0.1, 15, 3) |
| 28 | +yOffsetSetting = client.settings.addNamelessFloat("Y Offset", -1, 5, 1) |
| 29 | +fastMode = client.settings.addNamelessBool("Fast Mode (Not Recommended)", false) |
| 30 | + |
| 31 | +function killThem(mob, range) |
| 32 | + if mob == "all" then |
| 33 | + client.execute("execute kill @e[type=!player,r=" .. range .. "]") |
| 34 | + elseif mob ~= "" then |
| 35 | + client.execute("execute kill @e[type=" .. mob .. ",r=" .. range .. "]") |
| 36 | + end |
| 37 | + if clearItems.value then |
| 38 | + client.execute("execute kill @e[type=item,r=" .. range .. "]") |
| 39 | + end |
| 40 | +end |
| 41 | + |
| 42 | +function update() |
| 43 | + if fastMode.value == false then |
| 44 | + killThem(mob.value, range.value) |
| 45 | + end |
| 46 | +end |
| 47 | + |
| 48 | +function render() |
| 49 | + if fastMode.value then |
| 50 | + killThem(mob.value, range.value) |
| 51 | + end |
| 52 | +end |
| 53 | + |
| 54 | +function threeDCircle(radius, yOffset) |
| 55 | + local circle = {} |
| 56 | + if circleQuality.value ~= nil then |
| 57 | + for i = 0, 360, circleQuality.value do |
| 58 | + local x = math.cos(math.rad(i)) * radius |
| 59 | + local y = yOffset + math.sin(math.rad(i)) * radius |
| 60 | + local z = math.sin(math.rad(i)) * radius |
| 61 | + table.insert(circle, {x, y, z}) |
| 62 | + end |
| 63 | + end |
| 64 | + return circle |
| 65 | +end |
| 66 | + |
| 67 | +function render3d(deltaTime) |
| 68 | + if showThroughWalls.value then |
| 69 | + gfx.renderBehind(true) |
| 70 | + end |
| 71 | + |
| 72 | + local x, y, z = player.pposition() |
| 73 | + |
| 74 | + -- Create the dynamic circle |
| 75 | + local yOffset = math.sin(os.clock()) * range.value |
| 76 | + local dynamicCircle = threeDCircle(range.value, yOffset) |
| 77 | + |
| 78 | + -- Draw the dynamic circle |
| 79 | + for i, v in pairs(dynamicCircle) do |
| 80 | + local x1, y1, z1 = v[1], v[2], v[3] |
| 81 | + local x2, y2, z2 |
| 82 | + if i ~= nil then |
| 83 | + if dynamicCircle[i + 1] then |
| 84 | + x2, y2, z2 = dynamicCircle[i + 1][1], dynamicCircle[i + 1][2], dynamicCircle[i + 1][3] |
| 85 | + else |
| 86 | + x2, y2, z2 = dynamicCircle[1][1], dynamicCircle[1][2], dynamicCircle[1][3] |
| 87 | + end |
| 88 | + if showMovingCircle.value then |
| 89 | + gfx.line(x + x1, y - yOffset, z + z1, x + x2, y - yOffset, z + z2) |
| 90 | + end |
| 91 | + end |
| 92 | + end |
| 93 | + |
| 94 | + -- Create the static circle |
| 95 | + local staticCircleY = 0 |
| 96 | + local staticCircle = threeDCircle(range.value, staticCircleY) |
| 97 | + |
| 98 | + -- Draw the static circle |
| 99 | + for i, v in pairs(staticCircle) do |
| 100 | + local x1, y1, z1 = v[1], v[2], v[3] |
| 101 | + local x2, y2, z2 |
| 102 | + if i ~= nil then |
| 103 | + if staticCircle[i + 1] then |
| 104 | + x2, y2, z2 = staticCircle[i + 1][1], staticCircle[i + 1][2], staticCircle[i + 1][3] |
| 105 | + else |
| 106 | + x2, y2, z2 = staticCircle[1][1], staticCircle[1][2], staticCircle[1][3] |
| 107 | + end |
| 108 | + if showStaticCircle.value then |
| 109 | + gfx.line(x + x1, y - yOffsetSetting.value, z + z1, x + x2, y - yOffsetSetting.value, z + z2) |
| 110 | + end |
| 111 | + end |
| 112 | + end |
| 113 | + |
| 114 | + -- Draw the moving cross |
| 115 | + local crossSize = range.value |
| 116 | + local crossAngle = os.clock() * 20 |
| 117 | + local crossX1 = math.cos(math.rad(crossAngle)) * crossSize |
| 118 | + local crossY1 = 0 |
| 119 | + local crossZ1 = math.sin(math.rad(crossAngle)) * crossSize |
| 120 | + |
| 121 | + local crossX2 = math.sin(-math.rad(crossAngle)) * crossSize |
| 122 | + local crossY2 = 0 |
| 123 | + local crossZ2 = math.cos(math.rad(crossAngle)) * crossSize |
| 124 | + if showMovingCross.value then |
| 125 | + gfx.line(x + crossX1, y - yOffset, z + crossZ1, x - crossX1, y - yOffset, z - crossZ1) |
| 126 | + gfx.line(x + crossX2, y - yOffset, z + crossZ2, x - crossX2, y - yOffset, z - crossZ2) |
| 127 | + end |
| 128 | + |
| 129 | + -- Draw the static cross |
| 130 | + local crossX3 = math.cos(math.rad(crossAngle)) * crossSize |
| 131 | + local crossY3 = 0 |
| 132 | + local crossZ3 = math.sin(math.rad(crossAngle)) * crossSize |
| 133 | + |
| 134 | + local crossX4 = math.sin(-math.rad(crossAngle)) * crossSize |
| 135 | + local crossY4 = 0 |
| 136 | + local crossZ4 = math.cos(math.rad(crossAngle)) * crossSize |
| 137 | + if showStaticCross.value then |
| 138 | + gfx.line(x + crossX3, y - yOffsetSetting.value, z + crossZ3, x - crossX3, y - yOffsetSetting.value, z - crossZ3) |
| 139 | + gfx.line(x + crossX4, y - yOffsetSetting.value, z + crossZ4, x - crossX4, y - yOffsetSetting.value, z - crossZ4) |
| 140 | + end |
| 141 | +end |
| 142 | + |
| 143 | +event.listen("ChatMessageAdded", function(message, username, type, xuid) |
| 144 | + if hideNoTargetsMatchedSelector.value then |
| 145 | + if message:find("§cNo targets matched selector") then |
| 146 | + return true |
| 147 | + end |
| 148 | + end |
| 149 | + if hideSyntaxErrorUnexpected.value then |
| 150 | + if message:find("§cSyntax error: Unexpected") then |
| 151 | + return true |
| 152 | + end |
| 153 | + end |
| 154 | +end) |
0 commit comments