Jump to content
  • 0

color code


Dori

Question


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

How can I put 2 different colors to the item amount and the item name according to this script?

mes "- "+ getd(".@pt_"+ .@j3 +"["+ (.@i+1) +"]") +" "+ getitemname(getd(".@pt_"+ .@j3 +"["+ .@i +"]"));
Edited by Phenex
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

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


mes "- ^FF0000"+ getd(".@pt_"+ .@j3 +"["+ (.@i+1) +"]") +" ^0000FF"+ getitemname(getd(".@pt_"+ .@j3 +"["+ .@i +"]"))+"^000000";

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

By using color codes before each section that has a different color (this includes if you want text to display as black).

mes "- ^FF0000"+ getd(".@pt_"+ .@j3 +"["+ (.@i+1) +"]") +" ^0000FF"+ getitemname(getd(".@pt_"+ .@j3 +"["+ .@i +"]"));

That will make your above message display as wanted.

^RRGGBB
ex. ^FF0000 = RED
ex. ^00FF00 = GREEN
ex. ^0000FF = BLUE
ex. ^FFFFFF = WHITE
ex. ^000000 = BLACK

You can also refer to here: Color Codes for a list of other colors, the middle 6 Letters/numbers are what you use.

  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

It didn't quite work. The color for the item amount worked fine, but for the names; the color worked for the names but it continued on to the rest of the text the npc says.
This is where I have been stuck too.
 
Here how it looks like:
 
- 5 apples
- 5 orranges
- 8 nuts

 

bring these items bla bla bla bla

 

that first dash (-) is black but the rest of them are also blue.

Edited by Phenex
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

That worked! Thanks guys!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

If, you fully read my first post, you'll see that, I mentioned, you must put the black code ( ^000000 ) in front of text that displays black.

 

Colorizing text in rA/eA work like this:

mes "This will appear as black because its a new script, so don't worry about leaving colors in the end of scripts.";
mes "^FF0000 Everything from now on will be red, until I change the color again.";
mes "^000000 Now everything will be black. ^00FF00 And now all green until I change it again. ^000000";
mes "You'll notice that I used the code for black at the end of the above line, thus making all this black. ^0000FF";
close; // I put blue at the end of this script but it doesn't matter because the script ended, a new script will always appear in black.
Edited by GmOcean
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...