View Single Post
  #2  
Old 08-02-2002, 04:34 AM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
NPC Code:
 
if (playerenters||timeout){
setarray MyArray,4; // creates and array of length 8 starts at 0
MyArray[0] = 23; // sets the first entry in the array to 23;
MyArray[1] = 17; // 2nd entry in the array
MyArray[2] = 32;
MyArray[3] = 2;

for (index=0;index<4;index++){
message MyArray[#v(index)] is equal to #v(MyArray[index]);
sleep 1;
}
timeout=1;
}



I always said I was a poor teacher. But here is a script using an array and a for loop together. Maybe it will make sense when you run it.

I believe it shows how you can use a for loop to access the information in an array. I assure you there are much more complex methods of data retrieval using multiple arrays.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote