Advertisement
Guest User

Untitled

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