PDA

View Full Version : Racial Name Highlighting



vertebrae8
03-05-2009, 02:02 AM
I've been wondering if there is some way for me to do one of these:

1. Run a script that will look at each player in the room one at a time really quickly (I have races highlighted by color and can see what race they are quickly when I do a look.)
2. Or instead, run a script that will take the output of the "WHO RACE XYZ" and automatically highlight every PC lsted there by race.

Anyone have any ideas how to do this? It would be cool to be able to log in and run my highlighting script and highlight every PC in the game by their race. And whenever I see someone who is not highlighted, to run the script or a similar local LOOK version of the script again.

JustWondering
05-15-2009, 03:12 AM
That's an interesting idea.

Deathravin
05-15-2009, 05:09 AM
I do the same thing but with Professions.

You can do it with lich, but not with typical wizard/sf scripting.

Gibreficul
05-22-2009, 10:14 PM
If you use Lich....



$prof = "empath"
$proflist = []
newprof = false
fput 'who prof #{$prof}'
name_list = []
line = get until line == 'Brave Adventurers Questing:'
line = get
while line !~ /^Total:/
line =~ /^([A-Z][a-z]+)(?:\s+)([A-Z][a-z]+)?(?:\s+)?([A-Z][a-z]+)?(?:\s+)?([A-Z][a-z]+)?/
name_list.push $1 if $1
name_list.push $2 if $2
name_list.push $3 if $3
name_list.push $4 if $4
line = get
end
for name in name_list
if name !~ /#{$proflist.join("|")}/
$proflist.push(name)
newprof = true
end
end
echo "\"#{$profilist.join("\", \"")}\"" if newprof == true




That should work if you change the variable, for race/profession, even letter. It doesn't set up highlights, but it'll put all those names into an array. If I knew how to add highlights via script, I'd have done it in that script up there.


Gibreficul

Donquix
05-22-2009, 10:41 PM
That should work if you change the variable, for race/profession, even letter. It doesn't set up highlights, but it'll put all those names into an array. If I knew how to add highlights via script, I'd have done it in that script up there.


Gibreficul

For SF...

ADDTOHIGHLIGHTNAMES string="{text}" [options]

[options] are optional arguments, as follows:

foreColor={color}
foreground color, see {color} below.
backColor={color}
Background color, see {color} below.
highlightEntireLine={True | False}
If TRUE, highlights enitre line (default is TRUE).

notOnWordBoundry={True | False}
If TRUE, matches partial words (default is TRUE).

matchPartialWord={True | False}

Alias for notOnWordBoundry.

caseInsensitive={True | False }

if TRUE, case is not checked (default is TRUE).


ignoreCase={True | False}
Alias for ignoreCase.


{color}


A hexadecimal RGB or palette index color specification. For example:

foreColor=#FF0000
backColor=@1

A number by itself will be interpreted as a palette index for compatibility with old Wizard scripts.

Gibreficul
05-28-2009, 06:44 AM
These don't highlight anything, but it does grab the information... which can then be manipulated, I'm sure. Like I said before, I don't do that hex crap. It always seemed to be way too much work to script adding highlights.

ANYWAY. These are both Lich scripts. They gather all the names generated from the WHO PROF and WHO RACE commands, for each prof, and race. They're basically mimics of each other.



$prof_list = ["Warrior", "Rogue", "Paladin", "Bard", "Ranger", "Wizard", "Sorcerer", "Cleric", "Empath"]
$location = 0
$proflist = []
$prof_list.each{ |prof|
fput "who prof #{prof}"
$listme = []
name_list = []
line = get until line == 'Brave Adventurers Questing:'
line = get
while line !~ /^Total:/
line =~ /^([A-Z][a-z]+)(?:\s+)([A-Z][a-z]+)?(?:\s+)?([A-Z][a-z]+)?(?:\s+)?([A-Z][a-z]+)?/
name_list.push $1 if $1
name_list.push $2 if $2
name_list.push $3 if $3
name_list.push $4 if $4
line = get
end
for name in name_list
$listme.push(name)
end
$proflist.push($listme)
$proflist.push($prof_list[$location])
$location += 1
}

$location = 0
respond ""
$prof_list.length.times{
respond "There are #{$proflist[$location].length} #{$proflist[($location + 1)]}s in the lands currently."
respond "They are #{$proflist[$location].join(", ")}."
respond ""
$location += 2
}




$race_list = ["Human", "Giantman", "Half-Elf", "Sylvankind", "Dark Elf", "Elf", "Dwarf", "Halfling", "Forest Gnome", "Burghal Gnome", "Half-Krolvin", "Erithian", "Aelotoi"]
$location = 0
$racelist = []
$race_list.each{ |race|
fput "who race #{race}"
$listme = []
name_list = []
line = get until line == 'Brave Adventurers Questing:'
line = get
while line !~ /^Total:/
line =~ /^([A-Z][a-z]+)(?:\s+)([A-Z][a-z]+)?(?:\s+)?([A-Z][a-z]+)?(?:\s+)?([A-Z][a-z]+)?/
name_list.push $1 if $1
name_list.push $2 if $2
name_list.push $3 if $3
name_list.push $4 if $4
line = get
end
for name in name_list
$listme.push(name)
end
$racelist.push($listme)
$racelist.push($race_list[$location])
$location += 1
}

$location = 0
respond ""
$race_list.length.times{
respond "There are #{$racelist[$location].length} #{$racelist[($location + 1)]}s in the lands currently."
respond "They are #{$racelist[$location].join(", ")}."
respond ""
$location += 2
}



Gibreficul

And credit where due... Tillmen wrote the original code I'm using... to make a script that would attempt to locate everyone from the WHO ALL CONFIRM output.


Now, if someone could take that information, and USE it to add highlights, then we have what was sought after.

Donquix
06-04-2009, 05:37 AM
My settings got ate tonight, so i got this working (sorta). Can't get lich to actually add the highlights so kinda working around that.

If you run the script it will create a text file called sfhltemp.txt in your lich scripts folder. Open that, copy and paste it into an SF script, run the sf script...highlights galore.

Of course this will overwrite your existing highlights, if any exist, for a certain name. So keep that in mind

the sfhltemp file is APPENDED to, so you don't lose any names. But that also will create dupes if you run the script a lot. So either clean out the text file when you use it or deal with it :) just threw this together super quick.

The colors used are the ones from the old sf quick highlight (QHL) script. If you want to use your own colors, figure out their codes and add them in at the top for the highlight_list variable. They are in the same order as the prof_list variable defined right above it.



#prof highlight script
$prof_list = ["Warrior", "Rogue", "Paladin", "Bard", "Ranger", "Wizard", "Sorcerer", "Cleric", "Empath"]
$highlight_list = ["69F9E9", "FFD2A1", "B5B5B5", "33F390", "39CC00", "FF9000", "E7BD18", "FF94F7", "FF3399"]
$location = 0
$proflist = []
$prof_list.each{ |prof|
fput "who prof #{prof}"
$listme = []
name_list = []
line = get until line == 'Brave Adventurers Questing:'
line = get
while line !~ /^Total:/
line =~ /^([A-Z][a-z]+)(?:\s+)([A-Z][a-z]+)?(?:\s+)?([A-Z][a-z]+)?(?:\s+)?([A-Z][a-z]+)?/
name_list.push $1 if $1
name_list.push $2 if $2
name_list.push $3 if $3
name_list.push $4 if $4
line = get
end
File.open('Scripts\sfhltemp.txt', 'a') do |f1|
for name in name_list
$listme.push(name)
f1.puts "AddToHighlightNames string=#{name} backColor=\#000000 foreColor=\##{$highlight_list[$location]} notOnWordBoundary=false caseInsensitive=False"
end
end
$proflist.push($listme)
$proflist.push($prof_list[$location])
$location += 1
}

$location = 0
respond ""
$prof_list.length.times{
respond "There are #{$proflist[$location].length} #{$proflist[($location + 1)]}s in the lands currently."
respond "They are #{$proflist[$location].join(", ")}."
respond ""
$location += 2
}

Gibreficul
06-06-2009, 07:16 PM
heh, that's pretty damn cool.

Donquix
06-07-2009, 02:41 PM
heh, that's pretty damn cool.

Think I made it cooler.

This version only works with stormfront (i honestly don't even know if the last one worked with wizard, i can't remember if it handles the same highlight strings)

Anyhow, now instead of kicking out the names and highilghts in the script form, it kicks them out in the format of an exported XML name highlights settings file.

So now, instead of copying and pasting all the crap into a script and running that, then getting the massive spam of running the script, just run the script and them go settings-> import, browse to the file (still dropped in the lich scritps folder, but now named sfhltemp.xml) and import it.

This has the benefit of in the import dialog you can select "Only import new" for name highlights and it won't overwrite your existing highlights!



#prof highlight script
$prof_list = ["Warrior", "Rogue", "Paladin", "Bard", "Ranger", "Wizard", "Sorcerer", "Cleric", "Empath"]
$highlight_list = ["69F9E9", "FFD2A1", "B5B5B5", "33F390", "39CC00", "FF9000", "E7BD18", "FF94F7", "FF3399"]
$location = 0
$proflist = []
File.open('Scripts\sfhltemp.xml', 'a') do |f1|
f1.puts "<settings client=\"1.0.1.22\">"
f1.puts "\t<names>"
$prof_list.each{ |prof|
fput "who prof #{prof}"
$listme = []
name_list = []
line = get until line == 'Brave Adventurers Questing:'
line = get
while line !~ /^Total:/
line =~ /^([A-Z][a-z]+)(?:\s+)([A-Z][a-z]+)?(?:\s+)?([A-Z][a-z]+)?(?:\s+)?([A-Z][a-z]+)?/
name_list.push $1 if $1
name_list.push $2 if $2
name_list.push $3 if $3
name_list.push $4 if $4
line = get
end
for name in name_list
$listme.push(name)
f1.puts "\t\t<h text=\"#{name}\" color=\"\##{$highlight_list[$location]}\" bgcolor=\"\#000000\" />"
# f1.puts "AddToHighlightNames string=#{name} backColor=\#000000 foreColor=\##{$highlight_list[$location]} notOnWordBoundary=false caseInsensitive=False"
end
$proflist.push($listme)
$proflist.push($prof_list[$location])
$location += 1
}
f1.puts "\t</names>"
f1.puts "</settings>"
end
$location = 0
respond ""
$prof_list.length.times{
respond "There are #{$proflist[$location].length} #{$proflist[($location + 1)]}s in the lands currently."
respond "They are #{$proflist[$location].join(", ")}."
respond ""
$location += 2
}

scottmik
06-22-2009, 12:35 PM
Think I made it cooler.

This version only works with stormfront (i honestly don't even know if the last one worked with wizard, i can't remember if it handles the same highlight strings)

Anyhow, now instead of kicking out the names and highilghts in the script form, it kicks them out in the format of an exported XML name highlights settings file.

So now, instead of copying and pasting all the crap into a script and running that, then getting the massive spam of running the script, just run the script and them go settings-> import, browse to the file (still dropped in the lich scritps folder, but now named sfhltemp.xml) and import it.

This has the benefit of in the import dialog you can select "Only import new" for name highlights and it won't overwrite your existing highlights!



#prof highlight script
$prof_list = ["Warrior", "Rogue", "Paladin", "Bard", "Ranger", "Wizard", "Sorcerer", "Cleric", "Empath"]
$highlight_list = ["69F9E9", "FFD2A1", "B5B5B5", "33F390", "39CC00", "FF9000", "E7BD18", "FF94F7", "FF3399"]
$location = 0
$proflist = []
File.open('Scripts\sfhltemp.xml', 'a') do |f1|
f1.puts "<settings client=\"1.0.1.22\">"
f1.puts "\t<names>"
$prof_list.each{ |prof|
fput "who prof #{prof}"
$listme = []
name_list = []
line = get until line == 'Brave Adventurers Questing:'
line = get
while line !~ /^Total:/
line =~ /^([A-Z][a-z]+)(?:\s+)([A-Z][a-z]+)?(?:\s+)?([A-Z][a-z]+)?(?:\s+)?([A-Z][a-z]+)?/
name_list.push $1 if $1
name_list.push $2 if $2
name_list.push $3 if $3
name_list.push $4 if $4
line = get
end
for name in name_list
$listme.push(name)
f1.puts "\t\t<h text=\"#{name}\" color=\"\##{$highlight_list[$location]}\" bgcolor=\"\#000000\" />"
# f1.puts "AddToHighlightNames string=#{name} backColor=\#000000 foreColor=\##{$highlight_list[$location]} notOnWordBoundary=false caseInsensitive=False"
end
$proflist.push($listme)
$proflist.push($prof_list[$location])
$location += 1
}
f1.puts "\t</names>"
f1.puts "</settings>"
end
$location = 0
respond ""
$prof_list.length.times{
respond "There are #{$proflist[$location].length} #{$proflist[($location + 1)]}s in the lands currently."
respond "They are #{$proflist[$location].join(", ")}."
respond ""
$location += 2
}





How would I go about modifiying the code above to allow for background colors?
If someone could post the modified code I can fill in the color values I need or
these would be the color values I would want.

Warrior
#FFFFFF-for
#808000-back

Rogue
#FFFFFF-for
#008080-back

Paladid
#0000FF-for
#00FFFF-back

Bard
#FFFFFF-for
#800080-back

Ranger
#FFFFFF-for
#008000-back

Wizard
#FFFFFF-for
#0000FF-back

Sorcerer
#FFFFFF-for
#800000-back

Cleric
#800000-for
#C0C0C0-back

Empath
#FFFFFF-for
#FF0000-back

Donquix
06-23-2009, 01:28 PM
Here is the basic code you would need to get a background color as well...



#prof highlight script
$prof_list = ["Warrior", "Rogue", "Paladin", "Bard", "Ranger", "Wizard", "Sorcerer", "Cleric", "Empath"]
$highlight_list = ["69F9E9", "FFD2A1", "B5B5B5", "33F390", "39CC00", "FF9000", "E7BD18", "FF94F7", "FF3399"]
$back_list = ["Warrior", "Rogue", "Paladin", "Bard", "Ranger", "Wizard", "Sorcerer", "Cleric", "Empath"]
$location = 0
$proflist = []
File.open('Scripts\sfhltemp.xml', 'a') do |f1|
f1.puts "<settings client=\"1.0.1.22\">"
f1.puts "\t<names>"
$prof_list.each{ |prof|
fput "who prof #{prof}"
$listme = []
name_list = []
line = get until line == 'Brave Adventurers Questing:'
line = get
while line !~ /^Total:/
line =~ /^([A-Z][a-z]+)(?:\s+)([A-Z][a-z]+)?(?:\s+)?([A-Z][a-z]+)?(?:\s+)?([A-Z][a-z]+)?/
name_list.push $1 if $1
name_list.push $2 if $2
name_list.push $3 if $3
name_list.push $4 if $4
line = get
end
for name in name_list
$listme.push(name)
f1.puts "\t\t<h text=\"#{name}\" color=\"\##{$highlight_list[$location]}\" bgcolor=\"\##{$back_list[$location]}\" />"
end
$proflist.push($listme)
$proflist.push($prof_list[$location])
$location += 1
}
f1.puts "\t</names>"
f1.puts "</settings>"
end
$location = 0
respond ""
$prof_list.length.times{
respond "There are #{$proflist[$location].length} #{$proflist[($location + 1)]}s in the lands currently."
respond "They are #{$proflist[$location].join(", ")}."
respond ""
$location += 2
}


in order to get your specific colors, you need to edit the following two lines...



$highlight_list = ["69F9E9", "FFD2A1", "B5B5B5", "33F390", "39CC00", "FF9000", "E7BD18", "FF94F7", "FF3399"]
$back_list = ["Warrior", "Rogue", "Paladin", "Bard", "Ranger", "Wizard", "Sorcerer", "Cleric", "Empath"]


For $highlight_list, replace those codes with the color codes you use for the foreground, they are in the order seen in the back_list and Prof_list variables ("Warrior", "Rogue", "Paladin", "Bard", "Ranger", "Wizard", "Sorcerer", "Cleric", "Empath")

for $back_list replace the class names with your background color of choice's code, in the same format as the highlight list (just the code, no # needed)

scottmik
06-23-2009, 04:55 PM
thank you. I will try it when i get home.

Fanglor
10-17-2009, 04:27 AM
very nice work people

Stanley Burrell
10-17-2009, 04:53 AM
Racial Name Highlighting

That's pretty racist man. You want me to call the police? (http://www.youtube.com/watch?v=yd4XaLwXpLQ)