Capturing kick reason from clientside kicks
 

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

Capturing kick reason from clientside kicks

Started by Mardeg, 05 November, 2006, 16:43:22

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mardeg

From Changelog - 0.3.5.2:
QuoteFixed: Missing kick message when op kick user from inbuild client kick.
Anyone done this successfully with the latest PtokaX?
My code from previous versions just looked like this:
function KickArrival(user, Data)
	_, _, kcom, knick = string.find(data,"(%S+)%s+(%S+)")
	if GetItemByName(knick) then
		local arg = GetItemByName(knick)
		if (not arg.bRegistered) then arg:TimeBan(20)
		elseif GetProfileName(arg.iProfile) == Reg then
			SendPmToNick(arg.sName, user.sName, "Client-based kick. Reason upcapturable")
		elseif arg.iProfile <= user.iProfile then
			SendPmToNick(user.sName,arg.sName, "Looks like that backfired on you. Only kick users with lower levels than yourself next time.")
			user:Disconnect()
			return 1
		end
		arg:Disconnect()
		return 1
	end

possibly as easy as changing one line? (no-one volunteered for testing):
_, _, kcom, knick, kreason = string.find(data,"(%S+)%s+(%S+)%s+(%.*)")

Herodes

You could always do :
--- Incoming string: $Kick SomeNick for being a very bad boy....|
--- the regular expression:
local nick, reason = (data:sub(1 , -2)):match("^%$Kick%s(%S+)%s(.*)$")
--- simplified...
local nick,reason = string.match( string.sub(data, 1, -2), "^%$Kick%s(%S+)%s(.*)$" )

I hope this gives you some hints :)

bastya_elvtars

Umm, the order of the clientkick is fixed. You can probably use a coroutine.
Everything could have been anything else and it would have just as much meaning.

SMF spam blocked by CleanTalk