Hi. I have small dc-hub. Some of my users enter and leave my hub many times a day. Is there any
bot who kick user who enter hub too many times? E.g BOT kick users who enter and leave more than
four times a day.
Thanks for any help.
TYPING ALL CAPS DOESNT DRAW ATTENTION !!!!!
IN TEXT BASED INTERNET COMMUNICATION IT IS TREATED AS SCREAMING !
so pls dont do that again because many many ppl have sensitive ears around here ... :)
--- disconnect Users
--- by Herodes
--- request by Marco52
maxTimes=4
tUsers = {}
function Main()
SetTimer(24*60*60*1000)
StartTimer()
end
function NewUserConnected(user)
if tUsers[user.sName] == nil then
tUsers[user.sName] = 1
elseif tUsers[user.sName] >= 1 then
tUsers[user.sName] = tUser[user.sName] + 1
elseif tUsers[user.sName] == maxTimes then
user:SendData("Disconnector", "You cant login more than "..maxtimes.." in this hub ..")
user:Disconnect()
end
end
I dont think that this is excatly what u need eventhough it does what u asked for exactly :)
.. but try it ..
Hi. Thanks for script but unfortunately it doesnt work :/
I tried to log in and logout to hub more than four times but Bot didnt kick me. I noticed that when I log to hub second time serwer showed a syntax error in script:
Syntax Error: attempt to index global `tUser' (a nil value)
Thanks. Maybe you will be able to correct it. ;)
Hi,
Fixed...
--- disconnect Users
--- by Herodes
--- request by Marco52
maxTimes=4
tUsers = {}
function Main()
SetTimer(24*60*60*1000)
StartTimer()
end
function NewUserConnected(user)
if tUsers[user.sName] == nil then
tUsers[user.sName] = 1
elseif tUsers[user.sName] >= 1 then
tUsers[user.sName] = tUsers[user.sName] + 1
elseif tUsers[user.sName] == maxTimes then
user:SendData("Disconnector", "You cant login more than "..maxtimes.." in this hub ..")
user:Disconnect()
end
end
Best regards, nErBoS
function OnTimer()
tUsers = {}
end
as tezlo has brilliantly observed--- disconnect Users
--- by Herodes
--- request by Marco52
maxTimes=4
tUsers = {}
function Main()
SetTimer(24*60*60*1000)
StartTimer()
end
function OnTimer()
tUsers = {}
end
function NewUserConnected(user)
if tUsers[user.sName] == nil then
tUsers[user.sName] = 1
elseif tUsers[user.sName] >= 1 and tUsers[user.sName] < maxTimes then
tUsers[user.sName] = tUsers[user.sName] + 1
elseif tUsers[user.sName] == maxTimes then
user:SendData("Disconnector", "You cant login more than "..maxTimes.." in this hub ..")
user:Disconnect()
end
end
Thanks for help but it still doesnt work :( Have you tried this script on your computer? I tried it several times but bot doesnt work... I have very poor knowledge about lua script language that's why if you want to help me .. please paste whole code in the forum.
Thanks for your help and still waiting for working BOT
Marco
yeah I just tested and made some small edits ... it works as expected ...
[*note*] last post by me with code edited