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+(%.*)")
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 :)
Umm, the order of the clientkick is fixed. You can probably use a coroutine.