NEED BOT WHO KICK TWISTING USERS
 

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

NEED BOT WHO KICK TWISTING USERS

Started by Marco52, 22 September, 2004, 20:50:39

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Marco52

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.

Herodes

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 ..

Marco52

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. ;)

nErBoS

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
--## nErBoS Spot ##--

tezlo

function OnTimer()
tUsers = {}
end

Herodes

#5
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

Marco52

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

Herodes

yeah I just tested and made some small edits ... it works as expected ...

[*note*] last post by me with code edited

SMF spam blocked by CleanTalk