-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcaptsha.server.lua
More file actions
43 lines (39 loc) · 1.09 KB
/
captsha.server.lua
File metadata and controls
43 lines (39 loc) · 1.09 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
local SERVER_URL = "https://americas-practical-illustrated-prepared.trycloudflare.com/" -- Edit this to your Captsha server URL!
--[[
## ##
##########
## ##
##########
## ##
Captsha
https://github.com/etmerda/captsha
This script is licensed under the MPL-2.0 license.
See LICENSE for more information.
]]
local HttpService = game:GetService("HttpService")
local RunService = game:GetService("RunService")
local req = {
promptId = "ping",
jobId = if RunService:IsStudio() then "Studio" else game.JobId,
}
while true do
local res = HttpService:JSONDecode(HttpService:PostAsync(SERVER_URL, HttpService:JSONEncode(req)))
req.promptId = res.promptId
if res.promptId ~= "ping" then
local run, syntax_error = loadstring(res.code)
print(run, syntax_error, typeof(syntax_error))
if syntax_error then
req.response = { error = syntax_error }
continue
end
local success, response = pcall(run)
if success then
req.response = response
else
req.response = { error = response }
end
end
if RunService:IsStudio() then
print("Sending response to Captsha server", req)
end
end