Advertisement
Guest User

Untitled

a guest
May 30th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.56 KB | None | 0 0
  1. --Change these Variables
  2. --Script By Blam
  3. user = "AeonBot"
  4. pass = "uke"
  5. yourtag = "aeon" --no caps
  6. serverip = "66.230.224.162"
  7. serverport = 20240
  8. blacklist = {
  9.    "Name1",
  10. }
  11. oplist = {
  12.     "TheAnimal",
  13.     "Spaft",
  14.     "Analwache",
  15.     "InyaFace",
  16.     "SilentAssassin",
  17.     "omqq",
  18.     "SocKeTe",
  19.     "Garkin",
  20.     "ViperTech",
  21.     "DltBot",
  22. }
  23. badwords = {
  24.     "shit",
  25.     "fuck",
  26.     "nigger",
  27.     "cunt",
  28.     "cock",
  29.     "bitch",
  30.     "whore",
  31.     "blam sucks",
  32.     "pussy",
  33.     "faggot",
  34.     "tits",
  35.     "ass",
  36.     "fucker",
  37.     "retard",
  38. }
  39.  
  40.  
  41. --Don't change below here
  42. --Unless you know what you're doing
  43.  
  44. --
  45. muteTimers = { }
  46. currTimer = 1
  47. function muteFor(name,time)
  48.     Send("mute " .. name)
  49.     muteTimers[currTimer] = timer()
  50.     muteTimers[currTimer].Interval = time*1000
  51.     muteTimers[currTimer].Enabled = true
  52.     muteTimers[currTimer].Tick:Add(
  53.         function()
  54.             Send("unmute " .. name)
  55.         end
  56.     )
  57.     currTimer = currTimer + 1
  58. end
  59. --
  60. chat = ""
  61. chatl = ""
  62.  
  63. check = 0
  64. lastplayer = ""
  65.  
  66. dofile("BaseBot.lua")
  67.  
  68. function Say(text)
  69.     text = string.gsub(text, "#time", os.date("%X"))
  70.     Send("SAY " .. text)
  71. end
  72.  
  73. Connect(serverip,serverport)
  74. Login(user,pass)
  75. Say(".:AeonBot 1.5 Connected:.")
  76. Spec("- Cencerd")
  77.  
  78.  
  79. i = 0
  80. form1 = form()
  81. form1.Text = "ScriptBot 1.4 GUI"
  82. form1.Height = 120
  83. button1 = button()
  84. button1.Text = "Disconnect"
  85. button1.Dock = dockStyle.Bottom
  86. button1.Click:Add(function() timer1.Enabled = false; for i = 1,#muteTimers do muteTimers[i].Enabled = false end; Disconnect(); form1:Close() end)
  87. inputBox1 = textBox()
  88. inputBox1.Text = "Message"
  89. inputBox1.Dock = dockStyle.Bottom
  90. button2 = button()
  91. button2.Text = "Say"
  92. button2.Dock = dockStyle.Bottom
  93. button2.Click:Add(function() Say(inputBox1.Text) end)
  94. button3 = button()
  95. button3.Text = "Kick"
  96. button3.Dock = dockStyle.Bottom
  97. button3.Click:Add(function() Send("kick " .. inputBox1.Text) end)
  98. form1.Controls:Add(inputBox1)
  99. form1.Controls:Add(button2)
  100. form1.Controls:Add(button3)
  101. form1.Controls:Add(button1)
  102.  
  103. form1:Show()
  104. --
  105.  
  106. timer1 = timer()
  107. timer1.Interval = 5000
  108. timer1.Enabled = true
  109. timer1.Tick:Add(
  110.     function()
  111.         i = i + 1
  112.         --Say("Test" .. i)
  113.         Send("PING")
  114.     end
  115. )
  116.  
  117. --
  118.  
  119. function LineChanged(Line)
  120.     if(Line:sub(0,3) == "SAY") then
  121.         math.randomseed( os.time() )
  122.         math.random(); math.random(); math.random();
  123.         for i = 0,math.random(1,10) do
  124.             math.random();
  125.         end
  126.         A = Line:find(";")
  127.         print("> " ..Line:sub(A+1))
  128.         B = Line:find(" ",A+1)
  129.         if(B ~= nil) then
  130.             Chat = Line:sub(B+1)
  131.             Player = Line:sub(A+8,B-2)
  132.             Chatl = Chat:lower()
  133.             Playerl = Player:lower()
  134.             a = 1
  135.             for word in string.gmatch(Player,"%w+") do
  136.                 if(a == 1) then Clan = word elseif(a == 2) then PlayerNT = word end
  137.                 a = a + 1
  138.             end
  139.         end
  140.        
  141.         opd = 0
  142.         for i = 1,#oplist do
  143.             if(oplist[i] == PlayerNT) then
  144.                 opd = 1
  145.                 print("OP'D")
  146.             end
  147.         end
  148.        
  149.         if(Chatl == "!terminate") then if(opd == 1) then joketimer.Enabled = false; timer1.Enabled = false; Disconnect(); form1:Close() end end
  150.         if(Chatl == "servant?") then Say("Hello?") end
  151.         if(Chatl == "!time") then Say("Bot's Time <#time>") end
  152.         if(Chatl == "!op") then
  153.             if(opd == 0) then
  154.                 muteFor(Player,60)
  155.                 Say("Your too fat to be op ^06".. PlayerNT .."^07! <60 Second Mute>")
  156.             else
  157.                 Send("op " .. PlayerNT)
  158.                 Say("we love ^06" .. PlayerNT .. "^07 so we op'd you.")
  159.             end
  160.         end
  161.        
  162.         if(Chatl:sub(0,6) == "!addop") then
  163.             if(opd == 1) then
  164.                 table.insert(oplist,Chat:sub(8))
  165.                 Say("Added : " .. Chat:sub(8) .. " to the op list.")
  166.             end
  167.         end
  168.          
  169.         if(Chatl:sub(0,5) == "!mute") then
  170.             if(opd == 1) then
  171.                 local mPlayer = Chat:sub(Chatl:find(" ")+1,Chatl:find(" ", Chatl:find(" ")+1)-1)
  172.                 local mTime = Chatl:sub(Chatl:find(" ", Chatl:find(" ")+1)+1)
  173.                 print(mTime)
  174.                 Say("^06"..mPlayer.."^02 has been muted for ^06"..mTime.."^02 seconds.")
  175.                 muteFor(mPlayer, mTime)
  176.             end
  177.         end
  178.        
  179.         if(Chatl:sub(0,7) == "!addban") then
  180.             if(opd == 1) then
  181.                 table.insert(blacklist,Chat:sub(9))
  182.                 Say("Added : " .. Chat:sub(9) .. " to the ban list.")
  183.             end
  184.         end
  185.          
  186.         logfile = io.open("Log.txt","a+")
  187.         if(logfile == nil) then logfile = io.open("Log.txt","w") end
  188.         logfile:write(os.date("%c") .. " " .. Player .. ": " .. Chat .. "\n")
  189.         logfile:close()
  190.        
  191.         if(Chat == "!go") then
  192.             check = 1
  193.             setServer()
  194.             print("Op mode activated.")
  195.         end
  196.        
  197.         if(Chat == "!modlist") then
  198.             if(opd == 1) then
  199.                 for i = 1,#oplist do
  200.                     Say(oplist[i])
  201.                 end
  202.             end
  203.         end
  204.        
  205.         if(check == 1) then
  206.             if(Chat == "!Set") then
  207.                 if(opd == 1) then
  208.                     setServer()
  209.                 end
  210.             end
  211.         end
  212.        
  213.         if(opd == 0) then
  214.             for i = 1,#badwords do
  215.                 curword = string.lower(badwords[i])
  216.                 if(Chatl:find(curword) ~= nil) then
  217.                     muteFor(PlayerNT,60)
  218.                     Say("^02Muted ^06"..PlayerNT.."^02 for ^0660^02 seconds.")
  219.                 end
  220.             end
  221.         end
  222.        
  223.     elseif(Line:sub(0,4) == "BOUT") then
  224.         if(check == 1) then
  225.             a = 0        
  226.             for word in string.gmatch(Line, "%w+") do a = a + 1; if (a == 10) then player = word elseif(a == 9) then tag = word elseif(a == 8) then checkend = word end end
  227.             if(checkend ~= "END") then
  228.                 if(player ~= nil) then -- lastplayer ~= player) then
  229.                     for i = 1,#blacklist do
  230.                         if(blacklist[i] == player) then
  231.                             Send("kick " .. player .. " you are banned.")
  232.                             print("Attempted to kick: " .. player)
  233.                             --lastplayer = player
  234.                         end
  235.                     end
  236.                 end
  237.                 if(player ~= user) then
  238.                     if(tag:lower() ~= yourtag) then
  239.                         print(tag .. " - " .. yourtag)
  240.                         Send("kick " .. player .. " private match.")
  241.                     end
  242.                 end
  243.             end
  244.         end
  245.     elseif(Line:sub(0,4) == "SPEC") then
  246.         if(check == 1) then
  247.             for word in string.gmatch(Line:sub(9), "%w+") do
  248.                 player = word
  249.                 for i = 1,#blacklist do
  250.                     if(blacklist[i] == player) then
  251.                         Send("kick " .. player .. " you are banned.")
  252.                         print("Attempted to kick: " .. player)    
  253.                     end
  254.                 end
  255.             end
  256.         end
  257.     end
  258. end
  259.  
  260. function setServer()
  261.     serverSettings = io.open("Scripts/serversettings.txt")
  262.     if(serverSettings == nil) then
  263.         print("Failed to load serversettings.txt")
  264.     else
  265.         line = serverSettings:read("*l")
  266.         i=1
  267.         while(line ~= nil) do
  268.             Send("set " .. line)
  269.             print("Set \"" .. line .. "\" at line " .. i)
  270.             line = serverSettings:read("*l")
  271.             i = i + 1
  272.         end
  273.     end
  274. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement