Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Change these Variables
- --Script By Blam
- user = "[bot]SirBank"
- pass = "**********"
- yourtag = "sir" --no caps
- serverip = "66.230.224.162"
- serverport = 20225
- blacklist = {
- "Name1",
- }
- oplist = {
- "[Sir]May0naise",
- "Lord[Sir]Mastre",
- "[Sir]MrBlind",
- }
- badwords = {
- "slap"
- }
- --Don't change below here
- --Unless you know what you're doing
- --
- muteTimers = { }
- currTimer = 1
- function muteFor(name,time)
- Send("mute " .. name)
- muteTimers[currTimer] = timer()
- muteTimers[currTimer].Interval = time*1000
- muteTimers[currTimer].Enabled = true
- muteTimers[currTimer].Tick:Add(
- function()
- Send("unmute " .. name)
- end
- )
- currTimer = currTimer + 1
- end
- --
- chat = ""
- chatl = ""
- check = 0
- lastplayer = ""
- dofile("Scripts/BaseBot.lua")
- function Say(text)
- text = string.gsub(text, "#time", os.date("%X"))
- Send("SAY " .. text)
- end
- Connect(serverip,serverport)
- Login(user,pass)
- Say(".:ScriptBot 1.4 Connected:.")
- Spec("- tated")
- i = 0
- form1 = form()
- form1.Text = "ScriptBot 1.4 GUI"
- form1.Height = 120
- button1 = button()
- button1.Text = "Disconnect"
- button1.Dock = dockStyle.Bottom
- button1.Click:Add(function() timer1.Enabled = false; for i = 1,#muteTimers do muteTimers[i].Enabled = false end; Disconnect(); form1:Close() end)
- inputBox1 = textBox()
- inputBox1.Text = "Message"
- inputBox1.Dock = dockStyle.Bottom
- button2 = button()
- button2.Text = "Say"
- button2.Dock = dockStyle.Bottom
- button2.Click:Add(function() Say(inputBox1.Text) end)
- button3 = button()
- button3.Text = "Kick"
- button3.Dock = dockStyle.Bottom
- button3.Click:Add(function() Send("kick " .. inputBox1.Text) end)
- form1.Controls:Add(inputBox1)
- form1.Controls:Add(button2)
- form1.Controls:Add(button3)
- form1.Controls:Add(button1)
- form1:Show()
- --
- timer1 = timer()
- timer1.Interval = 5000
- timer1.Enabled = true
- timer1.Tick:Add(
- function()
- i = i + 1
- --Say("Test" .. i)
- Send("PING")
- end
- )
- --
- function LineChanged(Line)
- if(Line:sub(0,3) == "SAY") then
- math.randomseed( os.time() )
- math.random(); math.random(); math.random();
- for i = 0,math.random(1,10) do
- math.random();
- end
- A = Line:find(";")
- -- string.gsub(text, "#time", os.date("%X"))
- print(string.gsub(Line:sub(A+1), "(%w+)", ""))
- B = Line:find(" ",A+1)
- if(B ~= nil) then
- Chat = Line:sub(B+1)
- Player = Line:sub(A+8,B-5)
- Chatl = Chat:lower()
- if(Chatl == nil) then Chatl = "" end
- Playerl = Player:lower()
- a = 0
- for word in string.gmatch(Player,"%w+") do
- a = a + 1 -- check how many words in name.
- end
- if(a == 2) then --if clan tag exists
- a = 1
- for word in string.gmatch(Player,"%w+") do
- if(a == 1) then Clan = word elseif(a == 2) then PlayerNT = word end
- a = a + 1
- end
- else PlayerNT = Player end
- opd = 0
- for i = 1,#oplist do
- if(oplist[i] == PlayerNT) then
- opd = 1
- end
- end
- if(Chatl == "!terminate") then if(opd == 1) then joketimer.Enabled = false; timer1.Enabled = false; Disconnect(); form1:Close() end end
- if(Chatl == "servant?") then Say("Hello?") end
- if(Chatl == "!time") then Say("Bot's Time <#time>") end
- if(Chatl == "!op") then
- if(opd == 0) then
- muteFor(Player,60)
- Say("You dont deserve the op, <^06".. PlayerNT .."^07>! <60 Second Mute>")
- else
- Send("op " .. PlayerNT)
- Say("*Shoots <^06" .. PlayerNT .. "^07> with his oplazor*")
- end
- end
- if(Chatl ~= nil) then
- if(Chatl:sub(0,6) == "!addop") then
- if(opd == 1) then
- table.insert(oplist,Chat:sub(8))
- Say("Added : " .. Chat:sub(8) .. " to the op list.")
- end
- end
- end
- if(Chatl:sub(0,5) == "!mute") then
- if(opd == 1) then
- local mPlayer = Chat:sub(Chatl:find(" ")+1,Chatl:find(" ", Chatl:find(" ")+1)-1)
- local mTime = Chatl:sub(Chatl:find(" ", Chatl:find(" ")+1)+1)
- Say("^02Muted ^06"..mPlayer.."^02 for ^06"..mTime.."^02 seconds.")
- muteFor(mPlayer, mTime)
- end
- end
- if(Chatl:sub(0,7) == "!addban") then
- if(opd == 1) then
- table.insert(blacklist,Chat:sub(9))
- Say("Added : " .. Chat:sub(9) .. " to the ban list.")
- end
- end
- logfile = io.open("Log.txt","a+")
- if(logfile == nil) then logfile = io.open("Log.txt","w") end
- logfile:write(os.date("%c") .. " " .. Player .. ": " .. Chat .. "\n")
- logfile:close()
- if(Chat == "!go") then
- check = 1
- setServer()
- end
- if(Chat == "!modlist") then
- if(opd == 1) then
- for i = 1,#oplist do
- Say(oplist[i])
- end
- end
- end
- if(check == 1) then
- if(Chat == "!Set") then
- if(opd == 1) then
- setServer()
- end
- end
- end
- if(opd == 0) then
- for i = 1,#badwords do
- curword = string.lower(badwords[i])
- if(Chatl:find(curword) ~= nil) then
- muteFor(PlayerNT,60)
- Say("^02Muted ^06"..PlayerNT.."^02 for ^0660^02 seconds.")
- end
- end
- end
- end
- elseif(Line:sub(0,4) == "BOUT") then
- if(check == 1) then
- a = 0
- 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
- if(checkend ~= "END") then
- if(player ~= nil) then -- lastplayer ~= player) then
- for i = 1,#blacklist do
- if(blacklist[i] == player) then
- Send("kick " .. player .. " you are banned.")
- print("Attempted to kick: " .. player)
- --lastplayer = player
- end
- end
- end
- if(player ~= user) then
- if(tag:lower() ~= yourtag) then
- Send("kick " .. player .. " private match.")
- end
- end
- end
- end
- elseif(Line:sub(0,4) == "SPEC") then
- if(check == 1) then
- for word in string.gmatch(Line:sub(9), "%w+") do
- player = word
- for i = 1,#blacklist do
- if(blacklist[i] == player) then
- Send("kick " .. player .. " you are banned.")
- print("Attempted to kick: " .. player)
- end
- end
- end
- end
- end
- end
- function setServer()
- serverSettings = io.open("Scripts/serversettings.txt")
- if(serverSettings == nil) then
- print("Failed to load serversettings.txt")
- else
- line = serverSettings:read("*l")
- i=1
- while(line ~= nil) do
- Send("set " .. line)
- print("Set \"" .. line .. "\" at line " .. i)
- line = serverSettings:read("*l")
- i = i + 1
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement