Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Rex. E#0001
- -- Removed Linoria Lib because it's tweeking bro fr!
- -- This support is so annoyi
- local start = tick()
- local client = game:GetService('Players').LocalPlayer;
- local set_identity = (type(syn) == 'table' and syn.set_thread_identity) or setidentity or setthreadcontext
- local executor = identifyexecutor and identifyexecutor() or 'Unknown'
- local Autoplayer = true
- local AutoClaimRings = true
- local AutoPlayerMode = true
- local Options = {
- SickChance = {Value = 98},
- GoodChance = {Value = 2},
- OkChance = {Value = 0},
- BadChance = {Value = 0},
- MissChance = {Value = 0},
- PressMode = {Value = "firesignal"},
- DelayMode = {Value = "Random"},
- ScoreModifier = {Value = "Increase score on miss"},
- HeldDelayMin = {Value = 0},
- HeldDelayMax = {Value = 20},
- NoteDelayMin = {Value = 0},
- NoteDelayMax = {Value = 20},
- HeldDelay = {Value = 0},
- ReleaseDelay = {Value = 20},
- }
- local function fail(r) return client:Kick(r) end
- -- gracefully handle errors when loading external scripts
- -- added a cache to make hot reloading a bit faster
- local usedCache = shared.__urlcache and next(shared.__urlcache) ~= nil
- shared.__urlcache = shared.__urlcache or {}
- local function urlLoad(url)
- local success, result
- if shared.__urlcache[url] then
- success, result = true, shared.__urlcache[url]
- else
- success, result = pcall(game.HttpGet, game, url)
- end
- if (not success) then
- return fail(string.format('Failed to GET url %q for reason: %q', url, tostring(result)))
- end
- local fn, err = loadstring(result)
- if (type(fn) ~= 'function') then
- return fail(string.format('Failed to loadstring url %q for reason: %q', url, tostring(err)))
- end
- local results = { pcall(fn) }
- if (not results[1]) then
- return fail(string.format('Failed to initialize url %q for reason: %q', url, tostring(results[2])))
- end
- shared.__urlcache[url] = result
- return unpack(results, 2)
- end
- -- attempt to block imcompatible exploits
- -- rewrote because old checks literally did not work
- if type(set_identity) ~= 'function' then return fail('Unsupported exploit (missing "set_thread_identity")') end
- if type(getconnections) ~= 'function' then return fail('Unsupported exploit (missing "getconnections")') end
- if type(getloadedmodules) ~= 'function' then return fail('Unsupported exploit (misssing "getloadedmodules")') end
- if type(getgc) ~= 'function' then return fail('Unsupported exploit (misssing "getgc")') end
- local getinfo = debug.getinfo or getinfo;
- local getupvalue = debug.getupvalue or getupvalue;
- local getupvalues = debug.getupvalues or getupvalues;
- local setupvalue = debug.setupvalue or setupvalue;
- if type(setupvalue) ~= 'function' then return fail('Unsupported exploit (misssing "debug.setupvalue")') end
- if type(getupvalue) ~= 'function' then return fail('Unsupported exploit (misssing "debug.getupvalue")') end
- if type(getupvalues) ~= 'function' then return fail('Unsupported exploit (missing "debug.getupvalues")') end
- -- free exploit bandaid fix
- if type(getinfo) ~= 'function' then
- local debug_info = debug.info;
- if type(debug_info) ~= 'function' then
- -- if your exploit doesnt have getrenv you have no hope
- if type(getrenv) ~= 'function' then return fail('Unsupported exploit (missing "getrenv")') end
- debug_info = getrenv().debug.info
- end
- getinfo = function(f)
- assert(type(f) == 'function', string.format('Invalid argument #1 to debug.getinfo (expected %s got %s', 'function', type(f)))
- local results = { debug.info(f, 'slnfa') }
- local _, upvalues = pcall(getupvalues, f)
- if type(upvalues) ~= 'table' then
- upvalues = {}
- end
- local nups = 0
- for k in next, upvalues do
- nups = nups + 1
- end
- -- winning code
- return {
- source = '@' .. results[1],
- short_src = results[1],
- what = results[1] == '[C]' and 'C' or 'Lua',
- currentline = results[2],
- name = results[3],
- func = results[4],
- numparams = results[5],
- is_vararg = results[6], -- 'a' argument returns 2 values :)
- nups = nups,
- }
- end
- end
- local httpService = game:GetService('HttpService')
- local framework, scrollHandler, network
- local counter = 0
- while true do
- for _, obj in next, getgc(true) do
- if type(obj) == 'table' then
- if rawget(obj, 'GameUI') then
- framework = obj;
- elseif type(rawget(obj, 'Server')) == 'table' then
- network = obj;
- end
- end
- if network and framework then break end
- end
- for _, module in next, getloadedmodules() do
- if module.Name == 'ScrollHandler' then
- scrollHandler = module;
- break;
- end
- end
- if (type(framework) == 'table' and typeof(scrollHandler) == 'Instance' and type(network) == 'table') then
- break
- end
- counter = counter + 1
- if counter > 6 then
- fail(string.format('Failed to load game dependencies. Details: %s, %s, %s', type(framework), typeof(scrollHandler), type(network)))
- end
- wait(1)
- end
- local runService = game:GetService('RunService')
- local userInputService = game:GetService('UserInputService')
- local virtualInputManager = game:GetService('VirtualInputManager')
- local random = Random.new()
- local task = task or getrenv().task;
- local fastWait, fastSpawn = task.wait, task.spawn;
- -- firesignal implementation
- -- hitchance rolling
- local fireSignal, rollChance do
- -- updated for script-ware or whatever
- -- attempted to update for krnl
- function fireSignal(target, signal, ...)
- -- getconnections with InputBegan / InputEnded does not work without setting Synapse to the game's context level
- set_identity(2)
- local didFire = false
- for _, signal in next, getconnections(signal) do
- if type(signal.Function) == 'function' and islclosure(signal.Function) then
- local scr = rawget(getfenv(signal.Function), 'script')
- if scr == target then
- didFire = true
- pcall(signal.Function, ...)
- end
- end
- end
- -- if not didFire then fail"couldnt fire input signal" end
- set_identity(7)
- end
- -- uses a weighted random system
- -- its a bit scuffed rn but it works good enough
- function rollChance()
- local chances = {
- { 'Sick', Options.SickChance.Value },
- { 'Good', Options.GoodChance.Value },
- { 'Ok', Options.OkChance.Value },
- { 'Bad', Options.BadChance.Value },
- { 'Miss' , Options.MissChance.Value },
- }
- table.sort(chances, function(a, b)
- return a[2] > b[2]
- end)
- local sum = 0;
- for i = 1, #chances do
- sum += chances[i][2]
- end
- if sum == 0 then
- return chances[random:NextInteger(1, #chances)][1]
- end
- local initialWeight = random:NextInteger(0, sum)
- local weight = 0;
- for i = 1, #chances do
- weight = weight + chances[i][2]
- if weight > initialWeight then
- return chances[i][1]
- end
- end
- return 'Sick'
- end
- end
- -- autoplayer
- local chanceValues do
- chanceValues = {
- Sick = 98,
- Good = 2,
- Ok = 0,
- Bad = 0,
- }
- local keyCodeMap = {}
- for _, enum in next, Enum.KeyCode:GetEnumItems() do
- keyCodeMap[enum.Value] = enum
- end
- if shared._unload then
- pcall(shared._unload)
- end
- function shared._unload()
- if shared._id then
- pcall(runService.UnbindFromRenderStep, runService, shared._id)
- end
- for i = 1, #shared.threads do
- coroutine.close(shared.threads[i])
- end
- for i = 1, #shared.callbacks do
- task.spawn(shared.callbacks[i])
- end
- end
- shared.threads = {}
- shared.callbacks = {}
- shared._id = httpService:GenerateGUID(false)
- local function pressKey(keyCode, state)
- if Options.PressMode.Value == 'virtual input' then
- virtualInputManager:SendKeyEvent(state, keyCode, false, nil)
- else
- fireSignal(scrollHandler, userInputService[state and 'InputBegan' or 'InputEnded'], { KeyCode = keyCode, UserInputType = Enum.UserInputType.Keyboard }, false)
- end
- end
- local rng = Random.new()
- runService:BindToRenderStep(shared._id, 1, function()
- --if (not library.flags.autoPlayer) then return end
- if (not Autoplayer) then
- return
- end
- local currentlyPlaying = framework.SongPlayer.CurrentlyPlaying
- if typeof(currentlyPlaying) ~= 'Instance' or not currentlyPlaying:IsA('Sound') then
- return
- end
- local arrows = framework.UI:GetNotes()
- local count = framework.SongPlayer:GetKeyCount()
- local mode = count .. 'Key'
- local arrowData = framework.ArrowData[mode].Arrows
- for i, arrow in next, arrows do
- -- todo: switch to this (https://i.imgur.com/pEVe6Tx.png)
- local ignoredNoteTypes = { Death = true, Mechanic = true, Poison = true }
- if type(arrow.NoteDataConfigs) == 'table' then
- if ignoredNoteTypes[arrow.NoteDataConfigs.Type] then
- continue
- end
- end
- if (arrow.Side == framework.UI.CurrentSide) and (not arrow.Marked) and currentlyPlaying.TimePosition > 0 then
- local position = (arrow.Data.Position % count) .. ''
- local hitboxOffset = 0
- do
- local settings = framework.Settings;
- local offset = type(settings) == 'table' and settings.HitboxOffset;
- local value = type(offset) == 'table' and offset.Value;
- if type(value) == 'number' then
- hitboxOffset = value;
- end
- hitboxOffset = hitboxOffset / 1000
- end
- local songTime = framework.SongPlayer.CurrentTime
- do
- local configs = framework.SongPlayer.CurrentSongConfigs
- local playbackSpeed = type(configs) == 'table' and configs.PlaybackSpeed
- if type(playbackSpeed) ~= 'number' then
- playbackSpeed = 1
- end
- songTime = songTime / playbackSpeed
- end
- local noteTime = math.clamp((1 - math.abs(arrow.Data.Time - (songTime + hitboxOffset))) * 100, 0, 100)
- local result = rollChance()
- arrow._hitChance = arrow._hitChance or result;
- local hitChance = (AutoplayerMode == 'Manual' and result or arrow._hitChance)
- if hitChance ~= "Miss" and noteTime >= chanceValues[arrow._hitChance] then
- fastSpawn(function()
- arrow.Marked = true;
- local keyCode = keyCodeMap[arrowData[position].Keybinds.Keyboard[1]]
- pressKey(keyCode, true)
- local arrowLength = arrow.Data.Length or 0
- local isHeld = arrowLength > 0
- local delayMode = Options.DelayMode.Value
- local minDelay = isHeld and Options.HeldDelayMin or Options.NoteDelayMin;
- local maxDelay = isHeld and Options.HeldDelayMax or Options.NoteDelayMax;
- local noteDelay = isHeld and Options.HeldDelay or Options.ReleaseDelay
- local delay = delayMode == 'Random' and rng:NextNumber(minDelay.Value, maxDelay.Value) or noteDelay.Value
- task.wait(arrowLength + (delay / 1000))
- pressKey(keyCode, false)
- arrow.Marked = nil;
- end)
- end
- end
- end
- end)
- end
- local ActivateUnlockables do
- -- Note: I know you can do this with UserId but it only works if you run it before opening the notes menu
- -- My script should work no matter the order of which you run things :)
- local loadStyle = nil
- local function loadStyleProxy(...)
- -- This forces the styles to reload every time
- local upvalues = getupvalues(loadStyle)
- for i, upvalue in next, upvalues do
- if type(upvalue) == 'table' and rawget(upvalue, 'Style') then
- rawset(upvalue, 'Style', nil);
- setupvalue(loadStyle, i, upvalue)
- end
- end
- return loadStyle(...)
- end
- local function applyLoadStyleProxy(...)
- local gc = getgc()
- for i = 1, #gc do
- local obj = gc[i]
- if type(obj) == 'function' then
- -- goodbye nups numeric loop because script-ware is weird
- local upvalues = getupvalues(obj)
- for i, upv in next, upvalues do
- if type(upv) == 'function' and getinfo(upv).name == 'LoadStyle' then
- -- ugly but it works, we don't know every name for is_synapse_function and similar
- local function isGameFunction(fn)
- return getinfo(fn).source:match('%.ArrowSelector%.Customize$')
- end
- if isGameFunction(obj) and isGameFunction(upv) then
- -- avoid non-game functions :)
- loadStyle = loadStyle or upv
- setupvalue(obj, i, loadStyleProxy)
- table.insert(shared.callbacks, function()
- assert(pcall(setupvalue, obj, i, loadStyle))
- end)
- end
- end
- end
- end
- end
- end
- local success, error = pcall(applyLoadStyleProxy)
- if not success then
- return fail(string.format('Failed to hook LoadStyle function. Error(%q)\nExecutor(%q)\n', error, executor))
- end
- function ActivateUnlockables()
- local idx = table.find(framework.SongsWhitelist, client.UserId)
- if idx then return end
- table.insert(framework.SongsWhitelist, client.UserId)
- end
- end
- ActivateUnlockables()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement