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
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. :(
this cannot be avoided.
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
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.
try PM to yepyepyep4711 and Hawk.
Maybe they'll help you.
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
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 ...
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..
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?
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 ...
No. I did just restart the scripts =P
But thanks anyway.