PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: Pedro on 29 February, 2004, 17:24:33

Title: script yo message T1 and T3
Post by: Pedro on 29 February, 2004, 17:24:33
Hi, I am looking for a script that will mass message only users with T1 and T3 connestions only..

I hope this is possible, knowing you guys anything is possible..


HAPPY DAYS
Title:
Post by: nErBoS on 29 February, 2004, 18:26:53
Hi,

Hope it helps..

--Requested by Pedro
--Made by nErBoS

Bot = "PMer-LAN"

function Main()
frmHub:RegBot(Bot)
end

function DataArrival(user, data)
if (strsub(data,1,1)=="<") or (strsub(data,1,5+strlen(Bot))=="$To: "..Bot) then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd=="!mmlan") then
local s,e,msg = strfind(data,"%b<>%s+%S+%s+(.*)")
if (msg ~= nil) then
if (user.sMyInfoString ~= nil) then
local s,e,speed = strfind(user.sMyInfoString, "$MyINFO $ALL [^$]+$ $([^$]*)$[^$]*$[^$]+")
if (speed ~= nil) then
speed = strsub(speed,1,strlen(speed)-1)
if( speed == "LAN(T1)" or speed == "LAN(T3)") then
SendPmToAll(Bot, msg)
user:SendPM(Bot, "Mensege sent.")
else
end
else
end
else
end
else
user:SendPM(Bot "Sytanx error, !mmlan .")
end
return 1
end
end
end

Best regards, nErBoS
Title:
Post by: tezlo on 29 February, 2004, 18:54:24
that will allow only people on T1/T3 to mass message everyone
speeders = {}

function NewUserConnected(user)
if strfind(user.sMyInfoString, "^%$MyINFO %$ALL %S+ .-%$ %$LAN%(T[13]%).%$") then
speeders[user.sName] = 1
end
end

function UserDisconnected(user)
speeders[user.sName] = nil
end

OpConnected = NewUserConnected
OpDisconnected = UserDisconnected

function DataArrival(user, data)
if user.bOperator and strsub(data, 1, 1) == "<" then
local s, e, msg = strfind(data, "^%b<> %!mms (.+)%|$")
if s then
msg = " "..msg
for nick, tmp in speeders do
SendToNick(nick, msg)
end
end
end
end

!mms

note.. only sends to users who have entered the hub _after script restart
Title:
Post by: nErBoS on 29 February, 2004, 19:00:01
Hi,

I made a bad read on the request, thanks tezlo :)

Best regards, nErBoS
Title:
Post by: Pedro on 01 March, 2004, 03:00:14
Thanx tezlo, it was the script from nerbos I needed, I needed script so I could pm T1 and T3 users..


Thanx nerbos m8, will let you know if it works ok...
Title:
Post by: nErBoS on 01 March, 2004, 14:47:22
Hi,

My script is wrong because it only allows people with T1 and T3 to send a mass message to everybody, the rigth script it's from tezlo that send a mass message to all users with T1 and T3.

Best regards, nErBoS
Title:
Post by: Pedro on 01 March, 2004, 17:47:14
I stand corrected.

I would like to thank you both for your time and effort to help us lesser beings with our scripts.

HAPPY DAYS