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 06-10-2009, 07:02 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
PHP Code:
function comparearrays(arr1,arr2) {
  
temp.checklist arr2.size();
  for (
temp.arr1) {
    if (
i in arr2) {
      
checklist--;
      
arr2.remove(i);
    } else break;
  }
  return (
checklist == 0);

? I dunno, I didn't test it... seems to make sense in my head, however.
Reply With Quote
  #2  
Old 06-10-2009, 07:14 PM
The_Kez The_Kez is offline
N-Pulse Asst. Manager
The_Kez's Avatar
Join Date: Dec 2007
Posts: 106
The_Kez is on a distinguished road
Send a message via MSN to The_Kez
Stupid of me to post this and then come up with a solution for myself 10 minutes later.
Modifying your script to how for what I wanted worked perfectly. So thanks for the help. I also came up with this script awhile after I made the thread...

PHP Code:
function Comparecombo ) {
  
temp.list = {
  {
"Test One","Test Two","Test Three"},"Test String Zero",
  {
"Test One","Test Two"},"Test String One",
  {
"Test Two","Test Three"},"Test String Two"
  
};
  for ( 
temp.: list ) {
    if ( 
i.type() == ) {
      
temp.match 0;
      for ( 
temp.combo ) {
        if ( 
j in i match++;
      }
      if ( 
match == i.size() || combo == i.size() ) return list[list.index(i)+1];
    }
  }

This also works, I've tested it a few times. :]
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 05:02 AM.


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