Kid BaKa 0 Posted November 19, 2015 (edited) Good day, I was tried to make group for monster what allow to spawn them ( around 130 monster ) let's take these monsters as example 1275, 1521, 1737 I want script check if I input number on these group if I input 1737 check if the number on the group if the number on the group spawn it else stop and close __________ I know I can do it like that input .@monster;if ((.@monster == 1275) ||(.@monster == 1521) ||(.@monster == 1737) ||(.@monster == 1271) ||(.@monster == 1094) ||(.@monster == 1030) ||(.@monster == 1237) ||(.@monster == 1095) ||(.@monster == 1097) ||(.@monster == 1236) ||(.@monster == 2090) ||(.@monster == 1247) ||(.@monster == 1365) ||(.@monster == 1266) ||(.@monster == 2318) ||(.@monster == 1729) ||(.@monster == 1906) ||(.@monster == 1905) ||(.@monster == 2308) ||(.@monster == 1177) ||(.@monster == 1417) ||(.@monster == 1010) ||(.@monster == 1395) ||(.@monster == 2344) ||(.@monster == 1013) ||(.@monster == 1880) ||(.@monster == 2246) ||(.@monster == 1024) ||(.@monster == 1936) ||(.@monster == 1081) ||(.@monster == 1967) ||(.@monster == 1234) ||(.@monster == 1057) ||(.@monster == 1494) ||(.@monster == 1633) ||(.@monster == 1603) ||(.@monster == 1060) ||(.@monster == 1820) ||(.@monster == 1084) ||(.@monster == 1914) ||(.@monster == 1934) ||(.@monster == 1079) ||(.@monster == 1520) ||(.@monster == 2093) ||(.@monster == 2329) ||(.@monster == 2333) ||(.@monster == 1103) ||(.@monster == 1011) ||(.@monster == 1246) ||(.@monster == 1245) ||(.@monster == 1244) ||(.@monster == 1588) ||(.@monster == 1962) ||(.@monster == 1528) ||(.@monster == 1269) ||(.@monster == 1270) ||(.@monster == 1527) ||(.@monster == 1860) ||(.@monster == 1104) ||(.@monster == 1009) ||(.@monster == 1901) ||(.@monster == 1265) ||(.@monster == 1992) ||(.@monster == 1067) ||(.@monster == 1073) ||(.@monster == 2057) ||(.@monster == 1018) ||(.@monster == 1231) ||(.@monster == 2135) ||(.@monster == 1952) ||(.@monster == 1953) ||(.@monster == 1877) ||(.@monster == 1951) ||(.@monster == 1954) ||(.@monster == 2074) ||(.@monster == 1609) ||(.@monster == 1514) ||(.@monster == 2404) ||(.@monster == 1105) ||(.@monster == 1239) ||(.@monster == 1728) ||(.@monster == 1107) ||(.@monster == 1108) ||(.@monster == 1571) ||(.@monster == 1730) ||(.@monster == 1110) ||(.@monster == 2336) ||(.@monster == 1966) ||(.@monster == 2013) ||(.@monster == 2014) ||(.@monster == 1721) ||(.@monster == 1846) ||(.@monster == 1572) ||(.@monster == 1113) ||(.@monster == 1114) ||(.@monster == 1913) ||(.@monster == 1396) ||(.@monster == 1116) ||(.@monster == 1288) ||(.@monster == 1229) ||(.@monster == 1007) ||(.@monster == 1397) ||(.@monster == 1910) ||(.@monster == 1909) ||(.@monster == 1391) ||(.@monster == 1791) ||(.@monster == 1783) ||(.@monster == 1592) ||(.@monster == 1932) ||(.@monster == 2159) ||(.@monster == 1121) ||(.@monster == 2380) ||(.@monster == 1372) ||(.@monster == 2168) ||(.@monster == 2166) ||(.@monster == 2169) ||(.@monster == 2167) ||(.@monster == 1840) ||(.@monster == 1086) ||(.@monster == 1540) ||(.@monster == 1040) ||(.@monster == 1816) ||(.@monster == 1369) ||(.@monster == 1687) ||(.@monster == 1080) ||(.@monster == 1632) ||(.@monster == 1908) ||(.@monster == 1907) ||(.@monster == 1127) ||(.@monster == 1128) ||(.@monster == 2158) ||(.@monster == 1004) ||(.@monster == 2128) ||(.@monster == 2127) ||(.@monster == 2069) ||(.@monster == 2376) ||(.@monster == 2375) ||(.@monster == 1516) ||(.@monster == 2247) ||(.@monster == 3203) ||(.@monster == 1722) ||(.@monster == 2316) ||(.@monster == 1544) ||(.@monster == 1400) ||(.@monster == 1838) ||(.@monster == 1070) ||(.@monster == 1586) ||(.@monster == 1881) ||(.@monster == 1912) ||(.@monster == 2160) ||(.@monster == 1812) ||(.@monster == 1063) ||(.@monster == 1726) ||(.@monster == 1591) ||(.@monster == 1836) ||(.@monster == 1856) ||(.@monster == 1138) ||(.@monster == 1969) ||(.@monster == 1242) ||(.@monster == 1857) ||(.@monster == 1595) ||(.@monster == 1972) ||(.@monster == 1141) ||(.@monster == 1142) ||(.@monster == 1144) ||(.@monster == 1551) ||(.@monster == 1145) ||(.@monster == 1862) ||(.@monster == 1064) ||(.@monster == 1613) ||(.@monster == 1058) ||(.@monster == 1585) ||(.@monster == 1614) ||(.@monster == 1552) ||(.@monster == 1404) ||(.@monster == 1628) ||(.@monster == 1854) ||(.@monster == 1055) ||(.@monster == 1055) ||(.@monster == 1911) ||(.@monster == 1964) ||(.@monster == 2035) ||(.@monster == 2138) ||(.@monster == 2143) ||(.@monster == 2141) ||(.@monster == 2139) ||(.@monster == 2139) ||(.@monster == 2140) ||(.@monster == 1970) ||(.@monster == 3202) ||(.@monster == 2010) ||(.@monster == 1019) ||(.@monster == 1047) ||(.@monster == 1232) ||(.@monster == 1314) ||(.@monster == 1158) ||(.@monster == 1050) ||(.@monster == 1240) ||(.@monster == 1241) ||(.@monster == 1049) ||(.@monster == 1238) ||(.@monster == 1160) ||(.@monster == 1915) ||(.@monster == 1616) ||(.@monster == 1858) ||(.@monster == 1161) ||(.@monster == 1402) ||(.@monster == 1556) ||(.@monster == 1031) ||(.@monster == 1619) ||(.@monster == 1002) ||(.@monster == 1725) ||(.@monster == 1973) ||(.@monster == 2203) ||(.@monster == 1894) ||(.@monster == 1230) ||(.@monster == 1008) ||(.@monster == 2091) ||(.@monster == 2197) ||(.@monster == 1935) ||(.@monster == 1085) ||(.@monster == 1078) ||(.@monster == 1750) ||(.@monster == 1815) ||(.@monster == 1409) ||(.@monster == 1052) ||(.@monster == 1012) ||(.@monster == 1782) ||(.@monster == 1281) ||(.@monster == 1062) ||(.@monster == 1166) ||(.@monster == 1167) ||(.@monster == 1727) ||(.@monster == 2083) ||(.@monster == 2084) ||(.@monster == 2089) ||(.@monster == 2088) ||(.@monster == 1074) ||(.@monster == 1878) ||(.@monster == 1083) ||(.@monster == 2199) ||(.@monster == 1776) ||(.@monster == 1076) ||(.@monster == 1561) ||(.@monster == 1056) ||(.@monster == 1811) ||(.@monster == 1025) ||(.@monster == 1841) ||(.@monster == 1842) ||(.@monster == 1792) ||(.@monster == 2379) ||(.@monster == 1170) ||(.@monster == 1316) ||(.@monster == 1014) ||(.@monster == 1690) ||(.@monster == 1863) ||(.@monster == 1322) ||(.@monster == 1174) ||(.@monster == 1278) ||(.@monster == 1784) ||(.@monster == 1280) ||(.@monster == 1042) ||(.@monster == 1968) ||(.@monster == 2081) ||(.@monster == 1187) ||(.@monster == 2002) ||(.@monster == 1175) ||(.@monster == 1997) ||(.@monster == 1986) ||(.@monster == 1034) ||(.@monster == 1051) ||(.@monster == 1048) ||(.@monster == 1053) ||(.@monster == 1182) ||(.@monster == 1845) ||(.@monster == 1902) ||(.@monster == 1903) ||(.@monster == 1338) ||(.@monster == 1343) ||(.@monster == 1938) ||(.@monster == 1348) ||(.@monster == 1943) ||(.@monster == 1353) ||(.@monster == 1326) ||(.@monster == 1358) ||(.@monster == 1363) ||(.@monster == 1331) ||(.@monster == 1336) ||(.@monster == 1341) ||(.@monster == 1346) ||(.@monster == 1941) ||(.@monster == 1351) ||(.@monster == 1946) ||(.@monster == 1356) ||(.@monster == 1955) ||(.@monster == 1324) ||(.@monster == 1361) ||(.@monster == 1329) ||(.@monster == 1334) ||(.@monster == 1339) ||(.@monster == 1939) ||(.@monster == 1344) ||(.@monster == 1944) ||(.@monster == 1349) ||(.@monster == 1354) ||(.@monster == 1327) ||(.@monster == 1359) ||(.@monster == 1332) ||(.@monster == 1798) ||(.@monster == 1337) ||(.@monster == 1342) ||(.@monster == 1347) ||(.@monster == 1942) ||(.@monster == 1352) ||(.@monster == 1325) ||(.@monster == 1325) ||(.@monster == 1362) ||(.@monster == 1330) ||(.@monster == 1335) ||(.@monster == 1340) ||(.@monster == 1345) ||(.@monster == 1940) ||(.@monster == 1350) ||(.@monster == 1945) ||(.@monster == 1355) ||(.@monster == 1732) ||(.@monster == 1328) ||(.@monster == 1360) ||(.@monster == 1333) ||(.@monster == 2288) ||(.@monster == 2335) ||(.@monster == 1066) ||(.@monster == 1971) ||(.@monster == 1032) ||(.@monster == 1176) ||(.@monster == 1398) ||(.@monster == 2150) ||(.@monster == 2405) ||(.@monster == 1185) ||(.@monster == 1082) ||(.@monster == 2025) ||(.@monster == 1413) ||(.@monster == 1565) ||(.@monster == 1965) ||(.@monster == 1261)) {atcommand spwan .@monster;} else { close;} but I want see if there is otherway to do it these ID for all unaggressive monsters what I want allow to spawn them //setarray .unaggressive$[0], 1275, 1521, 1737, 1271, 1094, 1030, 1237, 1095, 1097, 1236, 2090, 1247, 1365, 1266, 2318, 1729, 1906, 1905, 2308, 1177, 1417, 1010, 1395, 2344, 1013, 1880, 2246, 1024, 1936, 1081, 1967, 1234, 1057, 1494, 1633, 1603, 1060, 1359, 1332, 1798, 1337, 1342, 1347, 1942, 1352, 1325, 1325, 1362, 1330, 1335, 1340, 1345, 1940, 1350, 1945, 1355, 1732, 1328, 1360, 1333, 2288, 2335, 1066, 1971, 1032, 1176, 1398, 2150, 2405, 1185, 1082, 2025, 1413, 1565, 1965, 1261, 1820, 1084, 1914, 1934, 1079, 1520, 2093, 2329, 2333, 1103, 1011, 1246, 1245, 1244, 1588, 1962, 1528, 1269, 1270, 1527, 1860, 1104, 1009, 1901, 1265, 1992, 1067, 1073, 2057, 1018, 1231, 2135, 1952, 1953, 1877, 1951, 1954, 2074, 1609, 1514, 2404, 1105, 1239, 1728, 1107, 1108, 1571, 1730, 1110, 2336, 1966, 2013, 2014, 1721, 1846, 1572, 1113, 1114, 1913, 1396, 1116, 1288, 1229, 1007, 1397, 1910, 1909, 1391, 1791, 1783, 1592, 1932, 2159, 1121, 2380, 1372, 1986, 1034, 1051, 1048, 1053, 1182, 1845, 1902, 1903, 1338, 1343, 1938, 1348, 1329, 1334, 1339, 1939, 1344, 1944, 1349, 1354;//setarray .unaggressive$[1], 2168, 2166, 2169, 2167, 1840, 1086, 1540, 1040, 1816, 1369, 1687, 1080, 1632, 1908, 1907, 1127, 1128, 2158, 1004, 2128, 2127, 2069, 2376, 2375, 1516, 2247, 3203, 1722, 2316, 1544, 1400, 1838, 1070, 1586, 1881, 1912, 2160, 1812, 1063, 1726, 1591, 1836, 1856, 1138, 1969, 1242, 1857, 1595, 1972, 1141, 1142, 1144, 1551, 1145, 1862, 1064, 1613, 1058, 1585, 1614, 1552, 1404, 1628, 1854, 1055, 1055, 1911, 1964, 2035, 2138, 2143, 2141, 2139, 2139, 2140, 1970, 3202, 2010, 1019, 1047, 1232, 1314, 1158, 1050, 1240, 1241, 1049, 1238, 1160, 1915, 1616, 1858, 1161, 1402, 1556, 1031, 1619, 1002, 1725, 1973, 2203, 1894, 1230, 1008, 2091, 2197, 1935, 1085, 1078, 1750, 1815, 1409, 1052, 1012, 1782, 1281, 1062, 1166, 1167, 1727, 2083, 2084, 2089, 2088, 1074, 1878, 1083, 2199, 1776, 1076, 1561, 1056, 1811, 1025, 1841, 1842, 1792, 2379, 1170, 1316, 1014, 1690, 1863, 1322, 1174, 1278, 1784, 1280, 1042, 1968, 2081, 1187, 2002, 1175, 1997, 1943, 1353, 1326, 1358, 1363, 1331, 1336, 1341, 1346, 1941, 1351, 1946, 1356, 1955, 1324, 1361, 1327; Regards Edited November 19, 2015 by Kid BaKa Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted November 19, 2015 if you consider using SQL, then it is pretty neat prontera,155,189,5 script kshdfksjdf 1_F_MARIA,{ mes "input a mob ID"; mes "if your inputed mob ID is a non-aggresive mob, I'll say 'OK'"; next; input .@id, 1000, 5000; if ( query_sql( "select 1 from mob_db where mode & 0x4 = 0 and id = "+ .@id, .@dummy ) ) mes "OK"; else mes "bleh"; close;}otherwise if your list is custom made, then have to loop the arrayprontera,155,189,5 script kshdfksjdf 1_F_MARIA,{ mes "input a mob ID"; mes "if your inputed mob ID is a non-aggresive mob, I'll say 'OK'"; next; input .@id, 1000, 5000; while ( .mob_id[.@i] != .@id && .@i < .mob_size ) .@i++; if ( .@i < .mob_size ) mes "OK"; else mes "bleh"; close;OnInit: .mob_size = query_sql( "select ID from mob_db where mode & 0x4 = 0", .mob_id ); // change this to your setarray end;}but it seems you got your own ID, then have to loop it 1 Kid BaKa reacted to this Quote Share this post Link to post Share on other sites
0 Asheraf 123 Posted November 19, 2015 (edited) *Deleted* Edited November 19, 2015 by Asheraf Quote Share this post Link to post Share on other sites
0 Kid BaKa 0 Posted November 19, 2015 so thanks it's work I tried by using for could you tell me what is the differents between for and while Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted November 19, 2015 while ( compare the value && loop until last index ) .@i++;if ( .@i < last index ) <is in the array>;actually that's my trickthere's a flaw in this method because if the value is not in the array, it will compare 1 extra time, and possibly throw error on certain script commands like *getmonsterinfo its better to do the actual way for ( .@i = 0; .@i < .max_value; ++.@i ) if ( .mob_id[.@i] == .@id ) break;if ( .@i < .max_value ) <is in the array>;never have problem with this one well .. what you are asking ... better ask google XD https://www.codecademy.com/forum_questions/510e3c1a3011b8fa25005255 ... try google more ================================= btw that query has more than 400 results, so player might summon .... event mobs for example 1 Kid BaKa reacted to this Quote Share this post Link to post Share on other sites
Good day,
I was tried to make group for monster what allow to spawn them ( around 130 monster )
let's take these monsters as example
1275, 1521, 1737
I want script check if I input number on these group
if I input 1737
check if the number on the group
if the number on the group spawn it
else stop and close
__________
I know I can do it like that
but I want see if there is otherway to do it
these ID for all unaggressive monsters what I want allow to spawn them
Regards
Edited by Kid BaKaShare this post
Link to post
Share on other sites