Brutus
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Brutus

Started by DJ Bert, 08 December, 2003, 23:24:35

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DJ Bert

Hi all

Brutus is back again. Thnx to Troubadour for help how to work with scripts.
Just have updated Brutus with hubstat. I try to get more updates soon  :)

Brutus 4.5

Grtzzz [NL]-=DJ_Bert=-

pHaTTy

I see many mistakes, that can cause major crashes, i will not point out all but here is a few, you have SendToAll outside the functions, making a global...:S

scriptrestart goes to function Main

function RandomVIPMsgExit(user)
	local randomSeed = random(3)
	if randomSeed == 1 then
		return user.sName..", has left the hub and took all his available sluts........eh slots with him!"
	elseif randomSeed == 2 then
		return "Walking down the red carpet, "..user.sName.." struts out the building."
	elseif randomSeed == 3 then
		return user.sName.." has left the hub, and he's gonna be stinking drunk when he comes back."
	end
end
end

[/code]
where is 3rd end coming from?

function NewUserConnected(user)
   if user.iProfile == 2 then
      SendToAll(Bot, RandomVIPMsgConnect(user))
   elseif user.iProfile == nil then
      SendToNick(Bot, "Welcome to the [NL]Holland Hub" )
end
[/code]

send to what nick

and thats where the extra end goes ;)
Resistance is futile!

pHaTTy

here a little update for you to enjoy ;)]]ok this post is in 2 bits brrr

#####################
#### Brutus 4.60 ####
#####################
## Original Writer ##
#####################
## [NL]-=DJ_Bert=- ##
#####################

-- 4.6	  -Changed and moved a little more, By Phatty 5th December 2k3
-- 4.6	  -Moved Non Globals to functions, By Phatty 5th December 2k3
-- 4.6	  -Give the script a new look, By Phatty 5th December 2k3
-- 4.6	  -Removed return 0 from DataArrival , By Phatty 5th December 2k3
-- 4.6	  -Removed all the uneeded returns, By Phatty 5th December 2k3
-- 4.6	  -Fixed a few bugs, cleaned up scripts, By Phatty 5th December 2k3
-- 4.5    -added hubstat by [NL]-=DJ_Bert=- 07 dec 2003 --
-- 4.0    -reassigned txt info files Troubadour 10 nov 2003 --
-- 3.5    -updated VIP announcements by Troubadour 06 nov 2003 (because of provider switch a little behind with the updates) --
-- 3.4    -automatic implement of hubprofiles by Troubadour (request from wijsneus) 25 july 2003 --
-- 3.3    -assigned inbuilt hubfunktions by Troubadour 25 july 2003 --
-- 3.2    -re-assigned badclients by Troubadour 24 july 2003 --
-- 3.1    -added !description (explaining dc user description) by Troubadour 22 july 2003 --
-- 3.0    -added !faq by Troubadour 21 july 2003 --
-- 2.1    -modified !network and !rules in !oprules and !lol by [NL]-=DJ_Bert=- 20 july 2003 --
-- 2.0f   -modified random announcements by Troubadour 7 july 2003 --
-- 2.0e   -added !network by Troubadour 4 july 2003 --
-- 2.0d   -added !rules by Troubadour 4 july 2003 --
-- 2.0c   -Dc-gui kick removed by Troubadour and check for enabling dc tag by Plop 1 july 2003 --
-- 2.0b   -Single Op announcement for an exclusive operator besides the random announcements by Troubadour 1 july 2003 --
-- 2.0a   -bugfixed !away and !back command by Troubadour 29 june 2003 --
-- 2.0    -updated with !away command and !back command by Troubadour 28 june 2003 --
-- 1.0    -bugfixed Random VIP announcements by Troubadour 27 june 2003 --
-- 0.1e   -Random VIP announcements by Troubadour 26 june 2003 --
-- 0.1d   -Random OP announcements by Troubadour 26 june 2003 (idea seen during the use of channelbot)--
-- 0.1c   -bugfixed Op announcements by Troubadour 26 june 2003 --
-- 0.1b   -OP announcements by Troubadour 25 june 2003 --
-- 0.1a   -Updated botdescription en version announcement by Troubadour 24 june 2003 --
-- 0.1    -Brutus anti badclients by Troubadour 22 june 2003 --

------------Thanks--------------------------------------------------------------------
--(NL)(DSL)MrBuitenhuizenJunior for the help during the tests
--[NL]Xantia for watching our hub, during script-writing and for some ideas
--Ptaczek for the scripting info in the ptokax \doc directorie
--Nathanos and Guibs for the random announcement idea in channelbot (awesome)
--Plop (saved dcgui from the banlist)
--------------------------------------------------------------------------------------


Bot ="Brutus"
Version ="Brutus 4.6"
Creators ="[NL]-=DJ_Bert=-" --remember its who the oginal writer was ;)

sHubName = frmHub:GetHubName()
sHubDesc = frmHub:GetHubDescr()
sRedirect = frmHub:GetRedirectAddress()
sMaxUsers = frmHub:GetMaxUsers()
sMinShare = frmHub:GetMinShare()/(1024)

badclient = { "mldonkey", "mldc", "replika", "pepek", "netwerk", "MLDonkey" } 
awayArray={} 

file_login = "brutus/oplogfile.txt"
file_logout = "brutus/oplogfile.txt"
TimeSpanInMinutes = 60				  --> sets Hubstats time in minutes
DCGUIMINVERSION = 2
DCGUIMINVERSION2 = 12
WAYTOMUCHSLOTS = 25

function Main() 
	SendToAll(Version.." Started"..date(" the %d/%m-%Y at %X ").."  <---)")
	SendToAll(BotInfo)
	Bot = frmHub:GetHubBot()
	BotInfo = "$MyINFO $ALL "..Bot.." <++V:4.5 Brutus,?+?:Troubadour and [NL]-=DJ_Bert=-> $ $Limbo speed"..strchar(1).."$Brustus@djbert.org$" 
	ScriptRestart = {}
	frmHub:UnregBot(Bot)
	frmHub:RegBot(Bot)
	SendToAll(BotInfo)
	DoProfiles()
	SetTimer(TimeSpanInMinutes*60000) 
	StartTimer()
end 


function DoProfiles()
	AddProfile("REG", 2147500032)
	AddProfile("VIP", 2147975168)
	AddProfile("OP", 4269260800)
	AddProfile("MODERATOR", 4269273088)
	AddProfile("SUPERMODERATOR", 4294963200)
	AddProfile("NEWBIE-OP", 4096245760)
	AddProfile("Guest", 2148028000)
end



function OnTimer()
	SendAdMessage()
end 

function SendAdMessage()
	sCurrentShare = frmHub:GetCurrentShareAmount()/(1024^3)
	sUserCount = frmHub:GetUsersCount()
	upline = "============H=U=B==S=T=A=T=S=========="
	underline = "======================================="
	local tmp = clock() 
	local days, hours, minutes = floor(tmp/86400), floor(mod(tmp/3600, 24)), floor(mod(tmp/60, 60))
	hubstats = "\r\n\r\n"..upline.."\r\n"..
		 "      ?Script Version:    		 "..Version.."\r\n"..
		 "      ?Script Creator:	  	  	 "..Creators.."\r\n"..
		 "      ?Hub Name: 		    	 "..sHubName.."\r\n"..
		 "      ?Hub Description:   		 "..sHubDesc.."\r\n"..
		 "      ?Hub Adress:		   	 limbohub.no-ip.com \r\n"..
		 "      ?Owner:		 	 [NL]-=DJ_Bert=-".."\r\n"..
		 "      ?Current uptime is:		 "..days.." days "..hours.." hours and "..minutes.." minutes\r\n"..
		 "      ?Redirect Adress:   		 "..sRedirect.."\r\n"..
		 "      ?Maximum Users:  	 	 "..sMaxUsers.."\r\n"..
		 "      ?Total Users at this moment:   	 "..sUserCount.."\r\n"..
		 "      ?Minimum Share:   		 "..sMinShare.." GB".."\r\n"..
		 "      ?Total Share in the hub:   		 "..sCurrentShare.." in bytes".."\r\n"..
		 "      ?Hub Network:	 		 !network".."\r\n"..
		 "      ?Add this hub to your favorites: 	/fav in mainchat".."\r\n"..
		 "      ?Hub Rules:    			 !rules".."\r\n"..underline.."\r\n".." "
	SendToAll(Bot, hubstats)
end

function OpConnected(user)
	if (user.sName == "[NL]-=IRIS=-") then
		SendToAll(Bot, "[NL]-=IRIS=- has entered the hub. Look at the legs on that gorgieus lady!") 
	else
		SendToAll(Bot, RandomEntryMsg(user))
	end
end

function OpDisconnected(user)
	if (user.sName == "[NL]-=DJ_Bert=-") then
		SendToAll(Bot, "The hubowner [NL]-=DJ_Bert=- left tha house and will back soon to control you...") 
	else
		SendToAll(Bot, RandomExitMsg(user))
	end
end

function OpConnected(user)
	if (user.sName == "[NL]-=DJ_Bert=-") then
		SendToAll(Bot, "The hubowner [NL]-=DJ_Bert=- entered tha house and is gonna control this hub!") 
	else
		SendToAll(Bot, RandomEntryMsg(user))
	end
end


function OpDisconnected(user)
	if (user.sName == "[NL]-=IRIS=-") then 
		SendToAll(Bot, "[NL]-=IRIS=- is going to powder her nose, will she return?") 
	else
		SendToAll(Bot, RandomExitMsg(user))
	end
end

function UserDisconnected(user)
	if user.iProfile == 2 then
		SendToAll(Bot, RandomVIPMsgExit(user))
	end
end


function CheckIfDcguiHasTagEnabled(user)
	if strfind(user.sMyInfoString, "dc-gui", 1, 1) or strfind(user.sMyInfoString, "dc.ketelhot.de", 1, 1) or strfind(user.sMyInfoString, "DCGUI", 1, 1) then
		if not strfind(user.sMyInfoString, " Pls enable your dc tag, you are now being disconnected  |")
			user:Disconnect()
		end
	end
end

function VersionCheckDcgui(user)
	_,b, dcver = strfind(user.sMyInfoString,"V:0.(%x+).%x+")
	_,b, dcver2 = strfind(user.sMyInfoString,"V:0.%x+.(%d+)")
	user:SendData(" The oldest allowed version of Dcgui is 0."..DCGUIMINVERSION.."."..DCGUIMINVERSION2.." |")
	user:SendData(" You are using Dcgui version 0."..dcver.."."..dcver2.." |")
	if (tonumber(dcver2) < DCGUIMINVERSION2) or (tonumber(dcver) < DCGUIMINVERSION) then
		user:SendData(" You are using a to old client use at least version 0."..DCGUIMINVERSION.."."..DCGUIMINVERSION2.." |")
		user:SendData(" you are now being disconnected ... |")
		user:Disconnect()
	end
end

function CheckTheBandwidthDcGui(user, suppressionstate)
	s,e,dcpp = strfind(user.sMyInfoString, "%$")

	if dcpp ~= nil then
		s,e,bandwidth = strfind( dcpp, "L:(%d+%.%d+)")
		s,e,slots = strfind( dcpp, "S:(%d+)")

		if bandwidth == nil then
			s,e,bandwidth = strfind( dcpp "L:(%d+)")
		end

		if bandwidth == nil then
			bandwidth = "unlimited"
		else
			bandwidth = bandwidth * slots -- the tag shows the speed per slot
		end
		minBandwidth = MinbandwithlimiterChecker(user)--- use this 1 if you have different settings for different connection types
		--minBandwidth =  -- uncomments this line and place the comment on the above line if you use a single setting for all connection types
		if suppressionstate == "off" then
			user:SendData(" The minimum amount of upload bandwidth in k/s required for your class is set to: "..minBandwidth.." |")
			user:SendData(" You currently are sharing with a maximum k/s upload restriction of: "..bandwidth.." |")
			if bandwidth ~= "unlimited" then
				if (tonumber(bandwidth) < minBandwidth) then
					user:SendData(" You do not meet the minimum upload bandwidth required, and are being disconnected ... |")
               				user:Disconnect()
				end
			end
		elseif suppressionstate == "on" then
			if bandwidth ~= "unlimited" then
				if (tonumber(bandwidth) < minBandwidth) then
					user:SendData(" You no longer meet the minimum upload bandwidth required, and are being disconnected ... |")
					user:Disconnect()
				end
			end
		end
	end
end
Resistance is futile!

pHaTTy

function CheckTheSlotsDcGui(user, suppressionstate)
	s,e,dcpp = strfind(user.sMyInfoString, "%$")
	minSlots = SSBDefinitions(user, "slot")   --- use this 1 if you have different settings for different connection types
 	--minSlots = 2 -- uncomments this line and place the comment on the above line if you use a single setting for all connection types
	if dcpp ~= nil then
		s,e,slots = strfind( dcpp, "S:(%d+)")
    		maxSlots = MaxSlotChecker(user)  --- use this 1 if you have different settings for different connection types
    		--maxSlots =  -- uncomments this line and place the comment on the above line if you use a single setting for all connection types
   		if slots == nil or slots == 0 then
        		 user:SendData(" Don't use unlimited slots, your connection isn't unlimited either. use a preset number ... |")
        		 user:SendData(" you are now being disconnected ... |")
        		 user:Disconnect()
		end
		if suppressionstate == "off" then
			user:SendData(" The minimum number of open slots required for your class is set to: "..minSlots.." |")
			user:SendData(" The maximum number of open slots required for your class is set to: "..maxSlots.." |")
			user:SendData(" You currently have "..slots.." open slot(s). |")
			if (tonumber(slots) < minSlots) then
				user:SendData(" You do not meet the slot minimum, and are being disconnected ... |")
				user:Disconnect()
			elseif (tonumber(slots) > maxSlots) then
				if WAYTOMUCHSLOTS ~= 0 then
					if (tonumber(slots)) > WAYTOMUCHSLOTS then
						user:SendData(" You opened so much slots that your not getting a kick  |")
						user:SendData(" you are now being banned ... |")
						user:Ban()
					end
				end
				user:SendData(" You do not meet the slot maximum, and are being disconnected ... |")
				user:Disconnect()
				return
			end
		elseif suppressionstate == "on" then
			if (tonumber(slots) < minSlots) then
				user:SendData(" You no longer meet the slot minimum, and are being disconnected ... |")
				user:Disconnect()
			elseif (tonumber(slots) > maxSlots) then
				if WAYTOMUCHSLOTS ~= 0 then
					if (tonumber(slots)) > WAYTOMUCHSLOTS then
						user:SendData(" You opened so much slots that you whill not get a kick  |")
						user:SendData(" you are now being banned ... |")
						user:Ban()
					end
				end
				user:SendData(" You no longer meet the slot maximum, and are being disconnected ... |")
				user:Disconnect()
			end
		end
	end
end

function NewUserConnected(user)
	if user.iProfile == 2 then
		SendToAll(Bot, RandomVIPMsgConnect(user))
	elseif user.iProfile == nil then
		SendToNick(user.sName,Bot.."Welcome to the [NL]Holland Hub" )
	end
end
	
function RandomEntryMsg(user)
	local randomSeed = random(7)
	if randomSeed == 1 then
		return user.sName.." has entered the hub. Let the games begin.!"
	elseif randomSeed == 2 then
		return user.sName.." has entered the hub. Once again the mistery is solved.!"
	elseif randomSeed == 3 then
		return user.sName.." appears from a cloud of mist ..."
	elseif randomSeed == 4 then
		return "\r\n\r\n                \\ ~ ~ //\r\n                  ( 0-0 )\r\n----oOO-------(_)--------------------------\r\nI       "..user.sName.."      I\r\n     I           Is peeking at you	 I\r\n-------------------oOO----------------------\r\n               I__I__I\r\n                I I  I I\r\n           nooO Ooo"
	elseif randomSeed == 5 then
		return "Twirling his pea shooters ... "..user.sName.." rocks up and a says 'Howdy partners.'"
	elseif randomSeed == 6 then
		return "Please give him a big welcome! "..user.sName.." has entered the hub.!"
	elseif randomSeed == 7 then
		return "And you will know my name is "..user.sName..". Better behave or else.......!!!"
	end
end

function RandomVIPMsgConnect(user)
	local randomSeed = random(4)
	if randomSeed == 1 then
		return user.sName.." crawls through the door."
	elseif randomSeed == 2 then
		return "Walking down the stairs "..user.sName.." enters the hub!"
	elseif randomSeed == 3 then
		return user.sName.." is about to get the party started ..."
	elseif randomSeed == 4 then
		return user.sName.." is happy to be a member of this cool hub!"
	end
end

function RandomExitMsg(user)
	local randomSeed = random(7)
	if randomSeed == 1 then
		return user.sName.." snaps his fingers and disappears in a puff of smoke ..."
	elseif randomSeed == 2 then
		return user.sName.." simply disappears like a fart in the wind ..."
	elseif randomSeed == 3 then
		return user.sName.." hops on his Harley and rides off into the sunset ..."
	elseif randomSeed == 4 then
		return user.sName.." stumbles off yelling ... I'll be back!'"
	elseif randomSeed == 5 then
		return "'oh mama!', says "..user.sName.." and suddenly disappears out off sight ..."
	elseif randomSeed == 6 then
		return user.sName.." does his david copperfield imitation and is vanished!'"
	elseif randomSeed == 7 then
		return user.sName.." has left the hub, and is taking his absurdly huge share with him."
	end
end

function RandomVIPMsgExit(user)
	local randomSeed = random(3)
	if randomSeed == 1 then
		return user.sName..", has left the hub and took all his available sluts........eh slots with him!"
	elseif randomSeed == 2 then
		return "Walking down the red carpet, "..user.sName.." struts out the building."
	elseif randomSeed == 3 then
		return user.sName.." has left the hub, and he's gonna be stinking drunk when he comes back."
	end
end

function SendOprules(user) 
	readfrom("txt/oprules.txt") 
	DoRead(user)
end

function SendLol(user) 
	readfrom("txt/lol.txt") 
	DoRead(user)
end

function SendFaq(user) 
	readfrom("txt/faq.txt") 
	DoRead(user)
end

function SendDescription(user) 
	readfrom("txt/description.txt") 
	DoRead(user)
end

function DoRead(user)
	while 1 do 
		line = read() 
		if line == nil then break end
			user:SendPM(Bot, line)
		end 
	readfrom() 
end


function DataArrival(user, data) 
	if( strsub(data, 1, 1) == "<" ) then 
		data=strsub(data,1,strlen(data)-1) 
		s,e,cmd,arg = strfind( data, "%b<>%s+(%S+)%s+(.*)" ) 
		if (arg==nil) then 
			s,e,cmd = strfind( data, "%b<>%s+(%S+)%s*" ) 
		end 
		for key,m in badclient do 
			if strfind(user.sMyInfoString,m,1,1) then 
				user:Disconnect()
			end
		end
		
		if (cmd=="!away") then 
			if (not (arg)) then 
				arg = "<----- will return later again" 
			end
			SendToAll(Bot,date("User "..user.sName.." Is Away From The Hub %T Reason: ...")..arg.." ;)") 
			awayArray[user.sName]=arg 
		
		elseif (cmd=="!back") then 
			if (awayArray[user.sName]==nil) then 
			else 
				SendToAll(Bot,date("User "..user.sName.." is back to the hub! %T!")) 
				awayArray[user.sName]=nil 
			end
			if(awayArray[user.sName]) then
				SendToAll(Bot,date("User "..user.sName.." is back to the hub! %T!")) 
				awayArray[user.sName]=nil 
			end
		elseif (cmd=="!oprules") then 
			SendOprules(user) 
		elseif (cmd=="!lol") then 
			SendLol(user) 
		elseif (cmd=="!faq") then 
			SendFaq(user) 
		elseif (cmd=="!description") then 
			SendDescription(user) 
		end
	end 
end

if you need help, you can find me always ;)

just ask....

l8rr,,

enjoy...

-phatty ;)
Resistance is futile!

plop

check the thread about the dcgui functions.
the old 1 you use kicks dcgui 0.3.x for being 2 old.
updated version is posted in that thread.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

DJ Bert

Thnx pH?tt?
I will fixs Brutus this week and Brutus become some more fuctions.  ;)

Grzzt Bert

DJ Bert

#6
Hi all,

New updated Brutus 4.6
Thnx to Phatty for fixing script for TD 4.  :)

Added Badfilecheck today

Brutus 4.6 for TD 3

Brutus 4.6 for TD 4


Greetzzz DJ Bert

turkiye

#7
QuoteOriginally posted by DJ Bert
Hi all,

New updated Brutus 4.6
Thnx to Phatty for fixing script for TD 4.  :)

Added Badfilecheck today

Brutus 4.6 for TD 3

Brutus 4.6 for TD 4


Greetzzz DJ Bert

The Link Is DEAD!!!

DJ Bert

The links are fixed  :)

Cyberia

#9
Yep, works fine now  :D

pHaTTy

Ok

You have

if user.sName == "whaterr" then


change this to

if user.sName == HubOwner then

and for the look at those legs change to

if user.sName == OpLady then

for the welcome lines

SendToAll(Bot,"Look ate those legs on "..OpLady.." etc etc"

the same for Hub owner and at the top near ther variables etc etc

Add

HubOwner = "whoever"
OpLady = "Whever"


it will make it much easier for ppl using your scripts,

have phun,

l8rr,,

-phatty
Resistance is futile!

DJ Bert

Hi all,

Just a little update in Brutus for TD 4  ;)
Thnx Phatty's idea for this little update  :)
Brutus 4.65 TD 4

Greetzzz DJ Bert

Troubadour

Well done, keep up the good work.

-Troubadour-
Regards,

Troubadour

** Guardian Forum **

hubaddy:   nederfun.no-ip.com

DJ Bert

Updated version for Ptokax TD 4

Brutus 4.7

-- 4.7    -added brutus.cfg (configuration file to change the script to your needs)--
-- 4.7    -added fakeshare check (gives pm to OPS if found)--
-- 4.7    -fixed and updated badshare check --

DJ Bert

DJ Bert

A little error in brutus (Syntax Error: attempt to index global `userKicks' (a nil value)
will be fixed in Brutus 4.8. Also adding !hideme and unhidme. Updating configfile.
Brutus release 4.8 is aviable at sunday.

DJ Bert :]

DJ Bert

Version 4.8 is now aviable
Also working with Ptokax 0.330 and Ptokax TD 4
You can download it -=HERE=-

DJ Bert

DJ Bert

-- 4.9     -added more lines to the cfg file (containing all txt in script)--
-- 4.9    -fixed some fixed some line cfg display errors--

-=Download Brutus 4.9=-
 
Grtzzz DJ Bert :)

MrBuitenhuizenJunior

Hello,

I don't see any errors caused by this script.
Nice one! :)

[NL]MrBuitenhuizen

DJ Bert

-- 5.0    -added checking 28.8K 33.6K 56K and ISDN en disconnect users with it--
-- 5.0    -updated badfiles--

-=DOWNLOAD=-


blackwings

could you make so that brutus only sends the hub stat to the hub that it using it, because if you have a multihub chat, all hubs will see the hubstat and some of them are complaining about it.


DJ Bert

All links of Brutus are fixed and working :D

Grtzz DJ Bert

DJ Bert

Old Brutus Versions.

All old Brutus versions are deleted from http://www.djbert.org. Only the follow versions are online for download.

-= Brutus 4.9 =-

-= Brutus 5.0 =-

Greetzzz DJ Bert

SMF spam blocked by CleanTalk