BAN and KICK commands
 

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

BAN and KICK commands

Started by turkiye, 01 November, 2003, 13:56:31

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

turkiye

I Need BAN and KICK commands.
Where can I find it?

NightLitch

Maybe look in the hubsoft first...

!ban & !kick
//NL

pHaTTy

here you go ;)

--Quick Kick n Ban script by Phatty
--v1.00


Bot = "Conquerer"

KickCMD = "!kick"
BanCMD = "!ban"

function Main()
frmHub:RegBot(Bot)
end

function DataArrival(user,data)
	if strsub(data, 1, 1) == "<" then
		data=strsub(data,1,strlen(data)-1)
		s,e,cmd,arg = strfind(data,"%b<>%s+(%S+)")

		if cmd == KickCMD then
			nick = GetItemByName(arg)
			if arg == nil then
				user:SendData(Bot,"Please select a user in the list")
				return 1
			else
				SendToAll(Bot,user.sName.." is kicking: "..nick)
				nick:Disconnect()
				return 1
			end
		elseif cmd == BanCMD then
			nick = GetItemByName(arg)
			if arg == nil then
				user:SendData(Bot,"Please select a user in the list")
				return 1
			else
				SendToAll(Bot,user.sName.." is banning: "..nick)
				nick:Ban()
				return 1
			end
		end
	end
end

l8rr,,
Resistance is futile!

pHaTTy

almost forgot

--Quick Kick n Ban script by Phatty
--v1.00


Bot = "Conquerer"

KickCMD = "!kick"
BanCMD = "!ban"

function Main()
frmHub:RegBot(Bot)
end

function DataArrival(user,data)
	if strsub(data, 1, 1) == "<" then
		data=strsub(data,1,strlen(data)-1)
		s,e,cmd,arg = strfind(data,"%b<>%s+(%S+)")

		if cmd == KickCMD then
			nick = GetItemByName(arg)
			if arg == nil then
				user:SendData(Bot,"Please select a user in the list")
				return 1
			else
				SendToAll(Bot,user.sName.." is kicking: "..nick)
				nick:SendData(Bot,"You are being kicked")
				nick:Disconnect()
				return 1
			end
		elseif cmd == BanCMD then
			nick = GetItemByName(arg)
			if arg == nil then
				user:SendData(Bot,"Please select a user in the list")
				return 1
			else
				SendToAll(Bot,user.sName.." is banning: "..nick)
				nick:SendData(Bot,"You are being banned")
				nick:Ban()
				return 1
			end
		end
	end
end

bye,,
Resistance is futile!

[ES]latinmusic

Does anyone can test if this script are working?
I'm currently experimenting a lot of troubles with script that have this line: nick = GetItemByName(arg) or similar in it. This script are not wotking either :(
If someone wanna test it please use the following conditions:
odc++ 5.21 and ptokax last beta available.

tezlo

cant ever work.. the regexp is all wrong
here you go
function DataArrival(user, data)
	if not user.bOperator then return end
	if strsub(data, 1, 1) ~= "<" then return end
	local s, e, cmd, args = strfind(data, "^%b<> %!(%a+)%s*(.*)%|$")
	if not s then return end

	cmd = strlower(cmd)
	if cmd == "kick" then
		local s, e, who, why = strfind(args, "^(%S+)%s*(.*)$")
		if not s then user:SendData(">> syntax: !kick  [reason]") return 1 end
		local tmp = GetItemByName(who)
		if not tmp then user:SendData(">> "..who.." is not online") return 1 end
		if why == "" then why = "for no reason"	else why = "because "..why end
		SendToAll(" "..user.sName.." is kicking "..tmp.sName.." "..why)
		tmp:SendData(" You are being kicked by "..user.sName.." "..why)
		tmp:Disconnect()
	elseif cmd == "ban" then
		local s, e, who, why = strfind(args, "^(%S+)%s*(.*)$")
		if not s then user:SendData(">> syntax: !ban  [reason]") return 1 end
		local tmp = GetItemByName(who)
		if not tmp then user:SendData(">> "..who.." is not online") return 1 end
		if why == "" then why = "for no reason"	else why = "because "..why end
		SendToAll(" "..user.sName.." is kicking "..tmp.sName.." "..why)
		tmp:SendData(" You are being kicked by "..user.sName.." "..why)
		tmp:Disconnect()
	else return end
	return 1
end

[ES]latinmusic

You code too fast tezlo 8o
Can you also take a look into the following thread:
http://board.univ-angers.fr/thread.php?threadid=202&boardid=11&styleid=1&sid=89c7ad49ec49418a75d7ebf9820bee9c
Mainly in last 5 or 6 last post, there is some code inside the script who does not want to work at all, beetween all of you i think it can be fixed.

SMF spam blocked by CleanTalk