Ban triggers txt file
 

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 triggers txt file

Started by yoonohoo, 02 June, 2005, 02:22:07

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

yoonohoo

I would like to have a script which would trigger a text file (ascii) every time some1 gets banned or kicked.
Is this possible?

Thanks

It might be simple for you but rocket science for me...

Dessamator

#1
-- By Dessamator
-- AScii kicker v1 

asciifile ="ascii.txt"
bot =frmHub:GetHubBotName()

Main = function (user,data)
local file = io.open(asciifile)
	if not(file)  then
		io.output(asciifile)
		io.close()
		io.output()
	end
	
end

function ChatArrival(user,data)
data=string.sub(data,1,-2)
local s,e,cmd,victim =string.find(data,"%b<>%s+(%S+)%s+(%S+)")
local s,e,reason =string.find(data,"%b<>%s+%S+%s+%S+%s+(%S+)")
	if user.bOperator then
	usr =GetItemByName(victim)
		if not(reason) then
			reason=".."
		end
		if usr and victim then
			if cmd=="!kick" then 
				user:SendData(bot,victim.." has been kicked! ")
				usr:SendData(bot,"You have been kicked because: "..reason)
				SendToAll(sendascii())
				usr:TempBan()	
				return 1	
			elseif cmd == "!ban"	then
				user:SendData(bot,victim.." has been Banned! ")
				usr:SendData(bot,"You Have Been Banned because: "..reason)
				SendToAll(sendascii())
				usr:Ban()
				return 1
			end
		elseif usr==nil and victim then
			user:SendPM(bot,victim.." is not online !! ")
			
		end
	end
temp=nil
end

function ToArrival(user,data)
	if string.sub(data,6,5+(string.len(bot))) == bot then
		ChatArrival(user,data)
	return 1
	end
end

--Send Ascii
function sendascii()
local temp = ""
	for line in io.lines(asciifile) do
		temp=temp..line.."\r\n"
	end

	return temp
	
end

KickArrival= function(User, Data)	
	SendToAll(sendascii())
	temp=nil
end


Done !
Ignorance is Bliss.

yoonohoo

Thanks Dessamator

Trying it now :)

It might be simple for you but rocket science for me...

yoonohoo

#3
Getting this error:
92: attempt to concatenate local `victim' (a nil value)

It does ban the user but no txt show.
Kick cmd doesn't do anything...removed script kick cmd does his job.

Testing on 17.09 with only this script.

It might be simple for you but rocket science for me...

Dessamator

#4
QuoteOriginally posted by yoonohoo
Getting this error:
92: attempt to concatenate local `victim' (a nil value)

It does ban the user but no txt show.
Kick cmd doesn't do anything...removed script kick cmd does his job.

Testing on 17.09 with only this script.

fixed, post edited , btw the script creates a file--> ascii.txt, & u have to paste  ur ascii there !
Ignorance is Bliss.

yoonohoo

#5
Getting there...
Both cmd working but:
Main chat log = user is not online
This happens to passive and active users
The txt still hasn't show up.
Quotebtw the script creates a file--> ascii.txt, & u have to paste ur ascii there !
Done that!

Thanks

OK...Written Cmd worked and show txt, is the rightclick "Kick user" that doesn't show the txt

It might be simple for you but rocket science for me...

Dessamator

#6
do u mean the built in right click of dc??

if thats what u mean, then its done, post edited, ;)
Ignorance is Bliss.

yoonohoo

#7
Quotedo u mean the built in right click of dc??
Yes it was. Thanks

Before user is not online
Now   kicking is not online or is is not online
This appears in the mainchat of the cmd user when using right click.

Another request, if I may: How can I enter the user name being kicked in the ascii file?

It might be simple for you but rocket science for me...

Dessamator

hmm ill check it out
Ignorance is Bliss.

yoonohoo


It might be simple for you but rocket science for me...

Dessamator

done, post edited!
Ignorance is Bliss.

yoonohoo

Quotedone, post edited!
This doesn't include user name being kicked in the ascii file or does it?

Rightclick OK
Log OK
Cmd !kick appears in mc --> !kick yoonohoo
Cmd !ban appears in pm --> Error: Can't ban test - user is not online

Apreciate ur help m8

It might be simple for you but rocket science for me...

Dessamator

QuoteOriginally posted by yoonohoo
 This doesn't include user name being kicked in the ascii file or does it?
nop

QuoteRightclick OK
Log OK
goody


QuoteCmd !kick appears in mc --> !kick yoonohoo
Cmd !ban appears in pm --> Error: Can't ban test - user is not online
done

QuoteApreciate ur help m8
ur welcome
Ignorance is Bliss.

SMF spam blocked by CleanTalk