View unanswered posts | View active topics It is currently Sun Apr 19, 2026 12:45 am



Reply to topic  [ 3 posts ] 
 ANSI Colors 
Author Message
Ambassador
User avatar

Joined: Mon Feb 09, 2004 3:00 am
Posts: 3141
Location: Kansas
Unread post ANSI Colors
While doing a complete rewrite on my colonizing script, I got tired of using ANSI_12 ($red), ANSI_11 ($cyan) all of the time for my echos, so I did what I thought TWX should have - gave the colors descriptive names. If you want a detailed tutorial, visit http://www.navhaz.com and the TW-Cabal link ( http://tw-cabal.navhaz.com/strategy/twxansitricks.html ). The link also has some information on preventing spoofing.

BTW, do not accidently type "send $white" rather than "echo $white". Strange things will probably happen, and most likely not good.

ah, proEcolonizer (or proEZcolonizer) will be released in a couple of weeks as version 5 if all goes well and testing works out. The version jump is mainly due to simplifying its use, speeding it up, removal of "All keys" usage, a bug fix, and two new colonizing modes, - one of which may never be used, but in the right situation might be good to have. The script is not BOT friendly, and I have no desire to make it that way.

Code:
setVar $i 30
goSub :ansi
echo $cls
while ($i <= 37)
    setVar $intenseColor #27 & "[1;" & $i & "m"
    echo $intenseColor & "*Intense Color*"
    if ($i = 30)
    # black (30) will not show unless "intense" on a black background
       echo $blackWhite "Can't see black/black so..*" $resetBlack
    else
       setVar $color #27 & "[0;" & $i & "m"
       echo $color & "Normal  Color*"
    end
    add $i 1
end
halt

#---------- goSubs ----------
:ansi
  # $cls clears the screen
  setVar $cls #27 & "[2J"
  setVar $black #27 & "[1;30m"
  setVar $red #27 & "[1;31m"
  setVar $green #27 & "[1;32m"
  setVar $yellow #27 & "[1;33m"
  setVar $blue #27 & "[1;34m"
  setVar $magenta #27 & "[1;35m"
  setVar $cyan #27 & "[1;36m"
  setVar $white #27 & "[1;37m"
  setVar $darkRed #27 & "[0;31m"

  # with background (add 10 to base color for background: #27 & "[1;37;41m" (41 is red)
  setVar $whiteRed #27 & "[1;37;41m"
  setVar $redWhite #27 & "[1;31;47m"
  setVar $blackWhite #27 & "[0;30;47m"

  # resets background to black with white text
  setVar $resetBlack #27 & "[1;37;40m"
return

_________________
               / Promethius / Enigma / Wolfen /

"A man who has no skills can be taught, a man who has no honor has nothing."


Sun Jan 09, 2011 2:49 pm
Profile ICQ
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1134
Location: Augusta, GA
Unread post Re: ANSI Colors
That's actually a really good idea for TWX.

_________________
Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.


Sun Jan 09, 2011 8:50 pm
Profile WWW
Ambassador
User avatar

Joined: Mon Feb 09, 2004 3:00 am
Posts: 3141
Location: Kansas
Unread post Re: ANSI Colors
I agree it would be great to have the descriptive colors in addition to the ANSI_xx so it doesn't break scripts. Actually, I don't know why I didn't write that snippet a long time ago. Traitor did some very nice work on the TW-Cabal page and that is where I got the ANSI codes.

_________________
               / Promethius / Enigma / Wolfen /

"A man who has no skills can be taught, a man who has no honor has nothing."


Mon Jan 10, 2011 9:38 pm
Profile ICQ
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by wSTSoftware.