Please need warrning share bot!!! - Page 3
 

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

Please need warrning share bot!!!

Started by juda, 10 August, 2004, 15:09:41

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

((UKSN))shad_dow

Dear Herodes

Well u done it again , the scripts getting better and better :)

:D keeping Ptokax alive and Kicking Ass

yours

shad
creator of Therapy-X? bot

NightLitch

Progress is going fine I see, any idea I post my new build version ?? It will be easy to build on with other functions for users now.

/NL
//NL

NightLitch

Here's my new version give it a try and tell me what u think...

---------------------------------------------------------------------
-- Share Warn // By: NightLitch
-- Version: 0.1
-- Credits:
--	 Kepp and Wombat for the ShareUnit func.
---------------------------------------------------------------------
KB = 1024
MB = KB*KB
GB = KB*KB*KB
TB = KB*KB*KB*KB
Sec  = 1000
Min  = 60*Sec
Hour = 60*Min
---------------------------------------------------------------------
-- Editable Data --
---------------------------------------------------------------------
-- Set Botname
BotName = "-Share-Warn-"
---------------------------------------------------------------------
-- Set NoShare Disconnection Time ( Hour, Min, Sec )
NoShareTime = { 1 , 30 , 0  }
-- Set Amount of Warnings before Disconnected
NoShareCounts = 3
---------------------------------------------------------------------
-- Set MinShare
NoMinShare = 500
-- Set Unit  ( MB, GB, TB )
NoMinUnit = MB
---------------------------------------------------------------------
-- Main Code Start Here, Don't Change anything
---------------------------------------------------------------------
NoShare = {}
UnitTable = {[MB] = "MB",[GB] = "GB",[TB] = "TB"}

function Main()
	frmHub:RegBot(BotName)
	SetTimer(1*Sec)
	StartTimer()
end

function OnTimer()
	for nick,table in NoShare do
		NoShare[nick][2] = NoShare[nick][2] + 1
		if NoShare[nick][2] == NoShareTime[1] * 60 * 60 + NoShareTime[2] * 60 + NoShareTime[3] then
			NoShare[nick][3] = NoShare[nick][3] + 1
			if NoShare[nick][3] > NoShareCounts then curUser = GetItemByName(nick)
				if curUser then 
					local s,e,curShare = strfind(curUser.sMyInfoString, "(%d+)%$%|$")
					if curShare then 
						if tonumber(curShare) == 0 then
							SendPmToNick(curUser.sName, BotName, " You still share "..DoShareUnits(curShare))
							SendPmToNick(curUser.sName, BotName, " You will be Disconnected...")
		 					NoShare[curUser.sName] = nil
							DisconnectByName(curUser.sName)
						elseif tonumber(curShare) - tonumber(NoShare[nick][1]) <= NoMinShare * NoMinUnit then
							SendPmToNick(curUser.sName, BotName, " You still share "..DoShareUnits(curShare))
							SendPmToNick(curUser.sName, BotName, " You will be Disconnected...")
		 					NoShare[curUser.sName] = nil
							DisconnectByName(curUser.sName)
						end
					end
				end
			else
				SendPmToNick(nick, BotName, " This is your "..NoShare[nick][3].." warning increase your share with "..NoMinShare.." "..UnitTable[NoMinUnit])
				NoShare[nick] = {NoShare[nick][1], 0,NoShare[nick][3]}
				SendToAll(NoShare[nick][3])
			end
		end
	end
end

function DataArrival(sUser,sData)
	if strsub(sData, 1,7) == "$MyINFO" then
		local s,e,sShare = strfind(sData, "(%d+)%$%|$")
		NoShare[sUser.sName] = {sShare, 0,0}
		if tonumber(sShare) == 0 then 
			NoShare[sUser.sName] = {sShare, 0,0}
			SendPmToNick(sUser.sName, BotName,"\t -------==[ NOTICE !! ]===================================================-------")
			SendPmToNick(sUser.sName, BotName,"\t You're welcome to stay in this hub, BUT you need to fill your Share with "..NoMinShare.." "..UnitTable[NoMinUnit].." within "..TimeCalc(NoShareTime[1] * 60 * 60 + NoShareTime[2] * 60 + NoShareTime[3]).." to stay!")
			SendPmToNick(sUser.sName, BotName,"\t -------===============================================================-------\r\n\r\n")
		end
	end
end

function TimeCalc(SC)
	local Hours = floor(mod(SC/3600,24))
	local Mins = floor(mod(SC/60,60))
	local Secs = floor(mod(SC/1,60))
	return  Hours.." Hours, "..Mins.." Minutes and "..Secs.." Seconds"
end

function DoShareUnits(intSize)
	if tonumber(intSize) ~= 0 then
		local tUnits = { "Bytes", "KB", "MB", "GB", "TB" }
		intSize = tonumber(intSize);
		local sUnits;
		for index = 1, getn(tUnits) do
			if(intSize < 1024) then
				sUnits = tUnits[index];
				break;
			else 
				intSize = intSize / 1024;
			end
		end
		return format("%0.1f %s",intSize, sUnits);
	else 
		return "nothing"
	end
end

Not as many features as Herodes but I can input some requests if u tell me what is absolutelly needed...

Cheers / NL
//NL

Herodes

#53
"grrr Nightlitch tries to make a more clean code than mine" Lol  
Nice going Nl ... happy to see u are not off this thread :))

I grabbed and off to test it :)

NightLitch

QuoteOriginally posted by Herodes
"grrr Nightlitch tries to make a more clean code than mine" Lol  
Nice going Nl ... happy to see u are not off this thread :))

I grabbed and off to test it :)

Nice, maybe u get some ideas then.. heh...

I think that one is Rather Ok, if not tell me whats wrong...

/NL
//NL

Herodes

Nightlitch you are on my teachers-list already ;)
thanks for all the work u have done till now ...

Nthing wrong to report :)

QuikThinker

I NEED this script does it work alongside RoboCop's reggin system?

Herodes

QuoteOriginally posted by QuikThinker
I NEED this script does it work alongside RoboCop's reggin system?
how do you mean ? (btw I havent tested beside any major bots .. )

stinger

Hi there...

               

--- Version 5 Changes ---
--- added the ability to make custom limits for a user.
--- --- available limits are time allowed / number of warnings / share to reach / action to happen
--- Use the appropriate command ( ' CusCmd ' variable ) to set them
--- Added the display of custom limited users in the ' !noshare ' cmd ( ' TheCmd ' variable )
--- ( Last Update 14/8 - 2004 )

Grab It from here <<<----------

link didn't work

Herodes

Yep ... I know ... the site is down at the moment ... I'll see if I can find somewhere to post it ... atm it doesnt fit in a single post ... and I hate posting multiple posts for 1 script ...

Herodes

[*Note*] The link now works ...

jiten

where can I find the link to version 5, Herodes?

Herodes

There is a link up this thread ..

But you can also Grab It from here

SMF spam blocked by CleanTalk