PDA

View Full Version : Reading Sub-strings


JoMomma
03-31-2001, 01:30 AM
There has GOT to be a way to do this. I don't know if it's thru the new way of scripting on the NPC Server, or an undocumented (or perhaps documented but unnoticed) command.

Let's say we have the string: "say this is a test". Now I want to get the part after "say". I can easily detect the "say" part, but how do I get the rest of it without the say part? Think about things like:
"play dead" "play dancey" etc etc for bomy pets
"setbomy name number" for bomy class

Are these just built-in to the npc and they check every single possibility, and have to change the code a bit once a new animation is added or a new bomy "body" is made?

Tyhm
03-31-2001, 02:48 AM
In reverse order:

if(playerchats&&strcontains(#c,play dead)){

if(playerchats&&strcontains(#c,say)){
message #s(#c-say);
}

I've seen that used a few times with varying degrees of success. Personally, I just steer clear of string manipulation....say and fire is about as far as I'll go there. =P

Admins
03-31-2001, 04:34 AM
no there is no string parsing yet,
although it would be quite easy to make,
may be i should add it soon

grim_squeaker_x
03-31-2001, 06:15 PM
Originally posted by Stefan
no there is no string parsing yet,
although it would be quite easy to make,
may be i should add it soon

That would be really useful for script reducal in some cases ^^