-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgui.lua
More file actions
239 lines (207 loc) · 6.83 KB
/
gui.lua
File metadata and controls
239 lines (207 loc) · 6.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
warn("DO NOT USE")
--[[
DO NOT USE
]]
--[[
--// Modules
local InfoModule = require(game.ReplicatedStorage.Modules.Info)
local MainFunctions = require(game:GetService("Players").LocalPlayer.PlayerGui.Gui.GuiModules.MainFunctions)
--// Variables
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local List = LocalPlayer.PlayerGui.Gui.Frames.Inventory.SubInventory.Holder.List
--// Get case prices caseInfo = {
-- ["properties"] = {
-- ["Price"]
-- }
-- }
local caseTypes = {}
for caseName, caseInfo in pairs(InfoModule.Cases) do
-- InfoModule:returnCaseBounds("name") to get bounds
if caseInfo["Currency"] == "Robux" then
caseTypes[caseName] = caseInfo
end
end
--// Sorted cases prices
local caseNames = {}
for _, caseInfo in ipairs(MainFunctions:ReturnSortedDictionary(caseTypes, "Price", true)) do
caseTypes[caseInfo.name] = caseInfo
local price = caseInfo.properties.Price
local name = caseInfo.name
table.insert(caseNames, string.format("%s ($%d)", name, price))
end
local lowestCaseToAutoBuy = caseNames[1]
local highestCaseToAutoBuy = caseNames[#caseNames]
local maxPrice = 50000
--// Quick sell
local function sellItem(itemName, amount)
spawn(function()
local args = {
[1] = "QuickSell",
[2] = itemName,
[3] = amount
}
game:GetService("ReplicatedStorage").Events.InventoryActions:InvokeServer(unpack(args))
end)
end
local function getItemPrice(name)
return InfoModule:ReturnItemFromModule(name).recentAveragePrice
end
--// Checks if item is under max price
local function isValidItem(name, maxprice)
if autosell then
local RAP = getItemPrice(name)
return RAP <= maxPrice
end
return false
end
--// Gets all items into a table
local items = {}
local function updateCurrentItems()
items = {}
for i,v in pairs(List:GetChildren()) do
if v:IsA("Frame") then
if not items[v.Name] then
items[v.Name] = 1
else
items[v.Name] = items[v.Name] + 1
end
end
end
end
updateCurrentItems()
--// Sell current items
local function sellCurrentItems()
for itemName, amount in pairs(items) do
if isValidItem(itemName, maxPrice) then
sellItem(itemName)
end
end
end
--// Sell items being added
List.ChildAdded:Connect(function(item)
if item:IsA("Frame") then
if isValidItem(item.Name, maxPrice) then
sellItem(item.Name)
end
end
end)
--// CREDITS TO BEREZAA FOR MONEY LIB !
local MoneyLib = loadstring(game:HttpGet('https://raw.githubusercontent.com/fireztron/Money-lib/main/trade%20tower%20abbv.lua'))()
--// Get amount of robux
local function getRobux()
local shortValue = game:GetService("Players").LocalPlayer.PlayerGui.Gui.Hotbar.Stats.Robux.Amount.Text
local longValue = MoneyLib.ShortToLong(shortValue)
return tonumber(longValue) or tonumber(shortValue)
end
--// Get highest value buyable case (under 20k robux)
local function getHighestValueBuyableCase()
local currentRobux = getRobux()
local buyableCases = {}
for caseName, caseInfo in pairs(caseTypes) do
local price = caseInfo.properties.Price
local minPriceOfCaseToBuy = tonumber(string.match(lowestCaseToAutoBuy, "$(%d*)"))
local maxPriceOfCaseToBuy = tonumber(string.match(highestCaseToAutoBuy, "$(%d*)"))
if currentRobux >= price and price <= maxPriceOfCaseToBuy and price >= minPriceOfCaseToBuy then
buyableCases[caseName] = price
end
end
local highestnumber = 0
local targetCaseName
for caseName, price in pairs(buyableCases) do
if price > highestnumber then
targetCaseName = caseName
highestnumber = price
end
end
return targetCaseName
end
--// Auto click
spawn(function()
while true do
if autoclick then
game:GetService("ReplicatedStorage").Events.Click:FireServer()
end
wait()
end
end)
--// Auto upgrade
spawn(function()
while true do
if autoupgrade then
spawn(function()
game:GetService("ReplicatedStorage").Events.StoreActions:InvokeServer("Upgrade")
end)
end
wait()
end
end)
--// Buy loop
spawn(function()
while true do
spawn(function()
local caseName = getHighestValueBuyableCase()
if autobuy and caseName then
--print(caseName)
game:GetService("ReplicatedStorage").Events.OpenCase:InvokeServer(caseName)
end
end)
wait()
end
end)
--// Anti afk
local VirtualUser=game:GetService('VirtualUser')
game:GetService('Players').LocalPlayer.Idled:connect(function()
if antiafk then
VirtualUser:CaptureController()
VirtualUser:ClickButton2(Vector2.new())
end
end)
--// For Non-Synapse Users (credits to egg salad)
if not pcall(function() return syn.protect_gui end) then
syn = {}
syn.protect_gui = function(egg)
egg.Parent = game.CoreGui
end
end
--// lib stuff uwuware i think
local lib = loadstring(game:HttpGet('https://raw.githubusercontent.com/fireztron/uwuware-ui-library/main/ui.lua', true))()
local window = lib:CreateWindow('Trade Tower GUI')
window:AddLabel({text = "fireztron @ v3rmillion"})
--// auto buy UI
window:AddToggle({text = 'Auto buy', state = autobuy, callback = function(v)
autobuy = v;
end})
--// auto buy options ui
local autobuyoptions = window:AddFolder("auto buy options")
autobuyoptions:AddList({text = 'lowest cost case to autobuy', state = lowestCaseToAutoBuy, value = caseNames[1], values = caseNames, callback = function(v) lowestCaseToAutoBuy = v end})
autobuyoptions:AddList({text = 'highest cost case to autobuy', state = highestCaseToAutoBuy, value = caseNames[#caseNames], values = caseNames, callback = function(v) highestCaseToAutoBuy = v end})
--// auto sell UI
window:AddToggle({text = 'Auto sell', state = autosell, callback = function(v)
autosell = v;
updateCurrentItems()
sellCurrentItems()
end})
--// auto sell options UI
local autoselloptions = window:AddFolder("auto sell options")
autoselloptions:AddSlider({text = 'Max price to autosell', value = 50000, min = 0, max = 50000, float = 1000, dual = true, callback = function(v)
maxPrice = v
updateCurrentItems()
sellCurrentItems()
end})
--// auto click UI
window:AddToggle({text = 'Auto click', state = autoclick, callback = function(v)
autoclick = v;
end})
--// auto upgrade clicks UI
window:AddToggle({text = 'Auto upgrade clicks', state = autoupgrade, callback = function(v)
autoupgrade = v;
end})
--// Anti afk UI
window:AddToggle({text = 'Anti Afk', state = antiafk, callback = function(v)
antiafk = v;
end})
--// Init library
lib:Init()
warn("my butthole is wet daddy")
]]