![]() |
Position of strings
Im just messing around wondering how would i get the postion of a string without tokenizeing the string... i've tried lindexof , indexof and triming the string and getting the var of each ... but none work, indexof was the closest thing to it but it gave the positon of the first letter in the entire string so say if i had
this.parts = one,two,three indexof would give me 1,4,7 if it helps this is what i put when i trimed the string NPC Code: that gets me the string but i want the position of the string in the list and this is with indexof NPC Code: |
anyyone... aannyyyonneee? =(
|
1. Stop double posting, it is something that i see you do frequently.
2. Have you tried using 'addstring' and using '#I'? |
Explain a little further what u r trying to do...
|
Quote:
Quote:
|
#I is the way to go
I don't see why it wouldn't have worked. |
Quote:
|
lindexof(string,stringlist)
|
Quote:
Quote:
|
wait how do you usae #I?
|
#I(string,token);
setstring this.foo,bar,asdf,fhqwhgads #I(this.foo,2) = asdf |
i got it thanks
|
NPC Code: I will explain it anyway: NPC Code: That string (this.string) is divided into 4 pieces, you count the pieces since the number 0. (same method of triggeraction and other commands), so: Welcome - piece 0 to - piece 1 graal - piece 2 forums - piece 3 NPC Code: I presume you know how lindexof work, so, create a variable (you don't really need it, but i like to) to hold the value of the lindexof(), just check if it is >= 0 and voalá, here is your example script. Hope this help, took me - 5 minutes of sleep, good night. n_n' |
Quote:
|
Quote:
NPC Code: |
Quote:
|
.. i reset the npcserver and it started working, and yes thats there for the taylor part
finshed script... no stealing please NPC Code: |
NPC Code: Too simple, please try to understand the code and feel free to use it. :) |
Quote:
|
Quote:
|
| All times are GMT +2. The time now is 06:37 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.