Cleaner?
 

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

Cleaner?

Started by patamon90, 29 December, 2004, 12:21:50

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

patamon90

Hello

I want a script (or bot =P) to "clean" hub main like.. once every 2 hour, or something.. like this (example):
Quote*start*

bla bla bla I have very phun =)
the user user has been kicked because: fake client
me wanna get kicked =P
the user user2 has been kicked because: he wanted to =)











the user kotchi has been kicked because: this is just an example =)

*end*
Thanks if there is any script like that =P

BoJlk

#1
here you go script by by yepyepyep4711 and Hawk
but it's not with a timer. it's on demand script.

--ScreenCleaner.lua 1.1 by yepyepyep4711 and Hawk
--!cls will wipe the main chat clean for all users in the hub
--the command will be added to the rightclick menu of the OPs (optional)

botname = "ScreenCleaner"
rightclick = 1 -- if anything else than 1 rightclick menu won't appear
function DataArrival (curUser, sData)
command=strsub(sData,1,strlen(sData)-1)
s,e,cmd = strfind(command,"%b<>%s+(%S+)")
	if curUser.bOperator then
		if cmd=="!cls" then
			temp = "\r\n"
			for i=1,200,1 do
				temp = temp.."\r\n"
			end 
			SendToAll(botname, temp)
		end
	end
end

function OpConnected(curUser)
	if rightclick == 1 then
		curUser:SendData("$UserCommand 255 7") 
		curUser:SendData("$UserCommand 0 3") 
		curUser:SendData("$UserCommand 1 2 Clear Screen$<%[mynick]> !cls|") 
	end
end
/edit
one problem with this, i mainly used it for cleaning the Main chat when typed by mistake somehting i shouldn't...but the users can scroll back and see what was wyped. :(

bastya_elvtars

this cannot be avoided.
Everything could have been anything else and it would have just as much meaning.

BoJlk

#3
Yep  :D

I know that the DC++ Client has a amount of MainChat cashe...
Maybe it can somehow be played with?

/edit
Enjoy the Script patamon90  :D

patamon90

okay thanks.. but I really need one with a timer =P  I'm almost never on my computer.. and then the hub will get full of crap =P thanks for the script anyway.

BoJlk

try PM to yepyepyep4711 and Hawk.
Maybe they'll help you.

enema

here u go:
--ScreenCleaner.lua 1.1 by yepyepyep4711 and Hawk
--!cls will wipe the main chat clean for all users in the hub
--the command will be added to the rightclick menu of the OPs (optional)
-- Timer and much larger space added by enema

min = 60000
hour = 60000*60

function Main() 
	SetTimer(hour*2)
	StartTimer()
end

botname = "ScreenCleaner"
rightclick = 1 -- if anything else than 1 rightclick menu won't appear
function DataArrival (curUser, sData)
command=strsub(sData,1,strlen(sData)-1)
s,e,cmd = strfind(command,"%b<>%s+(%S+)")
	if curUser.bOperator then
		if cmd=="!cls" then
			temp = "\r\n"
			for i=1,5000,1 do
				temp = temp.."\r\n"
			end 
			SendToAll(botname, temp)
		end
	end
end

function OnTimer()
	temp = "\r\n"
		for i=1,5000,1 do
		temp = temp.."\r\n"
		end 
	SendToAll(botname, temp)
end
	

function OpConnected(curUser)
	if rightclick == 1 then
		curUser:SendData("$UserCommand 255 7") 
		curUser:SendData("$UserCommand 0 3") 
		curUser:SendData("$UserCommand 1 2 Clear Screen$<%[mynick]> !cls|") 
	end
end

Herodes

did some minor changes ...
--ScreenCleaner.lua 1.1 by yepyepyep4711 and Hawk
--!cls will wipe the main chat clean for all users in the hub
--the command will be added to the rightclick menu of the OPs (optional)
-- Timer and much larger space added by enema
--- shortened a bit: Herodes..

botname = "ScreenCleaner" --- SendThe Clearing text as who ?
rightclick = 1 			-- if anything else than 1 rightclick menu won't appear
interval = (1/2)			--- every how many hours to clear ?

function Main() 
	SetTimer(interval * ((60^2)*1000))
	StartTimer()
end

function DataArrival (curUser, sData)
	command=strsub(sData,1,strlen(sData)-1)
	s,e,cmd = strfind(command,"%b<>%s+(%S+)")
	if ( (curUser.bOperator) and (cmd == "!cls") ) then
		Clear()
	end
end

function OnTimer()
	Clear()
end

function Clear()
	SendToAll(botname, strrep("\r\n", 5000))
end

function OpConnected(curUser)
	if (rightclick == 1) then
		curUser:SendData("$UserCommand 255 7|") 
		curUser:SendData("$UserCommand 0 3|") 
		curUser:SendData("$UserCommand 1 2 Clear Screen$<%[mynick]> !cls|") 
	end
end
NOTE : This result can be also achieved by keeping Ctrl+M in the mainchat prompt for some seconds and hitting enter ...

patamon90

#8
okay, thanks all. but just a little question left =P

Shoudl I change this to

interval = (2)

from

interval = (1/2)

?

and the rightclick menu doesn't seem to appear when I connect to the hub (the owner). But that's maybe just cos I have Brain-Master's rightclick menu..

enema

QuoteOriginally posted by patamon90
okay, thanks all. but just a little question left =P

Shoudl I change this to

interval = (2)

from

interval = (1/2)

?

and the rightclick menu doesn't seem to appear when I connect to the hub (the owner). But that's maybe just cos I have Brain-Master's rightclick menu..

If you want the chat to be cleard every 1 hour, leave 1 there... if every 2 hours, leave 2...

For right click comands, hub must be restarted before they take effect... did you restarted it?

Herodes

QuoteOriginally posted by patamon90
okay, thanks all. but just a little question left =P

Shoudl I change this to

interval = (2)

from

interval = (1/2)

?

and the rightclick menu doesn't seem to appear when I connect to the hub (the owner). But that's maybe just cos I have Brain-Master's rightclick menu..
1/2 = 0.5 ( half an hour .. )
1/4 = 1.25 ( a quarter of an hour ...)
4 = 4 hours ...

it goes like that ...

patamon90

No. I did just restart the scripts =P
But thanks anyway.

SMF spam blocked by CleanTalk