Popular Post AnnieRuru Posted February 4, 2013 Popular Post Posted February 4, 2013 (edited) these are mostly unpopular scripts that probably not getting a lot of replies more popular ones will be in separated topics getitemname2 function for the moment use version 2.4 original topic in eathena it just can show the item names exactly like it was display at client side ... and version 2 has color code for display inside npc dialog Reference: to faster get the prefix name for eathena process open kro\data\cardprefixnametable.txt, use notepad++, find with regular expression ([0-9]*)#([a-z '-]*)# replace with setd "$@cardprefix"+ \1 +"$", "\2"; and to add different group of unidentified headgears, change Line [0-9]+: ([0-9]+)#[a-z_]*# into .@id == \1 || credit to azara Archive: 1.0 getitemname2_1.0.txt --- initial release 2.0 getitemname2_2.0.txt --- reduce gotocount in checking item type, card name, card amount, and crafted info ------ priority item types, eg: etc items is conditioned 1st, carded equipment next, signed equipment conditioned last ------ in carded equipment check, priority equipment with only 1 type of card each, 4 same cards conditioned last ------ in signed item check, priority etc items that has no star crumb or elemental --- change VS into Very Strong, it was copy pasted from my itemlist script lol --- added a temporal array for a more detailed item info --- fix a bug that carded etc items show card name 2.1 getitemname2_2.1.txt --- reduce gotocount by using Keyworld's <- lol !! method --- make unidentified items shows the name as accurate as possible, though may not 100% be correct --- fix bug [3] should show star crumb level but it showed weapon element instead 2.2 getitemname2_2.2.txt --- update to fit latest renewal client item names 2.3 getitemname2_2.3.txt --- update all variables to fit latest rathena revision, and renewal client item names --- fix enchantment not showing properly --- optimized card counting with *countstr --- utilizing *freeloop instead of Keyworld's <- lol !! method --- TODO: useless unidentified updates .... Global Function shuffling algorithm // F_ShuffleNumbers( <start num>, <last num>, <output array>{, <count>} ); function script F_ShuffleNumbers { deletearray getarg(2); .@static = getarg(0); .@range = getarg(1) +1 - .@static; .@count = getarg(3, .@range); if (.@range <= 0 || .@count <= 0) return 0; if (.@count > .@range) .@count = .@range; for (.@i = 0; .@i < .@range; ++.@i) .@temparray[.@i] = .@i; for (.@i = 0; .@i < .@count; ++.@i) { .@rand = rand(.@range); set getelementofarray( getarg(2), .@i ), .@temparray[.@rand] + .@static; .@temparray[.@rand] = .@temparray[--.@range]; } return .@count; } sorting algorithm // callfunc "counting_sort_index_desc", <input array>, <output array>, <total index>; function script counting_sort_index_desc { .@total = .@size = getarg( 2, getarraysize( getarg(0) ) ); copyarray .@arr, getarg(0), .@size; for ( .@i = 0; .@i < .@size; ++.@i ) { setd ".@index_"+ .@arr[.@i] +"["+( .@tmp[.@arr[.@i]] )+"]", .@i; ++.@tmp[.@arr[.@i]]; } for ( ; .@size; --.@size ) { .@index = getarraysize(.@tmp) -1; --.@tmp[.@index]; .@out[.@total - .@size] = getd( ".@index_"+ .@index +"["+( .@tmp[.@index] )+"]" ); } copyarray getarg(1), .@out, .@total; return; } display integer // ~~~~~ Please use this latest int__ function that support negative numbers ~~~~~ function script int__ { .@i = getstrlen( .@str$ = getarg(0) ) -3; .@is_negative = charat( .@str$, 0 ) == "-"; while ( .@i > .@is_negative ) { .@str$ = insertchar( .@str$, ",", .@i ); .@i -= 3; } return .@str$; } display the time // ~~~~~ show time left in days, hours, minutes and seconds ~~~~~ function script timeleft__ { if ( ( .@left = getarg(0) ) <= 0 ) return getarg(0); .@day = .@left / 86400; .@hour = .@left % 86400 / 3600; .@min = .@left % 3600 / 60; .@sec = .@left % 60; if ( .@day ) return .@day +" day "+ .@hour +" hour"; else if ( .@hour ) return .@hour +" hour "+ .@min +" min"; else if ( .@min ) return .@min +" min "+ .@sec +" sec"; else return .@sec +" sec"; } PS: why am I getting rep even before I make any release ? O.O Edited January 30, 2019 by AnnieRuru 24 Quote
GM Takumirai Posted February 4, 2013 Posted February 4, 2013 Annie good to see u making ur script collection.. Quote
Neo-Mind Posted February 4, 2013 Posted February 4, 2013 PS: why am I getting rep even before I make any release ? O.O Because we love you all the same Quote
icabit Posted February 4, 2013 Posted February 4, 2013 a must follow topic i want to learn about scripting more i want to reorganize my scripts and annie is the best scripter i know Quote
Thanna Posted February 6, 2013 Posted February 6, 2013 why do you put the word lame? you always help and make scripts for random person that ask you, like me I do owe you Quote
Loki81 Posted February 6, 2013 Posted February 6, 2013 To install this script, should only install the file. txt or should do something else. The other is version 2.3, he works with eAthena. thank you Quote
Tonetzkii Posted February 8, 2013 Posted February 8, 2013 Annie make lates version of dota announce ) Quote
ReSp Posted July 22, 2024 Posted July 22, 2024 function F_ShuffleNumbers is not works in newest clients, error: buildin_rand: range (0) is too small. No randomness possible. Quote
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.