View Single Post
  #6  
Old 04-10-2007, 09:05 PM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Basically, I have loaded variables from a text file into invcontents.

There maybe one or more variables in the text file starting with the prefix "inv_" now, then it uses the for loop to go through everything that starts with, "inv_". After that it checks what text is after "inv_".

Like for example, in the text file I might have this:

inv_item=name,icon,power,blah

After I check if "item=" is after inventory or not or any of the other words after it, I'm creating a substring of everything after the "=" and tokenizing it to turn it into an array.

This is what I'm trying to do, put all the information in the text file AFTER the "itemname=" into an array.



What Stefan suggested, so something like this would be fine?
PHP Code:
  with (invcontents)
  {
    for (
igetstringkeys("this.inv_"))
    {
      if (
== "item=")
      {
        
tokens getstringkeys("invcontents.inv_" i)
      } 
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.

Last edited by killerogue; 04-10-2007 at 09:25 PM..
Reply With Quote