Sallycantdance Posted October 6, 2022 Group: Members Topic Count: 224 Topics Per Day: 0.14 Content Count: 796 Reputation: 12 Joined: 12/04/20 Last Seen: Tuesday at 02:01 PM Share Posted October 6, 2022 hello i would like to ask if theres an npc that can count an specific item same as @analyzeitem but the difference was it was an npc Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted October 8, 2022 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10017 Reputation: 2368 Joined: 10/28/11 Last Seen: Tuesday at 02:49 PM Share Posted October 8, 2022 //===== rAthena Script ======================================= //= Free Script //===== By: ================================================== //= Sader1992 //= https://rathena.org/board/profile/30766-sader1992/ //= Email [email protected] //===== Compatible With: ===================================== //= rAthena Project //= ========================================================== //= @aitem this command allows you to check how many of the item in the server //= command @aitem2 allows you to check also who have the items //= @aitem is fast, but @aitem2 will take some time to finish //= the time depend on how big your database is! //= ========================================================== //= you should wait until the command is done , do not logout/talk to npc/ anything until you get the results! //= ========================================================== //= '@AnalyzeItem' return the count of the item in the server. //= '@AnalyzeItem2' return the count of the item and the lst of who have it in the server (take more time). //= USAGE: //= @AnalyzeItem <ITEM_ID> //= @AnalyzeItem2 <ITEM_ID> //= OR //= @AItem <ITEM_ID> //= @AItem2 <ITEM_ID> //= Wait until you get the results in your chat //= to add more tables (like other storages) check the array .@tables$ and .@id$ //= F_GET_REAL_OWNER_NAME(<"string table">,<id>) get the name for id //============================================================ function script F_GET_REAL_OWNER_NAME { .@table$ = getarg(0); .@id = getarg(1); .@n$ = ""; if(.@table$ != "account_id" && .@table$ != "char_id"){ if(.@table$ != "id"){ return "(Mails):"; }else{ return "(Guilds):"; } } .@acc = .@id; if(.@table$ == "char_id"){ query_sql("SELECT `account_id` FROM `char` WHERE `char_id` = '" + .@id + "'",.@acc); } query_sql("SELECT `group_id`,`userid` FROM `login` WHERE `account_id` = '" + .@acc + "'",.@g,.@name$); if(.@g >= 1){ .@n$ = "[ Player ] "; } if(.@g >= 80){ .@n$ = "[ Staff ] "; } .@name1$ = .@n$ + .@name$; return .@name1$; } prontera,155,181,5 script Sample 757,{ input .@item_id; .@owner_name = select("Continue", "Get Real Owner Name") - 1; setarray .@tables$,"cart_inventory","guild_storage","inventory","storage", "mail_attachments"; setarray .@id$, "char_id", "guild_id", "char_id", "account_id","id"; mes "Searching for item '" + getitemname(.@item_id) + "'",0x9FFFB5; mes "Analyze Tables",0x9FFFB5; for(.@i=0;.@i<getarraysize(.@tables$);.@i++){ query_sql("SELECT `amount`,`" + .@id$[.@i] + "` FROM `" + .@tables$[.@i] + "` WHERE nameid = '"+ .@item_id +"'", .@count,.@id); for(.@n=0;.@n<getarraysize(.@count);.@n++){ .@allcounts += .@count[.@n]; if(.@owner_name){ .@n$ = F_GET_REAL_OWNER_NAME(.@id$[.@i],.@id[.@n]); .@ndx = inarray(.@name_list$,.@n$); if(.@ndx == -1){ .@ndx = getarraysize(.@name_list$); .@name_list$[.@ndx] = .@n$; } .@count_list[.@ndx] += .@count[.@n]; sleep2 2; } } sleep2 5; deletearray .@count[0],getarraysize(.@count); } if(.@owner_name){ mes "==================================",0x9FFFB5; mes "Extended List:",0x9FFFB5; if(getarraysize(.@name_list$) > 20){ for(.@i=0;.@i<getarraysize(.@name_list$);.@i += 3){ mes "" + .@name_list$[.@i] + " - (" + .@count_list[.@i] + ")" + " " + "(" + .@name_list$[.@i+1] + "): (" + .@count_list[.@i+1] + ")" + " " + "(" + .@name_list$[.@i+2] + "): (" + .@count_list[.@i+2] + ")",0x9FFFB5; } }else{ for(.@i=0;.@i<getarraysize(.@name_list$);.@i++){ mes "" + .@name_list$[.@i] + " - (" + .@count_list[.@i] + ")"; } } mes "==================================",0x9FFFB5; } mes "Analyze Done.",0x9FFFB5; mes "(" + .@allcounts + ")" + getitemname(.@item_id) + ".",0x9FFFB5; close; } 1 Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted October 7, 2022 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10017 Reputation: 2368 Joined: 10/28/11 Last Seen: Tuesday at 02:49 PM Share Posted October 7, 2022 just change the floating npc script into a npc with location Quote Link to comment Share on other sites More sharing options...
0 Sallycantdance Posted October 8, 2022 Group: Members Topic Count: 224 Topics Per Day: 0.14 Content Count: 796 Reputation: 12 Joined: 12/04/20 Last Seen: Tuesday at 02:01 PM Author Share Posted October 8, 2022 10 hours ago, Emistry said: just change the floating npc script into a npc with location Analyze.txthello sir emistry i ready dont know where to start can you help me? Quote Link to comment Share on other sites More sharing options...
0 Sallycantdance Posted October 8, 2022 Group: Members Topic Count: 224 Topics Per Day: 0.14 Content Count: 796 Reputation: 12 Joined: 12/04/20 Last Seen: Tuesday at 02:01 PM Author Share Posted October 8, 2022 2 hours ago, Emistry said: //===== rAthena Script ======================================= //= Free Script //===== By: ================================================== //= Sader1992 //= https://rathena.org/board/profile/30766-sader1992/ //= Email [email protected] //===== Compatible With: ===================================== //= rAthena Project //= ========================================================== //= @aitem this command allows you to check how many of the item in the server //= command @aitem2 allows you to check also who have the items //= @aitem is fast, but @aitem2 will take some time to finish //= the time depend on how big your database is! //= ========================================================== //= you should wait until the command is done , do not logout/talk to npc/ anything until you get the results! //= ========================================================== //= '@AnalyzeItem' return the count of the item in the server. //= '@AnalyzeItem2' return the count of the item and the lst of who have it in the server (take more time). //= USAGE: //= @AnalyzeItem <ITEM_ID> //= @AnalyzeItem2 <ITEM_ID> //= OR //= @AItem <ITEM_ID> //= @AItem2 <ITEM_ID> //= Wait until you get the results in your chat //= to add more tables (like other storages) check the array .@tables$ and .@id$ //= F_GET_REAL_OWNER_NAME(<"string table">,<id>) get the name for id //============================================================ function script F_GET_REAL_OWNER_NAME { .@table$ = getarg(0); .@id = getarg(1); .@n$ = ""; if(.@table$ != "account_id" && .@table$ != "char_id"){ if(.@table$ != "id"){ return "(Mails):"; }else{ return "(Guilds):"; } } .@acc = .@id; if(.@table$ == "char_id"){ query_sql("SELECT `account_id` FROM `char` WHERE `char_id` = '" + .@id + "'",.@acc); } query_sql("SELECT `group_id`,`userid` FROM `login` WHERE `account_id` = '" + .@acc + "'",.@g,.@name$); if(.@g >= 1){ .@n$ = "[ Player ] "; } if(.@g >= 80){ .@n$ = "[ Staff ] "; } .@name1$ = .@n$ + .@name$; return .@name1$; } prontera,155,181,5 script Sample 757,{ input .@item_id; .@owner_name = select("Continue", "Get Real Owner Name") - 1; setarray .@tables$,"cart_inventory","guild_storage","inventory","storage", "mail_attachments"; setarray .@id$, "char_id", "guild_id", "char_id", "account_id","id"; mes "Searching for item '" + getitemname(.@item_id) + "'",0x9FFFB5; mes "Analyze Tables",0x9FFFB5; for(.@i=0;.@i<getarraysize(.@tables$);.@i++){ query_sql("SELECT `amount`,`" + .@id$[.@i] + "` FROM `" + .@tables$[.@i] + "` WHERE nameid = '"+ .@item_id +"'", .@count,.@id); for(.@n=0;.@n<getarraysize(.@count);.@n++){ .@allcounts += .@count[.@n]; if(.@owner_name){ .@n$ = F_GET_REAL_OWNER_NAME(.@id$[.@i],.@id[.@n]); .@ndx = inarray(.@name_list$,.@n$); if(.@ndx == -1){ .@ndx = getarraysize(.@name_list$); .@name_list$[.@ndx] = .@n$; } .@count_list[.@ndx] += .@count[.@n]; sleep2 2; } } sleep2 5; deletearray .@count[0],getarraysize(.@count); } if(.@owner_name){ mes "==================================",0x9FFFB5; mes "Extended List:",0x9FFFB5; if(getarraysize(.@name_list$) > 20){ for(.@i=0;.@i<getarraysize(.@name_list$);.@i += 3){ mes "" + .@name_list$[.@i] + " - (" + .@count_list[.@i] + ")" + " " + "(" + .@name_list$[.@i+1] + "): (" + .@count_list[.@i+1] + ")" + " " + "(" + .@name_list$[.@i+2] + "): (" + .@count_list[.@i+2] + ")",0x9FFFB5; } }else{ for(.@i=0;.@i<getarraysize(.@name_list$);.@i++){ mes "" + .@name_list$[.@i] + " - (" + .@count_list[.@i] + ")"; } } mes "==================================",0x9FFFB5; } mes "Analyze Done.",0x9FFFB5; mes "(" + .@allcounts + ")" + getitemname(.@item_id) + ".",0x9FFFB5; close; } thank you sir emistry one more question what is the meaning of this 10485685 Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted October 8, 2022 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10017 Reputation: 2368 Joined: 10/28/11 Last Seen: Tuesday at 02:49 PM Share Posted October 8, 2022 remove all ,0x9FFFB5 behind the mes(...) 1 Quote Link to comment Share on other sites More sharing options...
0 Sallycantdance Posted October 8, 2022 Group: Members Topic Count: 224 Topics Per Day: 0.14 Content Count: 796 Reputation: 12 Joined: 12/04/20 Last Seen: Tuesday at 02:01 PM Author Share Posted October 8, 2022 3 hours ago, Emistry said: //===== rAthena Script ======================================= //= Free Script //===== By: ================================================== //= Sader1992 //= https://rathena.org/board/profile/30766-sader1992/ //= Email [email protected] //===== Compatible With: ===================================== //= rAthena Project //= ========================================================== //= @aitem this command allows you to check how many of the item in the server //= command @aitem2 allows you to check also who have the items //= @aitem is fast, but @aitem2 will take some time to finish //= the time depend on how big your database is! //= ========================================================== //= you should wait until the command is done , do not logout/talk to npc/ anything until you get the results! //= ========================================================== //= '@AnalyzeItem' return the count of the item in the server. //= '@AnalyzeItem2' return the count of the item and the lst of who have it in the server (take more time). //= USAGE: //= @AnalyzeItem <ITEM_ID> //= @AnalyzeItem2 <ITEM_ID> //= OR //= @AItem <ITEM_ID> //= @AItem2 <ITEM_ID> //= Wait until you get the results in your chat //= to add more tables (like other storages) check the array .@tables$ and .@id$ //= F_GET_REAL_OWNER_NAME(<"string table">,<id>) get the name for id //============================================================ function script F_GET_REAL_OWNER_NAME { .@table$ = getarg(0); .@id = getarg(1); .@n$ = ""; if(.@table$ != "account_id" && .@table$ != "char_id"){ if(.@table$ != "id"){ return "(Mails):"; }else{ return "(Guilds):"; } } .@acc = .@id; if(.@table$ == "char_id"){ query_sql("SELECT `account_id` FROM `char` WHERE `char_id` = '" + .@id + "'",.@acc); } query_sql("SELECT `group_id`,`userid` FROM `login` WHERE `account_id` = '" + .@acc + "'",.@g,.@name$); if(.@g >= 1){ .@n$ = "[ Player ] "; } if(.@g >= 80){ .@n$ = "[ Staff ] "; } .@name1$ = .@n$ + .@name$; return .@name1$; } prontera,155,181,5 script Sample 757,{ input .@item_id; .@owner_name = select("Continue", "Get Real Owner Name") - 1; setarray .@tables$,"cart_inventory","guild_storage","inventory","storage", "mail_attachments"; setarray .@id$, "char_id", "guild_id", "char_id", "account_id","id"; mes "Searching for item '" + getitemname(.@item_id) + "'",0x9FFFB5; mes "Analyze Tables",0x9FFFB5; for(.@i=0;.@i<getarraysize(.@tables$);.@i++){ query_sql("SELECT `amount`,`" + .@id$[.@i] + "` FROM `" + .@tables$[.@i] + "` WHERE nameid = '"+ .@item_id +"'", .@count,.@id); for(.@n=0;.@n<getarraysize(.@count);.@n++){ .@allcounts += .@count[.@n]; if(.@owner_name){ .@n$ = F_GET_REAL_OWNER_NAME(.@id$[.@i],.@id[.@n]); .@ndx = inarray(.@name_list$,.@n$); if(.@ndx == -1){ .@ndx = getarraysize(.@name_list$); .@name_list$[.@ndx] = .@n$; } .@count_list[.@ndx] += .@count[.@n]; sleep2 2; } } sleep2 5; deletearray .@count[0],getarraysize(.@count); } if(.@owner_name){ mes "==================================",0x9FFFB5; mes "Extended List:",0x9FFFB5; if(getarraysize(.@name_list$) > 20){ for(.@i=0;.@i<getarraysize(.@name_list$);.@i += 3){ mes "" + .@name_list$[.@i] + " - (" + .@count_list[.@i] + ")" + " " + "(" + .@name_list$[.@i+1] + "): (" + .@count_list[.@i+1] + ")" + " " + "(" + .@name_list$[.@i+2] + "): (" + .@count_list[.@i+2] + ")",0x9FFFB5; } }else{ for(.@i=0;.@i<getarraysize(.@name_list$);.@i++){ mes "" + .@name_list$[.@i] + " - (" + .@count_list[.@i] + ")"; } } mes "==================================",0x9FFFB5; } mes "Analyze Done.",0x9FFFB5; mes "(" + .@allcounts + ")" + getitemname(.@item_id) + ".",0x9FFFB5; close; } savage thank you very much master emistry ! Quote Link to comment Share on other sites More sharing options...
0 friomixx Posted December 23, 2022 Group: Members Topic Count: 10 Topics Per Day: 0.00 Content Count: 20 Reputation: 0 Joined: 03/02/12 Last Seen: Saturday at 04:22 PM Share Posted December 23, 2022 On 10/8/2022 at 4:27 PM, Emistry said: //===== rAthena Script ======================================= //= Free Script //===== By: ================================================== //= Sader1992 //= https://rathena.org/board/profile/30766-sader1992/ //= Email [email protected] //===== Compatible With: ===================================== //= rAthena Project //= ========================================================== //= @aitem this command allows you to check how many of the item in the server //= command @aitem2 allows you to check also who have the items //= @aitem is fast, but @aitem2 will take some time to finish //= the time depend on how big your database is! //= ========================================================== //= you should wait until the command is done , do not logout/talk to npc/ anything until you get the results! //= ========================================================== //= '@AnalyzeItem' return the count of the item in the server. //= '@AnalyzeItem2' return the count of the item and the lst of who have it in the server (take more time). //= USAGE: //= @AnalyzeItem <ITEM_ID> //= @AnalyzeItem2 <ITEM_ID> //= OR //= @AItem <ITEM_ID> //= @AItem2 <ITEM_ID> //= Wait until you get the results in your chat //= to add more tables (like other storages) check the array .@tables$ and .@id$ //= F_GET_REAL_OWNER_NAME(<"string table">,<id>) get the name for id //============================================================ function script F_GET_REAL_OWNER_NAME { .@table$ = getarg(0); .@id = getarg(1); .@n$ = ""; if(.@table$ != "account_id" && .@table$ != "char_id"){ if(.@table$ != "id"){ return "(Mails):"; }else{ return "(Guilds):"; } } .@acc = .@id; if(.@table$ == "char_id"){ query_sql("SELECT `account_id` FROM `char` WHERE `char_id` = '" + .@id + "'",.@acc); } query_sql("SELECT `group_id`,`userid` FROM `login` WHERE `account_id` = '" + .@acc + "'",.@g,.@name$); if(.@g >= 1){ .@n$ = "[ Player ] "; } if(.@g >= 80){ .@n$ = "[ Staff ] "; } .@name1$ = .@n$ + .@name$; return .@name1$; } prontera,155,181,5 script Sample 757,{ input .@item_id; .@owner_name = select("Continue", "Get Real Owner Name") - 1; setarray .@tables$,"cart_inventory","guild_storage","inventory","storage", "mail_attachments"; setarray .@id$, "char_id", "guild_id", "char_id", "account_id","id"; mes "Searching for item '" + getitemname(.@item_id) + "'",0x9FFFB5; mes "Analyze Tables",0x9FFFB5; for(.@i=0;.@i<getarraysize(.@tables$);.@i++){ query_sql("SELECT `amount`,`" + .@id$[.@i] + "` FROM `" + .@tables$[.@i] + "` WHERE nameid = '"+ .@item_id +"'", .@count,.@id); for(.@n=0;.@n<getarraysize(.@count);.@n++){ .@allcounts += .@count[.@n]; if(.@owner_name){ .@n$ = F_GET_REAL_OWNER_NAME(.@id$[.@i],.@id[.@n]); .@ndx = inarray(.@name_list$,.@n$); if(.@ndx == -1){ .@ndx = getarraysize(.@name_list$); .@name_list$[.@ndx] = .@n$; } .@count_list[.@ndx] += .@count[.@n]; sleep2 2; } } sleep2 5; deletearray .@count[0],getarraysize(.@count); } if(.@owner_name){ mes "==================================",0x9FFFB5; mes "Extended List:",0x9FFFB5; if(getarraysize(.@name_list$) > 20){ for(.@i=0;.@i<getarraysize(.@name_list$);.@i += 3){ mes "" + .@name_list$[.@i] + " - (" + .@count_list[.@i] + ")" + " " + "(" + .@name_list$[.@i+1] + "): (" + .@count_list[.@i+1] + ")" + " " + "(" + .@name_list$[.@i+2] + "): (" + .@count_list[.@i+2] + ")",0x9FFFB5; } }else{ for(.@i=0;.@i<getarraysize(.@name_list$);.@i++){ mes "" + .@name_list$[.@i] + " - (" + .@count_list[.@i] + ")"; } } mes "==================================",0x9FFFB5; } mes "Analyze Done.",0x9FFFB5; mes "(" + .@allcounts + ")" + getitemname(.@item_id) + ".",0x9FFFB5; close; } is there a way to count as well those cards that are already attached in the item? Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted January 13, 2023 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10017 Reputation: 2368 Joined: 10/28/11 Last Seen: Tuesday at 02:49 PM Share Posted January 13, 2023 On 12/24/2022 at 3:40 AM, friomixx said: is there a way to count as well those cards that are already attached in the item? try this //===== rAthena Script ======================================= //= Free Script //===== By: ================================================== //= Sader1992 //= https://rathena.org/board/profile/30766-sader1992/ //= Email [email protected] //===== Compatible With: ===================================== //= rAthena Project //= ========================================================== //= @aitem this command allows you to check how many of the item in the server //= command @aitem2 allows you to check also who have the items //= @aitem is fast, but @aitem2 will take some time to finish //= the time depend on how big your database is! //= ========================================================== //= you should wait until the command is done , do not logout/talk to npc/ anything until you get the results! //= ========================================================== //= '@AnalyzeItem' return the count of the item in the server. //= '@AnalyzeItem2' return the count of the item and the lst of who have it in the server (take more time). //= USAGE: //= @AnalyzeItem <ITEM_ID> //= @AnalyzeItem2 <ITEM_ID> //= OR //= @AItem <ITEM_ID> //= @AItem2 <ITEM_ID> //= Wait until you get the results in your chat //= to add more tables (like other storages) check the array .@tables$ and .@id$ //= F_GET_REAL_OWNER_NAME(<"string table">,<id>) get the name for id //============================================================ function script F_GET_REAL_OWNER_NAME { .@table$ = getarg(0); .@id = getarg(1); .@n$ = ""; if(.@table$ != "account_id" && .@table$ != "char_id"){ if(.@table$ != "id"){ return "(Mails):"; }else{ return "(Guilds):"; } } .@acc = .@id; if(.@table$ == "char_id"){ query_sql("SELECT `account_id` FROM `char` WHERE `char_id` = '" + .@id + "'",.@acc); } query_sql("SELECT `group_id`,`userid` FROM `login` WHERE `account_id` = '" + .@acc + "'",.@g,.@name$); if(.@g >= 1){ .@n$ = "[ Player ] "; } if(.@g >= 80){ .@n$ = "[ Staff ] "; } .@name1$ = .@n$ + .@name$; return .@name1$; } prontera,155,181,5 script Sample 757,{ input .@item_id; .@owner_name = select("Continue", "Get Real Owner Name") - 1; setarray .@tables$,"cart_inventory","guild_storage","inventory","storage", "mail_attachments"; setarray .@id$, "char_id", "guild_id", "char_id", "account_id","id"; mes "Searching for item '" + getitemname(.@item_id) + "'",0x9FFFB5; mes "Analyze Tables",0x9FFFB5; for(.@i=0;.@i<getarraysize(.@tables$);.@i++){ query_sql("SELECT `amount`,`" + .@id$[.@i] + "` FROM `" + .@tables$[.@i] + "` WHERE nameid = '"+ .@item_id +"' OR card0 = "+.@item_id+" OR card1 = "+.@item_id+" OR card2 = "+.@item_id+" OR card3 = "+.@item_id, .@count, .@id, .@c0, .@c1, .@c2, .@c3); for(.@n=0;.@n<getarraysize(.@count);.@n++){ if (.@id[.@n] != .@item_id) { .@allcounts += (.@c0[.@n] == .@item_id); .@allcounts += (.@c1[.@n] == .@item_id); .@allcounts += (.@c2[.@n] == .@item_id); .@allcounts += (.@c3[.@n] == .@item_id); } else .@allcounts += .@count[.@n]; if(.@owner_name){ .@n$ = F_GET_REAL_OWNER_NAME(.@id$[.@i],.@id[.@n]); .@ndx = inarray(.@name_list$,.@n$); if(.@ndx == -1){ .@ndx = getarraysize(.@name_list$); .@name_list$[.@ndx] = .@n$; } .@count_list[.@ndx] += .@count[.@n]; sleep2 2; } } sleep2 5; deletearray .@count[0],getarraysize(.@count); } if(.@owner_name){ mes "==================================",0x9FFFB5; mes "Extended List:",0x9FFFB5; if(getarraysize(.@name_list$) > 20){ for(.@i=0;.@i<getarraysize(.@name_list$);.@i += 3){ mes "" + .@name_list$[.@i] + " - (" + .@count_list[.@i] + ")" + " " + "(" + .@name_list$[.@i+1] + "): (" + .@count_list[.@i+1] + ")" + " " + "(" + .@name_list$[.@i+2] + "): (" + .@count_list[.@i+2] + ")",0x9FFFB5; } }else{ for(.@i=0;.@i<getarraysize(.@name_list$);.@i++){ mes "" + .@name_list$[.@i] + " - (" + .@count_list[.@i] + ")"; } } mes "==================================",0x9FFFB5; } mes "Analyze Done.",0x9FFFB5; mes "(" + .@allcounts + ")" + getitemname(.@item_id) + ".",0x9FFFB5; close; } 1 Quote Link to comment Share on other sites More sharing options...
Question
Sallycantdance
hello i would like to ask if theres an npc that can count an specific item same as @analyzeitem but the difference was it was an npc
Link to comment
Share on other sites
8 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.