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
-- 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 !
Thanks Dessamator
Trying it now :)
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.
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 !
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
do u mean the built in right click of dc??
if thats what u mean, then its done, post edited, ;)
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?
hmm ill check it out
thanks m8
done, post edited!
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
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