ays297 Posted October 23, 2012 Group: Members Topic Count: 24 Topics Per Day: 0.00 Content Count: 49 Reputation: 0 Joined: 11/30/11 Last Seen: November 2, 2014 Share Posted October 23, 2012 I was making a menu based on my array. But it seems like that I went over the limit? What should I do? setarray .@Upper$[0],"Deviling Wing Hat","Deviruchi Hat","Ebi Hat","Invisible Hat","Kagami Hat","Kingyo Hat","Osyare Akuma Hat","Sexy Tiarra","Blue Pochi Hat","Pink Pochi Hat","Silver Valkyrie Helm","Orange Valkyrie Helm","Bongun Bunny Hat","Rubin Valkyrie Helm","Black and White Valkyrie","Snow Valkyrie Helm","Bunny Hat","Dragon Rider","Panda Hat","Poporing Hat","Poring Shoot","Half Hollow Mask","Samurai Hat","Lunatic Hat","Black Valkyrie","Blue Valkyrie","Bone Helm","Cat o Nine Tails Cap","Dark Lord Helm","Deviling Hat","Dragon Sun Helm","Evil Poring Hat","Green Valkyrie","Hokeage Hat","Kakashi Protector","Pirate Hat","Red Valkyrie","Skeggiold Cap","White Valkyrie","Yellow Valkyrie","Chii Hat","Earth Helm","Fabre Hat","Orange Hollow Mask","Squirting Poring","Violet Hat","Baby Bell","Bells of Harem","Big Back Ribbon","Black Hairband","Camoflage Hat","Carmen Hat","Choco Hat","Christmas Tree Hat","Chung E","Deporte Doll","Deviling Party Hat","Diadem","Dog Hat","Dowry","Drooping Amistr","Drooping Leaf Cat","Drooping Wild Rose","Drooping Ceb","Drooping Eddga","Drooping Gazel","Drooping Moonlight","Drooping Neko","Drooping Tiara","Fisherman","Floppy Bunny","Flying Angeling","Freya","Frog Doll","Ghostring Cap","Glarice Doll","Goat Horns","Heart Hat","Hello Mother","Hockey Mask","Hood of Shadows","Ice Cream","Incubus Doll","Irish Hat","Kamen Rider Helm","Kerchief","Kobold","Large Hibiscus","Leaf Tiara","Leopard Hat","Link Hat","Little Angel Doll","Loli Kitty","Luigi Cap","Maid Ribbon","Mario Cap","Metaling Party Hat","Mouse Hat","Panda Ears","Pig Hat","Pikachu","Pimp Cap","Poring Hat","Purple Hat","Reindeer Hat","Ribbon Wiz","Robo Headphones","Robo Headset","Snow Cap","Sorin Doll","Succubus Doll","Suke Cap","Tailring","Teddy Bear Ears","Twin Bunnies","Umbrella Hat","Victory Headband","Vinit Doll","W Doll","Yosh","Zealotus Doll","Black Beret","Blue Beret","Red Beret","White Beret","Blue Feather Beret","Bunny Mask","Cygnus","Kawaii Purple Ribbon","Kawaii Blue Ribbon","Kawaii Brown Ribon","Kawaii Green Ribbon","Kawaii Pink Ribbon","Kawaii White Ribbon","Marina Hat","Marshmallow","Mashimaro","Mudkip","Randgris","Neptune Protector","Danzo Bandage","Akatsuki Hat","Creed Helm","Freestyle Headphones","Alucard Hat","Urahara Hat","Angel of Kindness","Ashura Fairy Hat","Black Mage Hat","Devil of Hatred","Dull Seracillas Ribbon","Garm Hat","Grand Peco Hairband","Magestic Goat","Maya Helm","Piamette Hairband","Black Magestic Goat","Black Dark Knight Mask","Black Pimp Ribbon","Bra Hat","Cyan Serpent Helmet","Divine Halo","Feather Ribbon","Gold Viking Helm","Gundam Boosters","Helm of Baal","Ifrit Helm","Kankuro Hood","Kanzashi April","Kanzashi August","Kanzashi December","Kanzashi February","Kanzashi January","Kanzashi July","Kanzashi June","Kanzashi March","Kanzashi May","Kanzashi November","Kanzashi October","Kanzashi September","Konoha Head Protector","Lost Warrior Helm","Nightingale Hat","Pantie Hat","Red Dragon Helm","Red Serpent Helmet","Angel Helmet","Black Butterfly Pin","Brown Butterfly Pin","Drag Helm","Elven Hat","Ghotic Ribbon","Green Butterfly Pin","Indian Headdress","Jeje","Leo","Nico","Reisz Helmet","Saiyan","Sheriff Hat","Snow Beanie","War Helm","War Helm of Flame","War Helm of Wolf","White Majestic Goat","De Cap","Death Angel","Goku Head","Red Headphones","Drooping Inchant","Black Headphones","Gold Headphones","Felinus","Lupus","Frog Umbrella","Domo Kun Hat","Bunny Hairpins","Neko Ring","White Kaho","Black Kaho"; setarray .@UpperD[0],1609,1610,1611,1614,1615,1616,1617,1619,1620,1621,1622,1623,1624,1625,1626,1627,1628,1629,1630,1631,1632,1633,1634,1635,1708,1711,1712,1713,1717,1719,1722,1723,1729,1731,1734,1736,1738,1743,1748,1750,1302,1306,1311,1315,1318,1320,1350,1352,1353,1354,1355,1356,1357,1358,1359,1363,1364,1365,1366,1367,1369,1370,1371,1372,1373,1374,1375,1376,1377,1378,1379,1380,1383,1384,1386,1387,1388,1390,1393,1394,1395,1396,1397,1398,1399,1400,1401,1402,1404,1405,1406,1407,1408,1409,1410,1411,1412,1413,1416,1418,1419,1420,1423,1424,1425,1426,1428,1429,1431,1433,1434,1436,1437,1438,1441,1442,1443,1444,1445,1446,1447,1451,1452,1453,1454,1455,1456,1460,1466,1467,1468,1469,1470,1471,1473,1474,1475,1476,1479,1483,1484,1486,1488,1489,1491,1516,1518,1520,1524,1528,1529,1531,1532,1538,1539,1541,1550,1551,1553,1554,1556,1560,1561,1563,1564,1566,1567,1569,1570,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1588,1590,1593,1596,1761,1764,1771,1784,1785,1791,1798,1803,1805,1809,1829,1839,1841,1843,1845,1853,1855,1859,1861,1869,1879,1882,1885,1654,1656,1657,1659,1660,1670,1673,1674,1676,1677,1678; set .@size, getarraysize(.@Upper$); for ( set .@i,0; .@i<.@size; set .@i,.@i+1 ) { set .@menu$, .@menu$ + (.@i?":":"") ; if ( .@UpperD[.@i] ) // found ! set .@menu$, .@menu$ + .@Upper$[.@i]; } set .@uchoice, select(.@menu$)-1; mes "You select " + .@Upper$[.@uchoice]; changelook 4, .@UpperD[.@uchoice]; close; Quote Link to comment Share on other sites More sharing options...
Emistry Posted October 23, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2371 Joined: 10/28/11 Last Seen: 4 hours ago Share Posted October 23, 2012 break it into 2 or more array or multiple menu selection...etc Quote Link to comment Share on other sites More sharing options...
ays297 Posted October 23, 2012 Group: Members Topic Count: 24 Topics Per Day: 0.00 Content Count: 49 Reputation: 0 Joined: 11/30/11 Last Seen: November 2, 2014 Author Share Posted October 23, 2012 I thought there was an easier way. That's what I did lol, thanks tho. Quote Link to comment Share on other sites More sharing options...
Emistry Posted October 23, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2371 Joined: 10/28/11 Last Seen: 4 hours ago Share Posted October 23, 2012 you can try this also...but i dunno what will be the result...never tried. trunk/src/map/script.c /// Maximum amount of elements in script arrays #define SCRIPT_MAX_ARRAYSIZE 128 increase the value of 128 ~ Quote Link to comment Share on other sites More sharing options...
ays297 Posted October 23, 2012 Group: Members Topic Count: 24 Topics Per Day: 0.00 Content Count: 49 Reputation: 0 Joined: 11/30/11 Last Seen: November 2, 2014 Author Share Posted October 23, 2012 Well, I do not want to cause any complications so it's fine. Thanks for the help. Btw, can I ask out of this topic? I have query_sql "SELECT `view` from `item_db` where `equip_locations` = 256 and `id` ='"+@upper_hg$+"'", ouchoice; What is the IF command if there's no query returned? Quote Link to comment Share on other sites More sharing options...
Emistry Posted October 23, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2371 Joined: 10/28/11 Last Seen: 4 hours ago Share Posted October 23, 2012 same way like others.... if( query_sql(........) ){ .............. }else{ ............. } Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted October 23, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted October 23, 2012 I think this board currently missing some members to explain more advance SQL commands prontera,153,187,5 script djsfhskfj 100,{ mes "search for a headgear name"; next; input .@search$; .@nb = query_sql( "select id, name_japanese, view from item_db where type = 5 and equip_locations & 256 and name_japanese like '%"+ escape_sql(.@search$) +"%' group by view order by id limit 128", .@id, .@name$, .@view ); .@menu$ = .@name$; for ( .@i = 1; .@i < .@nb; .@i++ ) .@menu$ = .@menu$ +":"+ .@name$[.@i]; set .@select, select( .@menu$ ) -1 ; changelook 4, .@view[ .@select ]; close; } actually I already started writing this before your post#5 if ( query_sql("select....", .@dummy ) <execute here if sql returns some value> >= 1 rows else <execute here if sql Does NOT return anything> 0 rows useful to check something like account created or not ... etc 1 Quote Link to comment Share on other sites More sharing options...
GmOcean Posted October 23, 2012 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share Posted October 23, 2012 (edited) While, you would still have to use multiple arrays to solve your problem, you can make it a bit more efficient, by not having to write multiple loops per array, if you use setd | getd. setarray array1[0],987,654,321; setarray array2[0],123,456,789; setarray array3[0],987,654,321; set arraycount,3; set .@a,1; L_ArrayLoop: for(set .@i,0; .@i<getarraysize( getd("array"+.@a+"") ); set .@i,.@i+1) {set .@menu$, .@menu$ + (.@i?":":""); if( getd("array"+.@a+"["+.@i+"]") ) // found {set .@menu$, .@menu$ + getd("array"+.@a+"["+.@i+"]");} }//end for(loop) set .@a,.@a+1; if( .@a < arraycount ){goto L_ArrayLoop;} // This will display after it's done with the array loop. blah blah blah As for the sql query thing, meh, i use sql quite a bit now for my scripts, but even still, it's only sub-par Edited October 23, 2012 by GmOcean Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted October 24, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted October 24, 2012 like I said, I want to give more examples of advance SQL commands select distinct left( name_japanese, 1 ) as aaa from item_db where type = 5 and equip_locations & 256 union select distinct left( name_japanese, 1 ) from item_db_re where type = 5 and equip_locations & 256 union select distinct left( name_japanese, 1 ) from item_db2 where type = 5 and equip_locations & 256 order by aaa; to select the left most alphabetical order then select id, name_japanese, view from item_db where type = 5 and equip_locations & 256 and left( name_japanese, 1 ) = 'a' union select id, name_japanese, view from item_db_re where type = 5 and equip_locations & 256 and left( name_japanese, 1 ) = 'a' union select id, name_japanese, view from item_db2 where type = 5 and equip_locations & 256 and left( name_japanese, 1 ) = 'a' group by view limit 128; to select all headgears that's start with A script prontera,153,187,5 script djsfhskfj 100,{ mes "select an order"; next; .@nb = query_sql("select distinct left( name_japanese, 1 ) as aaa from item_db where type = 5 and equip_locations & 256 union select distinct left( name_japanese, 1 ) from item_db_re where type = 5 and equip_locations & 256 union select distinct left( name_japanese, 1 ) from item_db2 where type = 5 and equip_locations & 256 order by aaa", .@alphabet$ ); .@menu$ = .@alphabet$; for ( .@i = 1; .@i < .@nb; .@i++ ) .@menu$ = .@menu$ +":"+ .@alphabet$[.@i]; .@select = select( .@menu$ ) -1; .@nb = query_sql("select id, name_japanese, view from item_db where type = 5 and equip_locations & 256 and left( name_japanese, 1 ) = '"+ .@alphabet$[.@select] +"' union select id, name_japanese, view from item_db_re where type = 5 and equip_locations & 256 and left( name_japanese, 1 ) = '"+ .@alphabet$[.@select] +"' union select id, name_japanese, view from item_db2 where type = 5 and equip_locations & 256 and left( name_japanese, 1 ) = '"+ .@alphabet$[.@select] +"' group by view limit 128", .@id, .@name$, .@view ); .@menu$ = .@name$; for ( .@i = 1; .@i < .@nb; .@i++ ) .@menu$ = .@menu$ +":"+ .@name$[.@i]; .@select = select( .@menu$ ) -1; changelook 4, .@view[.@select]; close; } can almost say this script no need to spend your time to write any more array and if your server add in more custom headgear, you don't have to spend your time adding itemid into this script as this script automatically detects the items you've added inside item_db2 SQL is most powerful in this kind of situation 1 Quote Link to comment Share on other sites More sharing options...
GmOcean Posted October 24, 2012 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share Posted October 24, 2012 *steals sql queries & releases optimized scripts* kidding lol, but those are rather useful, for projects i'm currently working on / have finished. Quote Link to comment Share on other sites More sharing options...
Question
ays297
I was making a menu based on my array. But it seems like that I went over the limit? What should I do?
Link to comment
Share on other sites
9 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.