forked from quoid/userscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSheeeesh
More file actions
148 lines (125 loc) · 4.1 KB
/
Copy pathSheeeesh
File metadata and controls
148 lines (125 loc) · 4.1 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
Information:
- This lets you spy on what the game does when you shoot (use this to reverse engineer and bypass AC)
- GetFullName is somehow detected so act fast before u get kicked
]]
-- // Services
local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
-- // Vars
local LocalPlayer = Players.LocalPlayer
-- // Config
local Output = ""
local SaveOutput = Enum.KeyCode.Q
local AutoSaveOutput = true
local EnableSpy = false
local TargetScript = nil--LocalPlayer.PlayerGui:WaitForChild("Main").MainScript
-- // safe (ish) tostring (ty simplespy)
local function safetostring(v: any)
if typeof(v) == "userdata" or type(v) == "table" then
local mt = getrawmetatable(v)
local badtostring = mt and rawget(mt, "__tostring")
if mt and badtostring then
rawset(mt, "__tostring", nil)
local out = tostring(v)
rawset(mt, "__tostring", badtostring)
return out
end
end
return tostring(v)
end
-- // Convert table to string (table.concat doesn't play nice so I had to make this.)
local function ArrayToString(t, sep)
-- // Vars
local String = ""
local StringFormat = "%s%s%s"
-- //
for _, v in pairs(t) do
String = string.format(StringFormat, String, safetostring(v), sep)
end
-- //
return String
end
-- // __namecall hook
local GetFullName = game.GetFullName
local __namecallFormat = "__namecall -> self = %s\n method = %s\n args = %s\n"
local __namecall
__namecall = hookmetamethod(game, "__namecall", function(...)
-- // Vars
local args = {...}
local self = args[1]
local method = getnamecallmethod()
local callingscript = getcallingscript()
-- // Make sure the spy is enabled
if (not EnableSpy and (callingscript == TargetScript or not TargetScript)) then
-- // Remove self from args
local args2 = {...}
table.remove(args2, 1)
-- // Add to output
local selfName = GetFullName(self)
local ParsedArgs = ArrayToString(args2, ", ")
Output = Output .. __namecallFormat.format(__namecallFormat, selfName, method, ParsedArgs)
end
-- //
return __namecall(...)
end)
-- // __index hook
local __indexFormat = "__index -> self = %s\n k = %s\n"
local __index
__index = hookmetamethod(game, "__index", function(t, k)
-- // Vars
local callingscript = getcallingscript()
-- // Make sure the spy is enabled
if (EnableSpy and (callingscript == TargetScript or not TargetScript)) then
-- // Add to output
local tName = GetFullName(t)
Output = Output .. __indexFormat:format(tName, k)
end
-- //
return __index(t, k)
end)
-- // __newindex hook
local __newindexFormat = "__newindex -> self = %s\n k = %s\n v = %s\n"
local __newindex
__newindex = hookmetamethod(game, "__index", function(t, k, v)
-- // Vars
local callingscript = getcallingscript()
-- // Make sure the spy is enabled
if (EnableSpy and (callingscript == TargetScript or not TargetScript)) then
-- // Add to output
local tName = GetFullName(t)
local stringv = safetostring(v)
Output = Output .. __newindexFormat:format(tName, k, stringv)
end
-- //
return __newindex(t, k, v)
end)
-- // Toggles the spy (when we shoot)
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
-- //
if (gameProcessedEvent) then
return
end
-- // Check if we shot
if (input.UserInputType == Enum.UserInputType.MouseButton1) then
EnableSpy = true
return
end
-- // Check if we want to save the output
if (input.KeyCode == SaveOutput) then
writefile("Output.txt", Output)
end
end)
UserInputService.InputEnded:Connect(function(input, gameProcessedEvent)
-- //
if (gameProcessedEvent) then
return
end
-- // Check if we shot
if (input.UserInputType == Enum.UserInputType.MouseButton1) then
EnableSpy = false
-- // Save output
if (AutoSaveOutput) then
writefile("Output.txt", Output)
end
end
end)