PtokaX forum

Archive => Archived 5.0 boards => Help with scripts => Topic started by: blackwings on 27 April, 2005, 13:11:03

Title: http detection wont work
Post by: blackwings on 27 April, 2005, 13:11:03
I'm making a script that makes a list of popular http adresses which users post in the mainchat. But I have a problem with the detection of http adress, because this doesn't work =

local HttpFind = "^(http%:%/%/)[^%.]+%p%S+"
what should I use instead for it to work???

It must be the "http://" part of the detection that I can't get to work.
Title:
Post by: jiten on 27 April, 2005, 16:49:59
Maybe these can help you (got from plop's sneaky anti-advertiser):
local s,e,webadver = string.find(data,"%b<>%s+http://([^%.]+%.[^%.]+%.%S+)")

local s,e,msg,webadver,msg2 = string.find(data, "%b<>%s(.*)http://([^%.]+%.[^%.]+%.%S+)(.*)$")
Cheers
Title:
Post by: blackwings on 28 April, 2005, 05:15:40
QuoteOriginally posted by jiten
Maybe these can help you (got from plop's sneaky anti-advertiser):
local s,e,webadver = string.find(data,"%b<>%s+[URL]http://[/URL]([^%.]+%.[^%.]+%.%S+)")

local s,e,msg,webadver,msg2 = string.find(data, "%b<>%s(.*)[URL]http://[/URL]([^%.]+%.[^%.]+%.%S+)(.*)$")
Cheers
Thanx jiten :D, the second one works + I have improved it so it can detect both http://www and just //http://
which is good because one string find is faster than two :D
Title:
Post by: jiten on 28 April, 2005, 09:52:31
Anytime :]