PtokaX forum

Development Section => Your Developing Problems => Topic started by: TTB on 28 February, 2005, 16:25:12

Title: BANME string problem
Post by: TTB on 28 February, 2005, 16:25:12
Hi,

I almost finished my BanMe script... But there is one big problem... I can't make the reason part work... I'll explain:

The user kan timeban himself with the time he/she gives... Now I want it like this:
#banme
Title:
Post by: plop on 28 February, 2005, 16:59:26
local s,e,time,reason= strfind(data,"%b<>%s+%S+%s+(%A+)+s%+(.+)")
you made a tiny typing error here.
before grabbing the reason you typed +s%+
this should be %s*
and as the reason can be optional you should also replace (.+) for (.*).
+ means 1 or more, while * means 0 or more (returns "" when not found).

plop
Title:
Post by: TTB on 28 February, 2005, 17:15:32
Hi,

first of all, thanx for your reply plop. I have spent a lot of time on this script because I like this language and try to understand this language very well... :)

I have changed the string, indeed, that was a little typing error. After fixing this, I still got the same problem.

String:local s,e,time,reason= strfind(data,"%b<>%s+%S+%s+(%A+)+%s+(.*)")
I have tried also some other things, like changing (.*) into (%S+)... Same problem.

Maybe something else I have to change?