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
  #41  
Old 12-19-2012, 01:00 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Comparing arrays doesn't always work well. You can coerce them to strings for the comparison like so:

PHP Code:
if ((@ array1) == (@ array2)) { // this looks ugly, there is
                               // probably a better way to format this 
__________________
Reply With Quote
  #42  
Old 12-19-2012, 01:06 AM
Stowen Stowen is offline
Graalian since '01
Join Date: Sep 2005
Location: Massachusets, USA
Posts: 156
Stowen will become famous soon enough
Send a message via AIM to Stowen Send a message via MSN to Stowen
You mean like this?:

PHP Code:
if ((@ itemList) == (@ itemList2)) 
Reply With Quote
  #43  
Old 12-19-2012, 09:12 AM
Tim_Rocks Tim_Rocks is offline
a true gentlemen
Tim_Rocks's Avatar
Join Date: Aug 2008
Location: USA
Posts: 1,863
Tim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to behold
Quote:
Originally Posted by Stowen View Post
You mean like this?:

PHP Code:
if ((@ itemList) == (@ itemList2)) 
That's exactly what he wrote, you just have different variable names...
__________________
Reply With Quote
  #44  
Old 12-19-2012, 10:45 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Stowen View Post
You mean like this?:

PHP Code:
if ((@ itemList) == (@ itemList2)) 
Yes, but depending on what you're doing, remember that your lists will need to be in the same order for that to work. If you want to compare them without paying attention to order, you'll have to do a bit more work.
__________________
Reply With Quote
  #45  
Old 12-19-2012, 02:20 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Quote:
Originally Posted by Stowen View Post
You mean like this?:

PHP Code:
if ((@ itemList) == (@ itemList2)) 
since you have been using a this.variable, you might also want to add this. into your check

PHP Code:
if ((@ this.itemList) == (@ this.itemList2)) 
__________________
MEEP!
Reply With Quote
  #46  
Old 12-19-2012, 08:07 PM
Stowen Stowen is offline
Graalian since '01
Join Date: Sep 2005
Location: Massachusets, USA
Posts: 156
Stowen will become famous soon enough
Send a message via AIM to Stowen Send a message via MSN to Stowen
Alright, thanks guys. The check returned positive, so that did work.
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:26 PM.


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