Author Topic: Need help  (Read 2032 times)

0 Members and 1 Guest are viewing this topic.

Offline ?StIfFLEr??

  • Triple Ace
  • **
  • Posts: 241
  • Karma: +17/-63
Need help
« on: 24 April, 2009, 07:06:11 »
Can anyone help me understand the strings of lua.
Like example what does this stands for i am not able to get "(Data, "%b<>%s(%S+)%s+(%S+)|")"

PtokaX forum

Need help
« on: 24 April, 2009, 07:06:11 »

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
Re: Need help
« Reply #1 on: 24 April, 2009, 20:40:34 »
Well, I asume that this line is found in ChatArrival.
Code: [Select]
_,_,A,B = string.find(Data, "%b<>%s(%S+)%s+(%S+)|")%b<> is anything between <>, this would be the nick of the user sending the chat
%s is a space, %s+ is one space or more.
%S+ is anything else then space.
| (endpipe) is the end of the incomming data/line

So the statemet would only be correct if someone wrote something like this:
test this
nice string
catch me
!cmd arg

A would be test,nice,catch or !cmd
B would be this,string,me or arg

It would fail on
!test arg1 arg2
this is my text
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Offline ?StIfFLEr??

  • Triple Ace
  • **
  • Posts: 241
  • Karma: +17/-63
Re: Need help
« Reply #2 on: 25 April, 2009, 06:02:46 »
Thanks Mutor and madman you both are just awesome.
Sorry for not posting the full script because it did not had any credits in it ..
So i thought it would be wrong in posting that script here.
I was trying to learn through your and madman's script and understanding them but comparing it with other scripts.
I know it sounds ridiculous but it made me learn a bit of it will surely look forward to the link you provided mutor.
Thanks a Lot mutor and madman you both have been a great help in learning whatever i have learnt so far.

PtokaX forum

Re: Need help
« Reply #2 on: 25 April, 2009, 06:02:46 »