Advertisement
Guest User

Untitled

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