Advertisement
Feliposo21

joiner

Jun 26th, 2022
1,093
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- DOCUMENTATION: https://ic3w0lf22.gitbook.io/roblox-account-manager/
  2. local Account = {} Account.__index = Account
  3.  
  4. local WebserverSettings = {
  5.     Port = '7963',
  6.     Password = '1234567'
  7. }
  8.  
  9. function WebserverSettings:SetPort(Port) self.Port = Port end
  10. function WebserverSettings:SetPassword(Password) self.Password = Password end
  11.  
  12. local HttpService = game:GetService'HttpService'
  13. local Request = (syn and syn.request) or request or (http and http.request) or http_request
  14.  
  15. local function GET(Method, Account, ...)
  16.     local Arguments = {...}
  17.     local Url = 'http://localhost:' .. WebserverSettings.Port .. '/' .. Method .. '?Account=' .. Account
  18.  
  19.     for Index, Parameter in pairs(Arguments) do
  20.         Url = Url .. '&' .. Parameter
  21.     end
  22.  
  23.     if WebserverSettings.Password and #WebserverSettings.Password >= 6 then
  24.         Url = Url .. '&Password=' .. WebserverSettings.Password
  25.     end
  26.    
  27.     local Response = Request {
  28.         Method = 'GET',
  29.         Url = Url
  30.     }
  31.  
  32.     if Response.StatusCode ~= 200 then return false end
  33.  
  34.     return Response.Body
  35. end
  36.  
  37. local function POST(Method, Account, Body, ...)
  38.     local Arguments = {...}
  39.     local Url = 'http://localhost:' .. WebserverSettings.Port .. '/' .. Method .. '?Account=' .. Account
  40.  
  41.     for Index, Parameter in pairs(Arguments) do
  42.         Url = '&' .. Url .. Parameter
  43.     end
  44.  
  45.     if WebserverSettings.Password and #WebserverSettings.Password >= 6 then
  46.         Url = Url .. '&Password=' .. WebserverSettings.Password
  47.     end
  48.    
  49.     local Response = Request {
  50.         Method = 'POST',
  51.         Url = Url,
  52.         Body = Body
  53.     }
  54.  
  55.     if Response.StatusCode ~= 200 then return false end
  56.  
  57.     return Response.Body
  58. end
  59.  
  60. function Account.new(Username, SkipValidation)
  61.     local self = {} setmetatable(self, Account)
  62.  
  63.     local IsValid = SkipValidation or GET('GetCSRFToken', Username)
  64.  
  65.     if not IsValid or IsValid == 'Invalid Account' then return false end
  66.  
  67.     self.Username = Username
  68.  
  69.     return self
  70. end
  71.  
  72. function Account:GetCSRFToken() return GET('GetCSRFToken', self.Username) end
  73.  
  74. function Account:BlockUser(Argument)
  75.     if typeof(Argument) == 'string' then
  76.         return GET('BlockUser', self.Username, 'UserId=' .. Argument)
  77.     elseif typeof(Argument) == 'Instance' and Argument:IsA'Player' then
  78.         return self:BlockUser(tostring(Argument.UserId))
  79.     elseif typeof(Argument) == 'number' then
  80.         return self:BlockUser(tostring(Argument))
  81.     end
  82. end
  83. function Account:UnblockUser(Argument)
  84.     if typeof(Argument) == 'string' then
  85.         return GET('UnblockUser', self.Username, 'UserId=' .. Argument)
  86.     elseif typeof(Argument) == 'Instance' and Argument:IsA'Player' then
  87.         return self:BlockUser(tostring(Argument.UserId))
  88.     elseif typeof(Argument) == 'number' then
  89.         return self:BlockUser(tostring(Argument))
  90.     end
  91. end
  92. function Account:GetBlockedList() return GET('GetBlockedList', self.Username) end
  93. function Account:UnblockEveryone() return GET('UnblockEveryone', self.Username) end
  94.  
  95. function Account:GetAlias() return GET('GetAlias', self.Username) end
  96. function Account:GetDescription() return GET('GetDescription', self.Username) end
  97. function Account:SetAlias(Alias) return POST('SetAlias', self.Username, Alias) end
  98. function Account:SetDescription(Description) return POST('SetDescription', self.Username, Description) end
  99. function Account:AppendDescription(Description) return POST('AppendDescription', self.Username, Description) end
  100.  
  101. function Account:GetField(Field) return GET('GetField', self.Username, 'Field=' .. HttpService:UrlEncode(Field)) end
  102. function Account:SetField(Field, Value) return GET('SetField', self.Username, 'Field=' .. HttpService:UrlEncode(Field), 'Value=' .. HttpService:UrlEncode(tostring(Value))) end
  103. function Account:RemoveField(Field) return GET('RemoveField', self.Username, 'Field=' .. HttpService:UrlEncode(Field)) end
  104.  
  105. function Account:SetServer(PlaceId, JobId) return GET('SetServer', self.Username, 'PlaceId=' .. PlaceId, 'JobId=' .. JobId) end
  106. function Account:SetRecommendedServer(PlaceId) return GET('SetServer', self.Username, 'PlaceId=' .. PlaceId) end
  107.  
  108. function Account:ImportCookie(Token) return GET('ImportCookie', 'Cookie=' .. Token) end
  109. function Account:GetCookie() return GET('GetCookie', self.Username) end
  110. function Account:LaunchAccount(PlaceId, JobId, FollowUser, JoinVip) -- if you want to follow someone, PlaceId must be their user id
  111.     return GET('LaunchAccount', self.Username, 'PlaceId=' .. PlaceId, JobId and ('JobId=' .. JobId), FollowUser and 'FollowUser=true', JoinVip and 'JoinVIP=true')
  112. end
  113. getgenv().LaunchAccount = function(Nick,PlaceID,JobId)  mynick = Account.new(Nick) mynick:LaunchAccount(PlaceID,JobId) end
  114. return Account, WebserverSettings
Advertisement
RAW Paste Data Copied
Advertisement