PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: lynyrd on 05 March, 2004, 01:47:58

Title: anti-ad in description
Post by: lynyrd on 05 March, 2004, 01:47:58
hi,

sometimes users advertise via the description or email.
(i dont know if it's already done..but i searched my butt off..did'nt find any) so my idea is a script
that looks for example xxx or blabla.no-ip.com in their description
and disconnects that user at login..
i made a little part of it but dont know how to do it so it works
code:
------------------------------------------------------------------------
--just an example this is not working

description =  {["dns2go"]=1,["myftpsite"]=2,["xxx"]=3,["porn"]=4}

function NewUserConnected(user)
                if not user.bOperator then
                for key, value in D do
                if strfind(user.sMyInfoString, "$MyINFO $ALL " .. description .."%$) then
                user:SendData("you are advertising or have unwanted text in description/email remove ..word.. and reconnect")
                user:Disconnect()
                end
         end
  end
end
------------------------------------------------------------------------
crossing my fingers for help

lynyrd..instant noob just add lua ;)
Title:
Post by: NightLitch on 05 March, 2004, 02:21:57
try this one:

description = {["dns2go"]=1,["myftpsite"]=2,["xxx"]=3,["porn"]=4}

function NewUserConnected(user)
if not user.bOperator then
for key, value in D do
if strfind(user.sMyInfoString, "$MyINFO $ALL "..user.sName.." " .. description .."<") then
user:SendData("you are advertising or have unwanted text in description/email remove ..word.. and reconnect")
user:Disconnect()
end
end
end
end

Maybe work / NL
Title:
Post by: nErBoS on 05 March, 2004, 02:34:07
Hi,

Try this..

description = {"dns2go","myftpsite","xxx","porn"}

function NewUserConnected(user, data)
for i=1, getn(description) do
local s,e, desc = strfind(user.sMyInfoString, "$MyINFO $ALL%s+%S+%s+(.*)<")
if strfind(desc, description[i]) then
user:SendData("you are advertising or have unwanted text in description/email remove ..word.. and reconnect")
user:Disconnect()
end
end
end

Best regards, nErBoS
Title:
Post by: nErBoS on 05 March, 2004, 02:35:03
Posted at same time :P

Now you have two eg :)

Best regards, nErBoS
Title:
Post by: pHaTTy on 05 March, 2004, 02:35:18
QuoteOriginally posted by NightLitch
try this one:

description = {["dns2go"]=1,["myftpsite"]=2,["xxx"]=3,["porn"]=4}

function NewUserConnected(user)
if not user.bOperator then
for key, value in D do
if strfind(user.sMyInfoString, "$MyINFO $ALL "..user.sName.." " .. description .."<") then
user:SendData("you are advertising or have unwanted text in description/email remove ..word.. and reconnect")
user:Disconnect()
end
end
end
end

Maybe work / NL


errrm what is D? hmm m8 i thinku need some sleep lmao what is word?
Title:
Post by: pHaTTy on 05 March, 2004, 02:39:02
hmm u might as well check the full my info string


table = {
["dns2go"]=1,
["myftpsite"]=2,
["xxx"]=3,
["porn"]=4
}

function NewUserConnected(user)
if not user.bOperator then
for i,v in table do
if strfind(user.sMyInfoString, i) then
user:SendData("you are advertising or have unwanted text in description/email remove ..i.. and reconnect")
user:Disconnect()
end
end
end
end

Title:
Post by: pHaTTy on 05 March, 2004, 02:41:32
in fact wudnt even use the cpu timefor the sake of numbers ;)

table = {"dns2go","myftpsite","xxx","porn"}

function NewUserConnected(user)
if not user.bOperator then
for i,v in table do
if strfind(user.sMyInfoString, v) then
user:SendData("you are avertising or have unwanted text in description/email remove ..v.. and reconnect")
user:Disconnect()
end
end
end
end

Title:
Post by: nErBoS on 05 March, 2004, 02:42:09
Hi,

No use to use "if not user.bOperator", since you are working in the function NewUserConnected, unless you have made this.. OpConnected = NewUserConnected before.

Best regards, nErBoS
Title:
Post by: pHaTTy on 05 March, 2004, 02:43:24
dont need check for operator status as its new user connected not op connected

table = {"dns2go","myftpsite","xxx","porn"}

function NewUserConnected(user)
for i,v in table do
if strfind(user.sMyInfoString, v) then
user:SendData("you are avertising or have unwanted text in description/email remove ..v.. and reconnect") user:Disconnect()
end
end
end
Title:
Post by: pHaTTy on 05 March, 2004, 02:44:16
QuoteOriginally posted by nErBoS
Hi,

No use to use "if not user.bOperator", since you are working in the function NewUserConnected, unless you have made this.. OpConnected = NewUserConnected before.

Best regards, nErBoS

lmao u got there b4 me :p same time post seems common tonight :p
Title:
Post by: nErBoS on 05 March, 2004, 02:46:40
Deja vu :)

Got two this nigth, i better go to sleep.

Best regards, nErBoS
Title:
Post by: pHaTTy on 05 March, 2004, 02:53:21
if u also want to play with tables u can do somethign like

table = {

["dns2go"]="Advertising",
["myftpsite"]="Advertising",
["xxx"]="XXX",
["porn"]="Porn",

}

Bot = "BotName";

function NewUserConnected(user)
for i,v in table do
if strfind(user.sMyInfoString, i) then
user:SendData(Bot,"you are avertising or have unwanted text in description/email remove ..i.. and reconnect")
SendToOps(Bot,user.sName.." has been kicked because of "..v.." in MyInfo string")
  user:Disconnect()
end
end
end


later,,
Title:
Post by: pHaTTy on 05 March, 2004, 02:55:49
whoa i didnt see that humm another silly fix lmao :p



table = {

["dns2go"]="Advertising",
["myftpsite"]="Advertising",
["xxx"]="XXX",
["porn"]="Porn",

}

Bot = "BotName";

function NewUserConnected(user)
for i,v in table do
if strfind(user.sMyInfoString, i) then
user:SendData(Bot,"You have "..v.." in description/email, please remove "..i.." and reconnect")
SendToOps(Bot,user.sName.." has been kicked because of "..v.." in MyInfo string")
user:Disconnect()
end
end
end
Title:
Post by: lynyrd on 05 March, 2004, 02:58:44
i got this..

------------------------------------------------------------------------------------------------------------
you are avertising or have unwanted text in description/email remove ..i .. and reconnect
 *** Connection reset by server
------------------------------------------------------------------------------------------------------------
but this really made me happy
thanks phatty =))
Title:
Post by: pHaTTy on 05 March, 2004, 03:00:46
QuoteOriginally posted by lynyrd
i got this..

------------------------------------------------------------------------------------------------------------
you are avertising or have unwanted text in description/email remove ..i .. and reconnect
 *** Connection reset by server
------------------------------------------------------------------------------------------------------------
but this really made me happy
thanks phatty =))

yep im one step ahead :p, have alook at post above urs ;)

then tell me what u see ;)
Title:
Post by: lynyrd on 05 March, 2004, 03:00:51
now it works as a charm!
youre the man phatty =)
Title:
Post by: pHaTTy on 05 March, 2004, 03:02:34
QuoteOriginally posted by lynyrd
now it works as a charm!
youre the man phatty =)

lmao :)
Title:
Post by: lynyrd on 05 March, 2004, 03:05:33
then it should be like this....

code:--------------------------------------------------------------------------------
--made by Phatty

table = {

["dns2go"]="Advertising",
["myftpsite"]="Advertising",
["xxx"]="XXX",
["porn"]="Porn",

}

Bot = "BotName";

function NewUserConnected(user)
   for i,v in table do
      if strfind(user.sMyInfoString, i) then
         user:SendData(Bot,"You have "..v.." in description/email, please remove "..i.." and reconnect")
         SendToOps(Bot,user.sName.." has been kicked because of "..v.." in MyInfo string")
         user:Disconnect()
      end
   end
end
--------------------------------------------------------------------------------
Title:
Post by: NightLitch on 05 March, 2004, 03:05:38
QuoteOriginally posted by (uk-kingdom)pH?tt?
QuoteOriginally posted by NightLitch
try this one:

description = {["dns2go"]=1,["myftpsite"]=2,["xxx"]=3,["porn"]=4}

function NewUserConnected(user)
if not user.bOperator then
for key, value in D do
if strfind(user.sMyInfoString, "$MyINFO $ALL "..user.sName.." " .. description .."<") then
user:SendData("you are advertising or have unwanted text in description/email remove ..word.. and reconnect")
user:Disconnect()
end
end
end
end

Maybe work / NL


errrm what is D? hmm m8 i thinku need some sleep lmao what is word?

lmao, hahahaha I have changed keyboard now... I have trashed my old one now...

Think I was lucky just getting the rest.. Cause when sending an e-mail My Friend just got:

f o e w r i ll / Niglch

there is like 30 vocal's missing....
Title:
Post by: NightLitch on 05 March, 2004, 03:07:41
this should be my working code i think, am really tired too.... hehe

description = {["dns2go"]=1,["myftpsite"]=2,["xxx"]=3,["porn"]=4}

function NewUserConnected(user)
for value, key in description do
if strfind(user.sMyInfoString,value) then
user:SendData("you are advertising or have unwanted text in description/email remove "..value.." and reconnect")
user:Disconnect()
end
end
end
Title:
Post by: NightLitch on 05 March, 2004, 03:09:36
But then again.. this will take on all e-mail addresses....
Title:
Post by: pHaTTy on 05 March, 2004, 03:10:19
QuoteOriginally posted by lynyrd
then it should be like this....

code:--------------------------------------------------------------------------------
--made by Phatty

table = {

["dns2go"]="Advertising",
["myftpsite"]="Advertising",
["xxx"]="XXX",
["porn"]="Porn",

}

Bot = "BotName";

function NewUserConnected(user)
   for i,v in table do
      if strfind(user.sMyInfoString, i) then
         user:SendData(Bot,"You have "..v.." in description/email, please remove "..i.." and reconnect")
         SendToOps(Bot,user.sName.." has been kicked because of "..v.." in MyInfo string")
         user:Disconnect()
      end
   end
end
--------------------------------------------------------------------------------

muhahah lmfao, oki then :)))
Title:
Post by: NightLitch on 05 March, 2004, 03:10:48
that goes for almost all of your fine ex's exept nErBoS.
Title:
Post by: lynyrd on 05 March, 2004, 03:12:27
Zitat:
--------------------------------------------------------------------------------
Originally posted by NightLitch
lmao, hahahaha I have changed keyboard now... I have trashed my old one now...
--------------------------------------------------------------------------------


yeah! it happens to me all the time LOL
Title:
Post by: pHaTTy on 05 March, 2004, 03:12:35
QuoteOriginally posted by NightLitch
that goes for almost all of your fine ex's exept nErBoS.

yah true, but i have seen

someone@acertainhub.no-ip.com

this is advertising :p
Title:
Post by: NightLitch on 05 March, 2004, 03:14:40
QuoteOriginally posted by (uk-kingdom)pH?tt?
QuoteOriginally posted by NightLitch
that goes for almost all of your fine ex's exept nErBoS.

yah true, but i have seen

someone@acertainhub.no-ip.com

this is advertising :p

Are you applying to my Signature or Am I too tired to understand ???

My is to a forum...
Title:
Post by: pHaTTy on 05 March, 2004, 03:16:16
lmfao to be honest i never noticed ur signature, but i mean hub wise, i have seen that as email address, which is advertising :p
Title:
Post by: NightLitch on 05 March, 2004, 03:18:01
QuoteOriginally posted by (uk-kingdom)pH?tt?
lmfao to be honest i never noticed ur signature, but i mean hub wise, i have seen that as email address, which is advertising :p

lol k, Well nobody can really come into out forum anyway, exept our ppl that live's in our City/State.
Title:
Post by: NightLitch on 05 March, 2004, 03:18:56
But what about your fine little link to ah.. ahmm forum... ;-)=
Title:
Post by: lynyrd on 05 March, 2004, 03:19:28
i dont want to be a complete pester..
but is it possible to make it with a timer or something
so it checks users even after they logged in?
they can easily change back once in the hub

if not im more than happy for your work on this
thanks guys =)
Title:
Post by: pHaTTy on 05 March, 2004, 03:20:04
QuoteOriginally posted by NightLitch
QuoteOriginally posted by (uk-kingdom)pH?tt?
lmfao to be honest i never noticed ur signature, but i mean hub wise, i have seen that as email address, which is advertising :p

lol k, Well nobody can really come into out forum anyway, exept our ppl that live's in our City/State.

lmao
Title:
Post by: pHaTTy on 05 March, 2004, 03:20:35
QuoteOriginally posted by NightLitch
But what about your fine little link to ah.. ahmm forum... ;-)=

lmfao
Title:
Post by: NightLitch on 05 March, 2004, 03:22:29
QuoteOriginally posted by (uk-kingdom)pH?tt?
QuoteOriginally posted by NightLitch
But what about your fine little link to ah.. ahmm forum... ;-)=

lmfao

Is that all you can do now, LMFAO...!! hehe to tired bro ?
Title:
Post by: NightLitch on 05 March, 2004, 03:23:54
I thought we had a word fight here.... well well godnight bro...
Title:
Post by: pHaTTy on 05 March, 2004, 03:24:39
QuoteOriginally posted by lynyrd
i dont want to be a complete pester..
but is it possible to make it with a timer or something
so it checks users even after they logged in?
they can easily change back once in the hub

if not im more than happy for your work on this
thanks guys =)


hmm


--AntiAdvert in des/email by Phatty

table = {

["dns2go"]="Advertising",
["myftpsite"]="Advertising",
["xxx"]="XXX",
["porn"]="Porn",

}

Bot = "BotName";

function NewUserConnected(user)
CheckUser(user)
end

function CheckUser(user)
for i,v in table do
if strfind(user.sMyInfoString, i) then
user:SendData(Bot,"You have "..v.." in description/email, please remove "..i.." and reconnect")
SendToOps(Bot,user.sName.." has been kicked because of "..v.." in MyInfo string")
user:Disconnect()
end
end
end

function DataArrival(user,data)
if strsub(data,1,7) == "$MyInfo" then
CheckUser(user)
end
end

:p
Title:
Post by: pHaTTy on 05 March, 2004, 03:25:27
QuoteOriginally posted by NightLitch
I thought we had a word fight here.... well well godnight bro...

lmao nah im to happy atm :p

gnight sleep well ;)
Title:
Post by: pHaTTy on 05 March, 2004, 03:42:30
QuoteOriginally posted by (uk-kingdom)pH?tt?
QuoteOriginally posted by lynyrd
i dont want to be a complete pester..
but is it possible to make it with a timer or something
so it checks users even after they logged in?
they can easily change back once in the hub

if not im more than happy for your work on this
thanks guys =)


hmm


--AntiAdvert in des/email by Phatty

table = {

["dns2go"]="Advertising",
["myftpsite"]="Advertising",
["xxx"]="XXX",
["porn"]="Porn",

}

Bot = "BotName";

function NewUserConnected(user)
CheckUser(user)
end

function CheckUser(user)
for i,v in table do
if strfind(user.sMyInfoString, i) then
user:SendData(Bot,"You have "..v.." in description/email, please remove "..i.." and reconnect")
SendToOps(Bot,user.sName.." has been kicked because of "..v.." in MyInfo string")
user:Disconnect()
end
end
end

function DataArrival(user,data)
if strsub(data,1,7) == "$MyInfo" then
CheckUser(user)
end
end

:p

it working???
Title:
Post by: lynyrd on 05 March, 2004, 03:50:01
nothing happens when i change to xxx in description after i logged in

would it work with a timer that checks every 10 minutes?

im off playing with noob timers now ;)
Title:
Post by: pHaTTy on 05 March, 2004, 03:53:44
QuoteOriginally posted by lynyrd
nothing happens when i change to xxx in description after i logged in

would it work with a timer that checks every 10 minutes?

im off playing with noob timers now ;)

hummm,w8 1 maybe i made mistake :p
Title:
Post by: pHaTTy on 05 March, 2004, 03:56:09
sorry in DataArrival change it to this line


if strsub(data, 1, 7) == "$MyINFO" then



humm w8 i do it ;)



--AntiAdvert in des/email by Phatty

table = {

["dns2go"]="Advertising",
["myftpsite"]="Advertising",
["xxx"]="XXX",
["porn"]="Porn",

}

Bot = "BotName";

function NewUserConnected(user)
CheckUser(user)
end

function CheckUser(user)
for i,v in table do
if strfind(user.sMyInfoString, i) then
user:SendData(Bot,"You have "..v.." in description/email, please

remove "..i.." and reconnect")
SendToOps(Bot,user.sName.." has been kicked because of "..v.." in

MyInfo string")
user:Disconnect()
end
end
end

function DataArrival(user,data)
if strsub(data, 1, 7) == "$MyINFO" then
CheckUser(user)
end
end

Title:
Post by: pHaTTy on 05 March, 2004, 04:24:56
lmao what on earth was i trying to do muhahah lol


--AntiAdvert in des/email v1.03 by Phatty

table = {

["dns2go"]="Advertising",
["myftpsite"]="Advertising",
["xxx"]="XXX",
["porn"]="Porn",

}

function Main()
Bot = "BotName";
frmHub:EnableFullData(1)
end

function DataArrival(user,data)
if strsub(data,1,7) == "$MyINFO" then
for i,v in table do
if strfind(data,i) then
user:SendData(Bot,"You have "..v.." in description/email, please remove "..i.." and reconnect")
SendToOps(Bot,user.sName.." has been kicked because of "..v.." in MyInfo string")
user:Disconnect()
end
end
end
end


enjoy ;)
Title:
Post by: lynyrd on 05 March, 2004, 06:28:21
looks good phatty but still not working
could'nt help my self fiddle with timer function ;)

but got this..
Syntax Error: bad argument #1 to `strsub' (string expected, got nil)
what's that? why? humm?
code:
----------------------------------------------------------------------------------------------------------
--AntiAdvert in des/email v1.03 by Phatty

table = {

["dns2go"]="Advertising",
["myftpsite"]="Advertising",
["xxx"]="XXX",
["porn"]="Porn",

}

function Main()
   Bot = "BotName";
   frmHub:EnableFullData(1)
               SetTimer(1*30000)
               StartTimer()
end


function DataArrival(user,data)
   if strsub(data,1,7) == "$MyINFO" then
      for i,v in table do
         if strfind(data,i) then
            user:SendData(Bot,"You have "..v.." in description/email, please remove "..i.." and reconnect")
            SendToOps(Bot,user.sName.." has been kicked because of "..v.." in MyInfo string")
            user:Disconnect()
         end
      end
   end
end

function OnTimer(user,data)
                    if strsub(data,1,7) == "$MyINFO" then <----problem here
                         for i,v in table do
      if strfind(data,i) then
         user:SendData(Bot,"You have "..v.." in description/email, please remove "..i.." and reconnect")
         SendToOps(Bot,user.sName.." has been kicked because of "..v.." in MyInfo string")
         user:Disconnect()
      end
              end
end
end
------------------------------------------------------------------------------------------------------------------
best regards from the lua bug lynyrd ;)
Title:
Post by: NightLitch on 05 March, 2004, 11:56:21
QuoteOriginally posted by lynyrd
looks good phatty but still not working
could'nt help my self fiddle with timer function ;)

but got this..
Syntax Error: bad argument #1 to `strsub' (string expected, got nil)
what's that? why? humm?
code:
----------------------------------------------------------------------------------------------------------
--AntiAdvert in des/email v1.03 by Phatty

table = {

["dns2go"]="Advertising",
["myftpsite"]="Advertising",
["xxx"]="XXX",
["porn"]="Porn",

}

function Main()
   Bot = "BotName";
   frmHub:EnableFullData(1)
               SetTimer(1*30000)
               StartTimer()
end


function DataArrival(user,data)
   if strsub(data,1,7) == "$MyINFO" then
      for i,v in table do
         if strfind(data,i) then
            user:SendData(Bot,"You have "..v.." in description/email, please remove "..i.." and reconnect")
            SendToOps(Bot,user.sName.." has been kicked because of "..v.." in MyInfo string")
            user:Disconnect()
         end
      end
   end
end

function OnTimer(user,data)
                    if strsub(data,1,7) == "$MyINFO" then <----problem here
                         for i,v in table do
      if strfind(data,i) then
         user:SendData(Bot,"You have "..v.." in description/email, please remove "..i.." and reconnect")
         SendToOps(Bot,user.sName.." has been kicked because of "..v.." in MyInfo string")
         user:Disconnect()
      end
              end
end
end
------------------------------------------------------------------------------------------------------------------
best regards from the lua bug lynyrd ;)

Well every line in Timer will not work... you can't call $MYINFO in Timer and you can't do user there either...
Title:
Post by: lynyrd on 05 March, 2004, 13:30:05
awh! ok thanks NL
that would been smooth if it would work thou..
i'll go back to try some other things then =)
Title:
Post by: pHaTTy on 06 March, 2004, 20:38:42
QuoteOriginally posted by (uk-kingdom)pH?tt?
lmao what on earth was i trying to do muhahah lol


--AntiAdvert in des/email v1.03 by Phatty

table = {

["dns2go"]="Advertising",
["myftpsite"]="Advertising",
["xxx"]="XXX",
["porn"]="Porn",

}

function Main()
Bot = "BotName";
frmHub:EnableFullData(1)
end

function DataArrival(user,data)
if strsub(data,1,7) == "$MyINFO" then
for i,v in table do
if strfind(data,i) then
user:SendData(Bot,"You have "..v.." in description/email, please remove "..i.." and reconnect")
SendToOps(Bot,user.sName.." has been kicked because of "..v.." in MyInfo string")
user:Disconnect()
end
end
end
end


enjoy ;)

i have tested this several times, and this does work....

if not then u have another scripting blocking myinfo being sent to scripts
Title:
Post by: lynyrd on 07 March, 2004, 00:39:56
yup you're right it was HubSecure v1.0 that was the cause for that..
thanks for the hint Phatty nice job =)
Title:
Post by: pHaTTy on 07 March, 2004, 01:58:39
QuoteOriginally posted by lynyrd
yup you're right it was HubSecure v1.0 that was the cause for that..
thanks for the hint Phatty nice job =)

yah np ;)
Title:
Post by: (=CyberPimp=) on 12 September, 2004, 16:58:08
would it be better to put like:
data = strlower(data)
         data = gsub(gsub(gsub(data, "-", ""), " ", ""), " ", "")

or something like it in it.