Jump to content
  • 0

Amount zeny colors


CaioVictor

Question


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  75
  • Reputation:   0
  • Joined:  05/26/12
  • Last Seen:  

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


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  


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;

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

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" );
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  75
  • Reputation:   0
  • Joined:  05/26/12
  • Last Seen:  

Hi ^^'

 

Thank you both xD

 

These codes have the original colors that appear in vending prices?

 

Thanks again for helping me!

 

Att,

Caiovictor.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

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 by Skorm
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  75
  • Reputation:   0
  • Joined:  05/26/12
  • Last Seen:  

Hi Skorm ^^'

 

Thanks for answer me too xD

 

create a list with prices and their colors ^^'

 

i4d5.jpg

 

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.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  75
  • Reputation:   0
  • Joined:  05/26/12
  • Last Seen:  

Thanks Emistry ^^'

 

 

Att,

CaioVictor.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

You won't be able to get that exact effect though because it isn't a soild color they're outlines...

 

1715982-NTRM79S.png

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  75
  • Reputation:   0
  • Joined:  05/26/12
  • Last Seen:  

What I do not understand is why some colors have shade!
Can we do this on npcs?

 

Att,

CaioVictor.

Edited by CaioVictor
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  75
  • Reputation:   0
  • Joined:  05/26/12
  • Last Seen:  

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...