Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-23-2003, 07:46 AM
wonderboysp2p wonderboysp2p is offline
Registered User
wonderboysp2p's Avatar
Join Date: Sep 2002
Location: -Wonderboy
Posts: 537
wonderboysp2p is on a distinguished road
Send a message via AIM to wonderboysp2p
Question 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!;
}
}

__________________

we are the llama FORUms!!!EWQ Ce13d5423f23!! 2e1 @$6tgv3uy65!
Reply With Quote
  #2  
Old 08-23-2003, 07:55 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
lindexof(list,text)

If it returns -1, it's not there.
__________________
Reply With Quote
  #3  
Old 08-23-2003, 07:58 AM
wonderboysp2p wonderboysp2p is offline
Registered User
wonderboysp2p's Avatar
Join Date: Sep 2002
Location: -Wonderboy
Posts: 537
wonderboysp2p is on a distinguished road
Send a message via AIM to wonderboysp2p
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?
__________________

we are the llama FORUms!!!EWQ Ce13d5423f23!! 2e1 @$6tgv3uy65!
Reply With Quote
  #4  
Old 08-23-2003, 08:03 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
It's the string list version of indexof - the function for finding the index of the start of one string in another.
__________________
Reply With Quote
  #5  
Old 08-23-2003, 08:18 AM
wonderboysp2p wonderboysp2p is offline
Registered User
wonderboysp2p's Avatar
Join Date: Sep 2002
Location: -Wonderboy
Posts: 537
wonderboysp2p is on a distinguished road
Send a message via AIM to wonderboysp2p
=/ i was hoping it was an acronym for something wacky...

lost
imbred
naughyy
dogs
experience
xordberging
osterichs
flying


or somethin REALLY cool
__________________

we are the llama FORUms!!!EWQ Ce13d5423f23!! 2e1 @$6tgv3uy65!
Reply With Quote
  #6  
Old 08-23-2003, 08:36 AM
Thought Thought is offline
PipBoy Extraordinaire!
Thought's Avatar
Join Date: Nov 2001
Location: Long Beach, California.
Posts: 692
Thought is on a distinguished road
list index of.

:P
__________________
Rick ([email protected])
#gscript on FreeNode (#gscript Guild, #gscript Information)
Graal User Statistics

I am now using my new account, Rick.
Reply With Quote
  #7  
Old 08-23-2003, 12:35 PM
Snakeandy7 Snakeandy7 is offline
"Member ID=2610"
Snakeandy7's Avatar
Join Date: Mar 2003
Posts: 987
Snakeandy7 is on a distinguished road
Yeh, what they said..
String array's are easier..
__________________
"Freedom is best I tell thee
of all things to be won
then never live within the bond
of slavery my son".


Reply With Quote
  #8  
Old 08-23-2003, 06:58 PM
KainDaMan KainDaMan is offline
Registered User
Join Date: Jul 2003
Location: Virginia,USA
Posts: 51
KainDaMan is on a distinguished road
Send a message via AIM to KainDaMan
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)
__________________
---Kain Morbid
Reply With Quote
  #9  
Old 08-23-2003, 08:05 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
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
Reply With Quote
  #10  
Old 08-23-2003, 08:57 PM
Riot-Starter Riot-Starter is offline
Registered User
Join Date: Aug 2001
Location: Central Florida, USA
Posts: 79
Riot-Starter is on a distinguished road
Send a message via AIM to Riot-Starter
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
Reply With Quote
  #11  
Old 08-23-2003, 09:06 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Kain has a point. I edited my post to be less ambiguous.
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:27 AM.


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