CaioVictor Posted July 5, 2013 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 75 Reputation: 0 Joined: 05/26/12 Last Seen: November 27, 2013 Share Posted July 5, 2013 Hi all ^^' I need to create a function that does the same as the vendings: each amount of Zeny has a specific color. The problem is not to create the function, but to know the relationship between the amount of zeny and its color. Any help will be very well received ^^' Att, CaioVictor. Quote Link to comment Share on other sites More sharing options...
Emistry Posted July 5, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted July 5, 2013 if( Zeny < 1000 ) set .@color$,"^FF0000"; else if( Zeny < 1000000 ) set .@color$,"^0055FF"; else if( Zeny < 1000000000 ) set .@color$,"^00EE00"; else set .@color$,"^FFFFFF"; mes "Zeny :"+.@color$+" "+Zeny+"^000000"; close; Quote Link to comment Share on other sites More sharing options...
Capuche Posted July 5, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted July 5, 2013 Like that? prontera,155,180,0 script color 100,{ function color; function Step; function int__; mes color( 999 ); mes color( 1000 ); mes color( 10000 ); mes color( 100000 ); mes color( 1000000 ); close; function color { .@tmp = getarg(0); .@value$ = int__( .@tmp ); while( .@i < .size && .@tmp < .step_value[.@i] ) .@i++; if ( .@i == .size ) .@i--; return ( ( .@tmp < .step_value[.size-1] ? "" : .color_value$[.@i] ) + .@value$ + "^000000" ); } function int__ { .@value$ = getarg(0); for ( .@i = .@j = getstrlen( .@value$ ); .@i > 0; .@i-- ) .@string$ = charat( .@value$, .@i -1 ) + ( ( .@j - .@i ) && ( .@j - .@i )%3 == 0 ? "," : "" ) + .@string$; return .@string$; } function Step { .step_value[.size] = getarg(0); .color_value$[.size] = getarg(1); .size++; } OnInit: // Step zeny desc Step( 1000000, "^ff0000" ); Step( 100000, "^ffff00" ); Step( 10000, "^00ff00" ); Step( 1000, "^0000ff" ); } Quote Link to comment Share on other sites More sharing options...
CaioVictor Posted July 5, 2013 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 75 Reputation: 0 Joined: 05/26/12 Last Seen: November 27, 2013 Author Share Posted July 5, 2013 Hi ^^' Thank you both xD These codes have the original colors that appear in vending prices? Thanks again for helping me! Att, Caiovictor. Quote Link to comment Share on other sites More sharing options...
Skorm Posted July 5, 2013 Group: Forum Moderator Topic Count: 33 Topics Per Day: 0.01 Content Count: 1282 Reputation: 393 Joined: 02/03/12 Last Seen: April 11 Share Posted July 5, 2013 (edited) I was going to try my hand at this but ended up doing something completely different... I'll post it anyways. Lawl. prontera,151,151,0 script GirlyGirl 719,{ mes "[GirlyGirl]"; mes "I can count to ten watch!"; explode(.@array$,callfunc("F_Numbers","One Two 3, 5 77 89 143,039,011")," "); while(.@array$[(.@a++-1)]!=""){ sleep2 500; mes .@array$[.@a-1]; } emotion e_what,0; mes "... What was I doing again?"; sleep2 500; emotion e_swt,0; close; OnInit: setarray $@colors$[0],"^78c5d6","^459ba8","^79c267","^c5d647","^f5d63d", "^f28c33","^e868a2","^bf62a6","^6645bf","^fe2020", "^7b61bf"; } function script F_Numbers { set .@arg$,getarg(0); explode(.@eles$,.@arg$," "); set .@clen,getarraysize($@colors$); while(.@eles$[.@k]!="") { set .@len,getstrlen(.@eles$[.@k]); for(set(.@z,0);.@z<.@len;set(.@z,.@z+1)) { set .@str$, charat(.@eles$[.@k],.@z); setarray .@b[.@z], pow(2,atoi(.@str$)); for(set .@a,(.@clen-1); .@a > 0; set .@a,.@a - 1) { if((.@b[.@z] % pow(2,.@a)) != ((.@b[.@z]==1)?((.@a==(.@clen-1))?0:1):.@b[.@z])) { set .@return$[.@k],.@return$[.@k] + $@colors$[.@a] + .@str$ + "^000000"; set .@b[.@z],.@b[.@z] % pow(2,.@a); } } } set .@k,.@k+1; } return implode(.@return$," "); }Edit: Posted better example of the function. Edited July 6, 2013 by Skorm Quote Link to comment Share on other sites More sharing options...
CaioVictor Posted July 6, 2013 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 75 Reputation: 0 Joined: 05/26/12 Last Seen: November 27, 2013 Author Share Posted July 6, 2013 Hi Skorm ^^' Thanks for answer me too xD I create a list with prices and their colors ^^' Now i need to extract the exact colors for each step of price xD But there is a problem, for example, to "1z" the image shows a dark green, but if you try to copy the color you will see that is black =\ Does anyone have a list of the exact colors in RGB? Thanks again for helping me! Att, CaioVictor. Quote Link to comment Share on other sites More sharing options...
Emistry Posted July 6, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted July 6, 2013 http://html-color-codes.com/ Quote Link to comment Share on other sites More sharing options...
CaioVictor Posted July 6, 2013 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 75 Reputation: 0 Joined: 05/26/12 Last Seen: November 27, 2013 Author Share Posted July 6, 2013 Thanks Emistry ^^' Att, CaioVictor. Quote Link to comment Share on other sites More sharing options...
Skorm Posted July 6, 2013 Group: Forum Moderator Topic Count: 33 Topics Per Day: 0.01 Content Count: 1282 Reputation: 393 Joined: 02/03/12 Last Seen: April 11 Share Posted July 6, 2013 You won't be able to get that exact effect though because it isn't a soild color they're outlines... Quote Link to comment Share on other sites More sharing options...
CaioVictor Posted July 6, 2013 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 75 Reputation: 0 Joined: 05/26/12 Last Seen: November 27, 2013 Author Share Posted July 6, 2013 (edited) What I do not understand is why some colors have shade!Can we do this on npcs? Att, CaioVictor. Edited July 6, 2013 by CaioVictor Quote Link to comment Share on other sites More sharing options...
Skorm Posted July 6, 2013 Group: Forum Moderator Topic Count: 33 Topics Per Day: 0.01 Content Count: 1282 Reputation: 393 Joined: 02/03/12 Last Seen: April 11 Share Posted July 6, 2013 What I do not understand is why some colors have shade! Can we do this on npcs? Att, CaioVictor. To my knowledge this cannot be replicated via current NPC commands. You might get a similar effect with the setfont command. I've never used it before so I'm not sure. *setfont <font>; This command sets the current RO client interface font to one of the fonts stored in data\*.eot by using an ID of the font. When the ID of the currently used font is used, default interface font is used again. 0 - Default 1 - RixLoveangel 2 - RixSquirrel 3 - NHCgogo 4 - RixDiary 5 - RixMiniHeart 6 - RixFreshman 7 - RixKid 8 - RixMagic 9 - RixJJangu Quote Link to comment Share on other sites More sharing options...
CaioVictor Posted July 6, 2013 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 75 Reputation: 0 Joined: 05/26/12 Last Seen: November 27, 2013 Author Share Posted July 6, 2013 Interesting! I did not know this "setfont", but I will test it.I'm questioning these things, because I can't find any color that looks similar to those who have shade =\ Att, CaioVictor. Quote Link to comment Share on other sites More sharing options...
Question
CaioVictor
Hi all ^^'
I need to create a function that does the same as the vendings: each amount of Zeny has a specific color.
The problem is not to create the function, but to know the relationship between the amount of zeny and its color.
Any help will be very well received ^^'
Att,
CaioVictor.
Link to comment
Share on other sites
11 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.