Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   String Lists (https://forums.graalonline.com/forums/showthread.php?t=47422)

wonderboysp2p 08-23-2003 07:46 AM

String Lists
 
is there a Flag to see if something is contained in a string list?


like
NPC Code:

if (playerchats&&startswith/ , #c){
tokenize #c;
}
if (strequals(#c,/checklist)){
if (inlist(this.list,#t(1))){
say2 Yep its in teh list!;
}
}


Kaimetsu 08-23-2003 07:55 AM

lindexof(list,text)

If it returns -1, it's not there.

wonderboysp2p 08-23-2003 07:58 AM

thanks ^_^ i was trying to use a for loop and then i decided there was a differant way after it didnt work :( but yea.. just outta curiousity... whats lindexof stand for...? les all tihnk?

Kaimetsu 08-23-2003 08:03 AM

It's the string list version of indexof - the function for finding the index of the start of one string in another.

wonderboysp2p 08-23-2003 08:18 AM

=/ i was hoping it was an acronym for something wacky...

lost
imbred
naughyy
dogs
experience
xordberging
osterichs
flying


or somethin REALLY cool

Thought 08-23-2003 08:36 AM

list index of.

:P

Snakeandy7 08-23-2003 12:35 PM

Yeh, what they said..
String array's are easier.. ;)

KainDaMan 08-23-2003 06:58 PM

Quote:

Originally posted by Kaimetsu
It's the string list version of indexof - the function for finding the index of a value in an array.
You're thinking of aindexof(variable,array)
indexof is for finding the position of partstr in str
indexof(partstr,str)

Python523 08-23-2003 08:05 PM

Quote:

Originally posted by KainDaMan


You're thinking of aindexof(variable,array)
indexof is for finding the position of partstr in str
indexof(partstr,str)

I think kai knows what he's talking about :rolleyes:

Riot-Starter 08-23-2003 08:57 PM

Quote:

Originally posted by KainDaMan


You're thinking of aindexof(variable,array)
indexof is for finding the position of partstr in str
indexof(partstr,str)

What kai said is right:
lindexof( str, list ) - position of where the string appears in the string list


indexof() would be for like finding something in the players text or a non-array string

Kaimetsu 08-23-2003 09:06 PM

Kain has a point. I edited my post to be less ambiguous.


All times are GMT +2. The time now is 04:16 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.