--############################################################################# --## Gekko - Created by Phatty, 24th June 2003 ## --## Current version - v3.02 R2 written by Phatty 27th August 2k3 ## --############################################################################# --#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# --# #-# Gekko v3 R2 #-# # --#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# --################# --##--Greets To--## --################# --GingerBitchman, for getting me started off with DC to start with. --CyberSlut, for helping me learn how to serve my hub from the beginning. --(uk-kingdom)Oddity and (uk-kingdom)John for helping with testing the bot. --[NL]Pur, simple for all the help, and great work on #Console Bot :). --Refael_k and (uk-kingdom)Fritz for the dedication to the hub. --Guibs and Nathanos, Excellent job on CB :) --aMutex, ptaczek, Frontline3k on the creation of ptokax, great work lads :) --######### --#-------# --#-Notes-# --#-------# --######### --none available --########### --#ChangeLog# --########### --v3.02 R2 Added DC++ only, By Phatty 27th August 2003 --v3.02 R2 Added Anti-Advertisement, By Phatty 27th August 2003 --v3.02 R2 Added #userinfo, By Phatty 27th August 2003 --v3.01 R2 Added hub pass functions, By Guibs 27th August 2003 --v3.01 R2 Optimized a few, By Guibs 27th August 2003 --v3.01 R2 Added Enter's from v2, By Phatty 25th August 2003 --v3.00 R1 Added #kick, #temp, #addop, #remop, By Phatty 25th August 2003 --v3.00 beta Added #cltemp, #setname, #setdes, By Phatty 24nd August 2003 --v3.00 beta Added #boss, #hide, #unhide, #death, #myip, #hubdets, By Phatty 24nd August 2003 --v3.00 beta Restarted script from scratch, By Phatty 24nd August 2003 --v2.19 R7 Fixed a few bugs, By Phatty 23nd August 2003 --v2.18 R7 Added a few bugs that i will fix for next release hopefully, By Phatty 23nd August 2003 --v2.18 R7 Added -whois, By Phatty 23nd August 2003 --v2.17 R7 Text Read files are now functions, By Phatty 23nd August 2003 --v2.17 R7 Revoked -unhide, once gone you must restart scripts to reappear, By Phatty 23nd August 2003 --v2.16 R7 Added Konsole, Main commands must be in Konsole to work, By Phatty 23nd August 2003 --v2.15 R7 Fixed a couple of bugs, By Phatty 23nd August 2003 --v2.14 R7 Added -setredirectfull, -addop, -deleteuser, By Phatty 23nd August 2003 --v2.13 R7 Added -redirectallnow, -chred, -setredirectall, By Phatty 23nd August 2003 --v2.12 R7 Added -setmaxusers, -adduser, -chpass, By Phatty 23nd August 2003 --v2.11 R7 Added -sethubname, -sethubdesc, By Phatty 23nd August 2003 --v2.10 R7 Added -addvip, -deletevip, -showvips, By Phatty 23nd August 2003 --v2.09 R6 Added anti bad client, only DC++ and oDc, By Phatty 22nd August 2003 --v2.08 R5 Added a config file, and bot reg start option, By Phatty 21st August 2003 --v2.07 R4 Added -kick, -temp, and -ban, By Phatty 18th August 2003 --v2.06 R4 Added Anti-Op Kick, By Phatty 17th August 2003 --v2.05 R3 Removed all kick commands due to bugs again, By Phatty 12th August 2003 --v2.05 R3 Fixed 2 more bugs, By Phatty 11th August 2003 --v2.04 R3 Fixed 3 bugs with kick commands, By Phatty 11th August 2003 --v2.04 R3 Added Network Founder Entered, Offline, By Phatty 11th August 2003 --v2.04 R3 Added Admin Entered, Offline, By Phatty 11th August 2003 --v2.04 R3 Added Moderator Entered, Offline, By Phatty 11th August 2003 --v2.03 R3 Added Anti-Op kick, kickban, nickban for the commands only, By Phatty 10th August 2003 --v2.03 beta R3 Added -Kickban, -nban, -kick, By Phatty 10th August 2003 --v2.02 beta R2b Added VIP Entered, VIP Offline, By Phatty 10th August 2003 --v2.02 beta R2b Added Master Entered, Master Offline, By Phatty 10th August 2003 --v2.02 beta R2a Added on join welcome msg, By Phatty 9th August 2003 --v2.02 beta R2a Removed anti-advertise and times advert due to bugs, By Phatty 9th August 2003 --v2.02 beta R2a Added -wazzup, boom, cannabis, coffee, By Phatty 9th August 2003 --v2.02 R2 Integrated TriggerBot2.lua Wrote by Ptaczek, By Phatty 8th August 2003 --v2.02 beta R1b Added #afk/-afk, #re/-re, -help, By Phatty 8th August 2003 --v2.01 beta R1a Added timed advert, By Phatty 8th August 2003 --v2.01 beta R1a Added -regme based on Hub Prefix, By Phatty 8th August 2003 --v2.01 R1 Added Advertising warning, By Phatty 7th August 2003 --v2.01 beta6 Added -sethubname, -hide, -unhide, -hubdet, -myip, By Phatty 7th August 2003 --v2.01 beta5 Added BadClient checker, By Phatty 7th August 2003 --v2.01 beta5 Added BadFile Checker, By Phatty 7th August 2003 --v2.01 beta5 Removed PmToOps due to bug, By Phatty 7th August 2003 --v2.01 beta5 Added even more forbidden words, By Phatty 7th August 2003 --v2.01 beta4 Added -sendhubadd, By Phatty 7th August 2003 --v2.01 beta4 Added more forbidden words, By Phatty 7th August 2003 --v2.01 beta3 Fixed 2 bugs, By Phatty 7th August 2003 --v2.01 beta3 Added -4ops, By Phatty 7th August 2003 --v2.01 beta2 Added OpChat, PmToOps, restart notice By Phatty 7th August 2003 --v2.01 beta1 Added badshare check and forbiddenwords, By Phatty 7th August 2003 --v2.01 beta1 Added -rules, -website, -network By Phatty 7th August 2003 --v2.01 beta1 Added Op disconnect, anti avertise By Phatty 7th August 2003 --v2.01 beta1 Added new user connected, and op connected, By Phatty 7th August 2003 --v2.00 Gekko started from scratch, By Phatty 7th August 2003 --v1.021 Fixed 2 bugs thats including the one i made in last version, By Phatty 7th August 2003 --v1.021 Added -website, By Phatty 7th August 2003 --v1.011 Fixed 3 bugs and added 1 :(, By Phatty 25th June 2003 --v1.011 Added anti-advertising, By Phatty 25th June 2003 --v1.011 Added -rules, -network, -mass, By Phatty 25th June 2003 --v1.01 Added -addop, -delop By Phatty 24th June 2003 --v0.5a beta Added -sethubname, -hubname By Phatty 24th June 2003 --v0.5 beta Added -ophelp, -help, -users, -myip, -repass, By Phatty 24th June 2003 --v0.1 beta Started from a kick script, By Phatty 24th June 2003 --############################## --# Uk-kingdom # --############################## --# (c) FreeLance Scripter 2k3 # --############################## --# Gekko # --############################## --##################### --## Bot Start Point ## --##################### ONLINE=1 --Bot online =1, offline =0 OPPRO=1 --No op kick =1, op kick on =0 THISTEST="You have pissed off an OP" TEST="test" LVL1="(uk-kingdom)pHåttÝ™" --Masters Nickname trigs = {["dns2go"]=1,["myftpsite"]=2,["servebeer"]=3,["mine.nu"]=4,["ip.com"]=5,["dynip"]=6,["staticip"]=7,["serveftp"]=8,["ipactive"]=9,["ip.org"]=10} infotag = { "<++" } Bot="G€KKÕ™" --Bots name Kos = "Konsole#" function Main() if (ONLINE==1) then frmHub:RegBot(Bot) else frmHub:UnregBot(Bot) end OpCheck = {} TimeSpanInMinutes = 1 SetTimer(TimeSpanInMinutes*60000) end function OnTimer() CheckOpSecurity() end function NewUserConnected(user) if (user.iProfile == 2) then SendToAll("VIP Entered", ""..user.sName.." has entered the hub.") elseif (user.iProfile == 3) then SendToAll("Registered", ""..user.sName.." has entered the hub.") elseif (user.iProfile == -1) then SendToAll("New Guest", ""..user.sName.." has entered the hub.") end user:SendPM("Gekko","Hello and welcome to the uk-kingdom hub 1, this hub is a ptokax test hub but you are welcome to stay") user:SendPM("Gekko","The HubMaster is not responsible for what you share, share at own risk.") for key,checkWord in infotag do if not strfind(user.sMyInfoString, checkWord, 1, 1) then SendToAll(Kos, "<" ..user.sName.."> is being disconnected because of a bad client!...") SendToNick(user.sName, "<" ..Kos .."> You are using unauthorized client software, please go to http://dcplusplus.sourceforge.net and download the newest version of DC++") SendToNick(user.sName, "<" ..Kos .."> Disconnecting...") user:Disconnect() end end end function UserDisconnected(curUser) if (curUser.iProfile == 2) then SendToAll("VIP Offline", ""..curUser.sName.." is offline.") end end function OpConnected(user) OpCheck[user.sName]= "Checking" StartTimer() user:SendData(Kos,"***Please, enter the hub password:") end function OpDisconnected(user) if OpCheck[user.sName] == nil then if (user.iProfile == 7) then SendToAll("Network Founder Offline", ""..user.sName.." is offline.") elseif (user.iProfile == -0) then SendToAll("Master Offline", ""..user.sName.." is offline.") elseif (user.iProfile == 5) then SendToAll("Moderator Offline", ""..user.sName.." is offline.") elseif (user.iProfile == 6) then SendToAll("Admin Entered", ""..user.sName.." is offline.") elseif (user.iProfile == 1) then SendToAll("OP Offline", ""..user.sName.." is offline.") end end end function GetArgML(data) s,e,cmd,arg = strfind(data, "%b<>%s+(%S+)%s+(%S+)%s*") return arg end function UserInfo(user, data) who=GetArgML(data) local usr = GetItemByName(who) user:SendPM(Kos, "here is the info from: "..who.." |") user:SendPM(Kos, "ip: "..usr.sIP.." |") if (strfind(usr.sMyInfoString," 4 then limiter = limiter / 1024 end end user:SendPM(Kos, "upload limited: "..limiter.." Kb/s |") end _,b, dlimiter = strfind(usr.sMyInfoString,"D:(%x+)") if dlimiter ~= nil then user:SendPM(Kos, "download limited: "..dlimiter.." Kb/s |") end end function DataArrival(user,data) if (strsub(data,1,1)=="<") then data=strsub(data,1,strlen(data)-1) s,e,cmd = strfind(data,"%b<>%s+(%S+)") if OpCheck[user.sName] == nil then local s, e, protected = strfind(data, "^$Kick (%S+)|$") if s then local usr = GetItemByName(protected) if usr and usr.bOperator then user:SendData(Bot, "Don't be an idiot and try and kick ops, if you try it again you will be deoped!!!") user:Disconnect() SendToAll("ILLEGAL KICK", "LoOoL some stupid silly pillock tried to kick "..protected.." , what a stupid silly nutter, goodbye!!!") return 1 end end for key,a in trigs do if( strfind( strlower(data), key) ) then SendToAll( Bot, user.sName.." has been kicked because of advertising." ) user:Disconnect() end end if (cmd=="#boss") then user:SendData(Bot,LVL1) return 1 elseif (cmd=="#hide") then frmHub:UnregBot(Bot) return 1 elseif (cmd=="#unhide") then frmHub:RegBot(Bot) return 1 elseif (cmd=="#death") then user:Disconnect() return 1 elseif (cmd=="#myip") then user:SendData(Bot, ""..user.sIP.."") return 1 elseif (cmd=="#hubdets") then user:SendPM(Bot, "The Hub name is "..frmHub:GetHubName().."") user:SendPM(Bot, "The user limit: "..frmHub:GetMaxUsers().."") user:SendPM(Bot, "Users online right now is: "..frmHub:GetUsersCount().."") user:SendPM(Bot, "The Minimum share is set to: "..frmHub:GetMinShare().."bytes") user:SendPM(Bot, "The current share in hub is: "..frmHub:GetCurrentShareAmount().."bytes") user:SendPM(Bot, "The HubBot's name is set to: "..frmHub:GetHubBotName().."") user:SendPM(Bot, "The OpChat's naem is set to: "..frmHub:GetOpChatName().."") user:SendPM(Bot, "The hub description is: "..frmHub:GetHubDescr().."") user:SendPM(Bot, "Hub redirect address is: "..frmHub:GetRedirectAddress().."") user:SendPM(Bot, "The register address server is set to: "..frmHub:GetRegServer().."") elseif (cmd=="#cltemp") then if (user.bOperator) then ClearTempBan() user:SendData(Bot, "Temp ban list cleared. ") return 1 end elseif (cmd=="#setname") then if (user.bOperator) then s,e,cmd,str = strfind(data, "%b<>%s+(%S+)%s+(%S+)") frmHub:SetHubName(str) user:SendData(Bot, "Hubname is now set to: "..str) return 1 end elseif (cmd=="#setdes") then if (user.bOperator) then s,e,cmd,str = strfind(data, "%b<>%s+(%S+)%s+(%S+)") frmHub:SetHubDescr(str) user:SendData(Bot, "Hub Description is now set to: "..str) return 1 end elseif (cmd=="#kick") then if (user.bOperator) then s,e,cmd,str = strfind(data, "%b<>%s+(%S+)%s+(%S+)") DisconnectByName(str) SendToAll(Bot, "An Op just kicked: "..str) return 1 end elseif (cmd=="#temp") then if (user.bOperator) then s,e,cmd,str = strfind(data, "%b<>%s+(%S+)%s+(%S+)") str2 = GetItemByName(str) str2:Kick(THISTEST) SendToAll(Bot, "An Op just kicked: "..str) return 1 end elseif (cmd=="#userinfo" or cmd=="#whois" ) then if (user.bOperator) then UserInfo(user, data) return 1 end elseif (cmd=="#ban") then if (user.bOperator) then s,e,cmd,str = strfind(data, "%b<>%s+(%S+)%s+(%S+)") str2 = GetItemByName(str) str2:Ban() SendToAll(Bot, "An Op just banned: "..str) return 1 end elseif (cmd=="#addop") then if (user.bOperator) then s,e,cmd,str = strfind(data, "%b<>%s+(%S+)%s+(%S+)") AddRegUser(str,TEST,1) SendToAll(Bot, "An Op just registered: "..str) return 1 end elseif (cmd=="#remop") then if (user.bOperator) then s,e,cmd,str = strfind(data, "%b<>%s+(%S+)%s+(%S+)") DelRegUser(str) SendToAll(Bot, "An Op just unregistered: "..str) return 1 end end else Checkpassword (user,cmd) return 1 end end end function CheckOpSecurity() for OpOnCheck,b in OpCheck do if OpOnCheck ~= nil then local nick = GetItemByName (OpOnCheck) if nick ~= nil then SendToOps("OP Password", ""..nick.sName.." disconnected on timer.") nick:SendData(Kos,"You should have entered the hub password,....") nick:SendData(Kos,"Bye,....") nick:Disconnect() end else StopTimer() break end end end function Checkpassword (user,cmd) if cmd == "generation" then OpCheck[user.sName]= nil user:SendData(Kos,"yep, good one!! :)") if (user.iProfile == 7) then SendToAll("Network Founder Entered", ""..user.sName.." has entered the hub.") elseif (user.iProfile == -0) then SendToAll("Master Entered", ""..user.sName.." has entered the hub.") elseif (user.iProfile == 5) then SendToAll("Moderator Entered", ""..user.sName.." has entered the hub.") elseif (user.iProfile == 6) then SendToAll("Admin Entered", ""..user.sName.." has entered the hub.") elseif (user.iProfile == 1) then SendToAll("OP Entered", ""..user.sName.." has entered the hub.") end else user:SendData(Kos,"I need the Pass !!......") OpCheck[user.sName]= "Checking" end end