Advertisement
Guest User

new hack funky friday

a guest
Aug 17th, 2021
5,194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.45 KB | None | 0 0
  1. -- 8/2/21
  2. -- KRNL has since been fixed, enjoy!
  3.  
  4. -- + Added 'Manual' mode which allows you to force the notes to hit a specific type by holding down a keybind.
  5. -- * Switched fastWait and fastSpawn to Roblox's task libraries
  6. -- * Attempted to fix 'invalid key to next' errors
  7.  
  8. -- 5/12/21
  9. -- Attempted to fix the autoplayer missing as much.
  10.  
  11. -- 5/16/21
  12. -- Attempt to fix invisible notes.
  13. -- Added hit chances & an autoplayer toggle
  14. -- ! Hit chances are a bit rough but should work.
  15.  
  16. -- I have only tested on Synapse X
  17. -- Script-Ware v2 should work fine
  18. -- KRNL should work fine
  19.  
  20. -- Needed functions: setthreadcontext, getconnections, getgc, getloaodedmodules
  21. -- That should be it!
  22.  
  23. -- You may find some contact information on the GitHub repo.
  24.  
  25. local library = loadstring(game:HttpGet("https://raw.githubusercontent.com/wally-rblx/uwuware-ui/main/main.lua"))()
  26.  
  27. local framework, scrollHandler
  28. while true do
  29. for _, obj in next, getgc(true) do
  30. if type(obj) == 'table' and rawget(obj, 'GameUI') then
  31. framework = obj;
  32. break
  33. end
  34. end
  35.  
  36. for _, module in next, getloadedmodules() do
  37. if module.Name == 'ScrollHandler' then
  38. scrollHandler = module;
  39. break;
  40. end
  41. end
  42.  
  43. if (type(framework) == 'table') and (typeof(scrollHandler) == 'Instance') then
  44. break
  45. end
  46.  
  47. wait(1)
  48. end
  49.  
  50. local runService = game:GetService('RunService')
  51. local userInputService = game:GetService('UserInputService')
  52. local client = game:GetService('Players').LocalPlayer;
  53. local random = Random.new()
  54.  
  55. local task = task or getrenv().task;
  56. local fastWait, fastSpawn = task.wait, task.spawn;
  57.  
  58. local fireSignal, rollChance do
  59. -- updated for script-ware or whatever
  60. -- attempted to update for krnl
  61. local set_identity = (type(syn) == 'table' and syn.set_thread_identity) or setidentity or setthreadcontext
  62. function fireSignal(target, signal, ...)
  63. -- getconnections with InputBegan / InputEnded does not work without setting Synapse to the game's context level
  64. set_identity(2)
  65. for _, signal in next, getconnections(signal) do
  66. if type(signal.Function) == 'function' and islclosure(signal.Function) then
  67. local scr = rawget(getfenv(signal.Function), 'script')
  68. if scr == target then
  69. pcall(signal.Function, ...)
  70. end
  71. end
  72. end
  73. set_identity(7)
  74. end
  75.  
  76. -- uses a weighted random system
  77. -- its a bit scuffed rn but it works good enough
  78.  
  79. function rollChance()
  80. if (library.flags.autoPlayerMode == 'Manual') then
  81. if (library.flags.sickHeld) then return 'Sick' end
  82. if (library.flags.goodHeld) then return 'Good' end
  83. if (library.flags.okayHeld) then return 'Ok' end
  84. if (library.flags.missHeld) then return 'Bad' end
  85.  
  86. return 'Bad' -- incase if it cant find one
  87. end
  88.  
  89. local chances = {
  90. { type = 'Sick', value = library.flags.sickChance },
  91. { type = 'Good', value = library.flags.goodChance },
  92. { type = 'Ok', value = library.flags.okChance },
  93. { type = 'Bad', value = library.flags.badChance },
  94. }
  95.  
  96. table.sort(chances, function(a, b)
  97. return a.value > b.value
  98. end)
  99.  
  100. local sum = 0;
  101. for i = 1, #chances do
  102. sum += chances[i].value
  103. end
  104.  
  105. if sum == 0 then
  106. -- forgot to change this before?
  107. -- fixed 6/5/21
  108. return chances[random:NextInteger(1, 4)].type
  109. end
  110.  
  111. local initialWeight = random:NextInteger(0, sum)
  112. local weight = 0;
  113.  
  114. for i = 1, #chances do
  115. weight = weight + chances[i].value
  116.  
  117. if weight > initialWeight then
  118. return chances[i].type
  119. end
  120. end
  121.  
  122. return 'Sick' -- just incase it fails?
  123. end
  124. end
  125.  
  126. local map = { [0] = 'Left', [1] = 'Down', [2] = 'Up', [3] = 'Right', }
  127. local keys = { Up = Enum.KeyCode.Up; Down = Enum.KeyCode.Down; Left = Enum.KeyCode.Left; Right = Enum.KeyCode.Right; }
  128.  
  129. -- they are "weird" because they are in the middle of their Upper & Lower ranges
  130. -- should hopefully make them more precise!
  131. local chanceValues = {
  132. Sick = 96,
  133. Good = 92,
  134. Ok = 87,
  135. Bad = 75
  136. }
  137.  
  138. local hitChances = {}
  139.  
  140. if shared._id then
  141. pcall(runService.UnbindFromRenderStep, runService, shared._id)
  142. end
  143.  
  144. shared._id = game:GetService('HttpService'):GenerateGUID(false)
  145. runService:BindToRenderStep(shared._id, 1, function()
  146. if (not library.flags.autoPlayer) then return end
  147.  
  148. local arrows = {}
  149. for _, obj in next, framework.UI.ActiveSections do
  150. arrows[#arrows + 1] = obj;
  151. end
  152.  
  153. for idx = 1, #arrows do
  154. local arrow = arrows[idx]
  155. if type(arrow) ~= 'table' then
  156. continue
  157. end
  158.  
  159. if (arrow.Side == framework.UI.CurrentSide) and (not arrow.Marked) then
  160. local indice = (arrow.Data.Position % 4)
  161. local position = map[indice]
  162.  
  163. if (position) then
  164. local currentTime = framework.SongPlayer.CurrentlyPlaying.TimePosition
  165. local distance = (1 - math.abs(arrow.Data.Time - currentTime)) * 100
  166.  
  167. if (arrow.Data.Time == 0) then
  168. continue
  169. end
  170.  
  171. local result = rollChance()
  172. arrow._hitChance = arrow._hitChance or result;
  173.  
  174. local hitChance = (library.flags.autoPlayerMode == 'Manual' and result or arrow._hitChance)
  175. if distance >= chanceValues[hitChance] then
  176. fastSpawn(function()
  177. arrow.Marked = true;
  178. fireSignal(scrollHandler, userInputService.InputBegan, { KeyCode = keys[position], UserInputType = Enum.UserInputType.Keyboard }, false)
  179.  
  180. if arrow.Data.Length > 0 then
  181. -- wait depending on the arrows length so the animation can play
  182. fastWait(arrow.Data.Length)
  183. else
  184. -- 0.1 seems to make it miss more, this should be fine enough?
  185. fastWait(0.05)
  186. end
  187.  
  188. fireSignal(scrollHandler, userInputService.InputEnded, { KeyCode = keys[position], UserInputType = Enum.UserInputType.Keyboard }, false)
  189. arrow.Marked = nil;
  190. end)
  191. end
  192. end
  193. end
  194. end
  195. end)
  196.  
  197. local window = library:CreateWindow('Funky Friday') do
  198. local folder = window:AddFolder('Main') do
  199. folder:AddToggle({ text = 'Autoplayer', flag = 'autoPlayer' })
  200. folder:AddList({ text = 'Autoplayer mode', flag = 'autoPlayerMode', values = { 'Chances', 'Manual' } })
  201.  
  202. folder:AddSlider({ text = 'Sick %', flag = 'sickChance', min = 0, max = 100, value = 100 })
  203. folder:AddSlider({ text = 'Good %', flag = 'goodChance', min = 0, max = 100, value = 0 })
  204. folder:AddSlider({ text = 'Ok %', flag = 'okChance', min = 0, max = 100, value = 0 })
  205. folder:AddSlider({ text = 'Bad %', flag = 'badChance', min = 0, max = 100, value = 0 })
  206. end
  207.  
  208. local folder = window:AddFolder('Keybinds') do
  209. folder:AddBind({ text = 'Sick', flag = 'sickBind', key = Enum.KeyCode.One, hold = true, callback = function(val) library.flags.sickHeld = (not val) end, })
  210. folder:AddBind({ text = 'Good', flag = 'goodBind', key = Enum.KeyCode.Two, hold = true, callback = function(val) library.flags.goodHeld = (not val) end, })
  211. folder:AddBind({ text = 'Ok', flag = 'okBind', key = Enum.KeyCode.Three, hold = true, callback = function(val) library.flags.okayHeld = (not val) end, })
  212. folder:AddBind({ text = 'Bad', flag = 'badBind', key = Enum.KeyCode.Four, hold = true, callback = function(val) library.flags.missHeld = (not val) end, })
  213. end
  214.  
  215. local folder = window:AddFolder('Credits') do
  216. folder:AddLabel({ text = 'Credits' })
  217. folder:AddLabel({ text = 'Jan - UI library' })
  218. folder:AddLabel({ text = 'wally - Script' })
  219. end
  220.  
  221. window:AddLabel({ text = 'Version 1.3' })
  222. window:AddLabel({ text = 'Updated 8/2/21' })
  223. window:AddBind({ text = 'Menu toggle', key = Enum.KeyCode.Delete, callback = function() library:Close() end })
  224. end
  225.  
  226. library:Init()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement