[Request]Disconnect
 

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

[Request]Disconnect

Started by Krysalis, 12 June, 2005, 19:51:05

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Krysalis

Hello,
Im search a simple script which only disconnect the User without tempban & co.
cmd should be like +disc User Reason.
And would be nice if there are on/off Funktion for each Profile. ( based on Profile Nr.)

Ive searched the Forum, but dont find this. Anyone can do for me?


Krysalis

No one can do this?

Dessamator

yeah its so darn simple nobody bothers to do so, either way it already exists probably  !
Ignorance is Bliss.

jiten

#3
Give this a try:
-- Disconnect v1.0 by jiten (6/14/2005)
-- with: Immune Profiles/Allowed Profiles
-- based on Kick & Warn 1.0

sBot = frmHub:GetHubBotName() -- bot name

AllowedProfiles = {
	[-1] = 0, -- unreg
	[0] = 1, -- master
	[1] = 1, -- operator
	[2] = 0, -- vip
	[3] = 0, -- reg
	[4] = 1, -- moderator
	[5] = 1, -- founder
}

ImmuneProfiles = {
	[-1] = 0, -- unreg
	[0] = 1, -- master
	[1] = 0, -- operator
	[2] = 0, -- vip
	[3] = 0, -- reg
	[4] = 0, -- moderator
	[5] = 1, -- founder
}

function ChatArrival (user,data) 
	local data=string.sub(data,1,-2) 
	local s,e,cmd = string.find ( data, "%b<>%s+[%!%?%+%#](%S+)" )
	if cmd then
		local s,e,usr,reason = string.find( data, "%b<>%s+%S+%s+(%S+)%s*(.*)" )
		local tCmds = { 
		["disc"] =	function(user,data)
			if AllowedProfiles[user.iProfile] == 1 then
				if usr == nil or reason == nil then
					user:SendData(sBot, "*** Syntax Error: Type !disc  ")
				else
					local victim = GetItemByName(usr)
					if (victim == nil) then
						user:SendData(sBot, "*** Error: The user "..usr.." is not online.")
					else
						if ImmuneProfiles[victim.iProfile] ~= 1 then
							SendToOps(sBot, victim.sName.." is being disconnected by "..user.sName.." because: "..reason)
							victim:SendPM(sBot, "You are being disconnected because: "..reason) victim:Disconnect()
						else
							user:SendData(sBot,"*** Error: You can't disconnect Immune Profile Users.")
						end
					end
				end
			else
				user:SendData(sBot,"*** Error: You are not allowed to use this command.")
			end
		end,
		}
		if tCmds[cmd] then return tCmds[cmd](user,data), 1 end
	end
end

Best regards

Krysalis

#4
Thx Jiten for doing.  
Can you add a message in Main send to ops if someone be +disconnectet?
Perfect Work as always. Runs fine:)

Greets

jiten

QuoteOriginally posted by Krysalis
Thx Jiten for doing.  
Can you add a message in Main send to ops if someone be +disconnectet?
Perfect Work as always. Runs fine:)

Greets
First post updated with your request.

Best regards

Krysalis

Thanks for fast answer. Runs ;-)

Greets

SMF spam blocked by CleanTalk