PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: Woodster on 11 February, 2004, 19:33:04

Title: Request for a small script
Post by: Woodster on 11 February, 2004, 19:33:04
I wonder if anyone can help me!

I was looking for a little script that with a command like

!pm2opchat

would send a pm to opchat from the bot! i need it to act as a raw command for a faker bot i have got!

If that is not possible could it send a pm to all ops

!pm2ops       for example

Regards

Woodster
Title:
Post by: nErBoS on 11 February, 2004, 22:33:55
Hi,

You want the AntiFake-BOT to send pms to OP-Chat ?? Why do you want the command for ???

Best regards, nErBoS
Title:
Post by: kepp on 11 February, 2004, 22:43:46
Or you use this so you save yourself some hassle

SendPmToOps(Bot, "What you want in here")
Title:
Post by: Woodster on 12 February, 2004, 18:46:14
I am using DC++k as a FakerB0t

I want a simple little script that i can use for the RAW commands in DC++k that reports the faker to Ops in PM (as though it is a mass message but for ops only)

So in the RAW command i type into DC++k is:

!pm2ops **REPORT** %[nick] is Faking - Please Kick Out of Hub

Thanx Woodster
Title:
Post by: NightLitch on 12 February, 2004, 20:52:22
here you go:

-- PM 2 OPS / request by: Woodster
-- By: NightLitch 2004
BotName = "Pm2ops"
Command = "!pm2ops"

function Main()
frmHub:RegBot(BotName)
end
function DataArrival(user, data) --remove from here
if (strsub(data, 1, 1) == "<" ) then
data=strsub(data,1,strlen(data)-1)
local _,_,cmd=strfind(data, "%b<>%s+(%S+)")
if not cmd then cmd = "0" end
cmd = strlower(cmd)
if (cmd == Command) then
local _,_,Name =strfind(data, "%b<>%s+%S+%s+(%S+)")
if Name == nil or Name == "" then
user:SendData(BotName,"Usage: "..Command.." ")
return 1
end
local vUser = GetItemByName(Name)
if vUser == nil or vUser == "" then
user:SendData(BotName,"User not found.")
return 1
else
SendPmToOps(BotName, "**REPORT** "..vUser.sName.." is Faking - Please Kick Out of Hub")
return 1
end
end
end
end