Author Topic: BANME string problem  (Read 1715 times)

0 Members and 1 Guest are viewing this topic.

Offline TTB

  • Lord
  • ***
  • Posts: 436
  • Karma: +17/-1
BANME string problem
« 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
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

PtokaX forum

BANME string problem
« on: 28 February, 2005, 16:25:12 »

Offline plop

  • Forum God
  • ****
  • Posts: 2 464
  • Karma: +37/-0
(No subject)
« Reply #1 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
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Offline TTB

  • Lord
  • ***
  • Posts: 436
  • Karma: +17/-1
(No subject)
« Reply #2 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:
Code: [Select]
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?
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

PtokaX forum

(No subject)
« Reply #2 on: 28 February, 2005, 17:15:32 »