Sweet Thirdeye script

by Unknown

Back to Mechanic's Corner.

Unknown2005-02-28 03:14:04
I had a pretty productive afternoon today. Originally I had intended to start throwing together a curing system, but that plan was derailed when I realized I have Thirdeye now. It's awful handy to be able to track other players' movements, but it's a supreme pain in the rear to sift through all of the who output. This is an adjusted version of the tracking.tf script I have posted on my website. For some reason my site is down at the moment. Since I'm across town at my Fiancee's place and don't feel like driving across town to find out why, I'm posting the new script and it's unload version here. I'll update them to my site in a few days when I get around to it.

It adds a "loc" command. If you were to type "loc player1 player2 player3..." you'd see a list of those player's entries in the who list displayed (the rest is gagged). Their names are highlighted for convenience (why some people insist on having huge titles I'll never understand). If you ran "loc" without any arguments you'd just get the standard "who" output. This new command takes advantage of the ally, enemy, allyh, enemyh, and markh stacks created for the name highlighting features I added last time. Aliases loce, loca, locm display the locations of the players contained in those stacks. The alias loct displays the location of the player currently set as your target. I've been having a blast with this script, works fantastic.

The way this script works is it first sets up some triggers based on the names you passed it. Then it secretly sets your pagelength to 250, and runs the who command. This is where the triggers kick in and do all their gagging/highting magic. Finally it deletes all of the triggers and sets your pagelength back to 25. Yes, this script will not work properly if there's more than 250 players online. When I see that many people online I will be MORE than happy to fix this little quirk...but for now I'm happy with it.

If you were to type "loc bob jane someguy" you'd seem something like the following:

strange dude Bob dork (At the Necropolis)
cutie girl Jane the hottie (Before a Shrine to Me)
Someguy over there (Standing Over There)

The script behaves great on my broadband connection, however it is a bit input/output intensive since it usese the who command. If you're on a modem I'm not sure how this will behave.

If you've got any questions or comments you can post them here, or message Druthalus in game.

tracking.tf
CODE

;;;;;; declare/initialize variables
/set stack_enemyh=
/set stack_allyh=
/set stack_markh=
/set stack_enemy=
/set stack_ally=
/set stack_locate=



;;;;;; locate players
;;; Syntax: loc
/alias loc \\
   /if ( {#} > 0 ) \\
       /set stack_locate %{*} %; \\
       /while ( {stack_locate} !~ "" ) \\
           /let current_player $(/pop stack_locate) %; \\
           /def -mregexp -n0 -p4 -P1BCcyan -t".*\\\\b(%{current_player})\\\\b.*" locate_%{current_player} %; \\
       /done %; \\
       /set stack_locate %{*} %; \\
       /def -mregexp -n0 -p3 -ag -t".*" locate_gag_rest %; \\
       /def -mregexp -n1 -p4 -ag -t"^Your current pagelength: 25\\\\b" locate_finished = \\
           /while ( {stack_locate} !~ "" ) \\
               /let current_player $$(/pop stack_locate) %%; \\
               /undef locate_%%{current_player} %%; \\
           /done %%; \\
           /undef locate_gag_rest %; \\
       config pagelength 250 %; \\
       who %; \\
       config pagelength 25 %; \\
   /else \\
       who %; \\
   /endif

;;; locate target
/alias loct loc %{target}

;;; locate enemies
/alias loce \\
   /let stack_temp_enemy %{stack_enemy} %; \\
   /let stack_temp_enemyh %{stack_enemyh} %; \\
   /while ( {stack_temp_enemy} !~ "" ) \\
       /let current_enemy $(/pop stack_temp_enemy) %; \\
       /let stack_temp_enemyh $ %; \\
   /done %; \\
   loc %{stack_temp_enemyh} %{stack_enemy}

;;; locate allies
/alias loca loc %{stack_allyh} %{stack_ally}

;;; locate marks
/alias locm loc %{stack_markh}



;;;;;; default enemies and enemy highlights
;;; serenwilde enemies
/def define_communeenemies = \\
   /def -mregexp -n1 -p3 -t"^Enemies of the Collective of Serenwilde:" communeenemies_start_catch = \\
       /def -mregexp -n0 -p3 -F -t"(.*)" communeenemies_row_catch = \\
           /let stack_communeenemies_row %%%{P1} %%%; \\
           /while ( {stack_communeenemies_row} !~ "" ) \\
               /let current_enemy $$$(/pop stack_communeenemies_row) %%%; \\
               /let current_enemy $$$ %%%; \\
               /if ( {current_enemy} !~ "" ) \\
                   /let current_enemy $$$ %%%; \\
                   enemyh %%%{current_enemy} %%%; \\
               /endif %%%; \\
           /done %; \\
   /def -mregexp -n1 -p4 -t"^Total: \\\\d+" communeenemies_done_catch = \\
       /undef communeenemies_row_catch %; \\
   /send communeenemies

;;; serenguard enemies
;;; to get these set use GHELP ENEMIES and do it by hand for now.
/def define_guildenemies = \\
   enemyh riyo

;;; personal enemies
/def define_enemies = \\
   enemy guido %; \\
   enemy lusien %; \\
   enemy marsu %; \\
   enemy torak %; \\
   enemy yuniko



;;;;;; default allies and ally highlights
;;; serenguard leadership
/def define_guildleadership = \\
   allyh alyssandra %; \\
   allyh sonata %; \\
   allyh jelani %; \\
   allyh tharruk %; \\
   allyh gwynn %; \\
   allyh mitch %; \\
   allyh kyros %; \\
   allyh alkriz %; \\
   allyh raan %; \\
   allyh charis %; \\
   allyh gwylifar %; \\
   allyh klia %; \\
   allyh hana %; \\
   allyh humphrey %; \\
   allyh tia %; \\
   allyh chessa %; \\
   allyh lomdomian %; \\
   allyh narid %; \\
   allyh arorn %; \\
   allyh oni

;;; business partners
/def define_businesspartners = \\
   ally ialie

;;; suppliers
/def define_suppliers = \\
   allyh anarias %; \\
   allyh iasmos %; \\
   allyh holice %; \\
   allyh kithe %; \\
   allyh laysus

;;; personal allies
/def define_allies = \\
   ally malicia



;;;;;; default mark highlights
/def define_marks = \\
   markh cow %; \\
   markh moose %; \\
   markh pilgrim %; \\
   markh rockeater %; \\
   markh sheep %; \\
   markh ravenwood %; \\
   markh wasp %; \\
   markh ooze %; \\
   markh starsucker %; \\
   markh leech



;;;;;; add/remove enemy highlight
;;; Syntax: enemyh
;;;         unenemyh
/alias enemyh \\
   /if ( {#} == 1 ) \\
       /def -mregexp -n0 -P1Cred -p2 -F -t"\\\\b(%{1})\\\\b" enemyh_%{1} %; \\
       /push %{1} stack_enemyh %; \\
       /echo -aBCcyan <<<< %{1} is enemy highlighted. >>>> %; \\
   /else \\
       /echo -aBCcyan <<<< enemyh error: You must provide a name. >>>> %; \\
   /endif

/alias unenemyh \\
   /if ( {#} == 1 ) \\
       /undef enemyh_%{1} %; \\
       /set stack_enemyh $ %; \\
       /echo -aBCcyan <<<< %{1} is no longer enemy highlighted. >>>> %; \\
   /else \\
       /echo -aBCcyan <<<< unenemyh error: You must provide a name. >>>> %; \\
   /endif



;;;;;; add/remove ally highlight
;;; Syntax: allyh
;;;         unallyh
/alias allyh \\
   /if ( {#} == 1 ) \\
       /def -mregexp -n0 -P1BCblue -p2 -F -t"\\\\b(%{1})\\\\b" allyh_%{1} %; \\
       /push %{1} stack_allyh %; \\
       /echo -aBCcyan <<<< %{1} is ally highlighted. >>>> %; \\
   /else \\
       /echo -aBCcyan <<<< allyh error: You must provide a name. >>>> %; \\
   /endif

/alias unallyh \\
   /if ( {#} == 1 ) \\
       /undef allyh_%{1} %; \\
       /set stack_allyh $ %; \\
       /echo -aBCcyan <<<< %{1} is no longer ally highlighted. >>>> %; \\
   /else \\
       /echo -aBCcyan <<<< unallyh error: You must provide a name. >>>> %; \\
   /endif



;;;;;; add/remove mark highlight
;;; Syntax: markh
;;;         unmarkh
/alias markh \\
   /if ( {#} == 1 ) \\
       /def -mregexp -n0 -P1Cyellow -p2 -F -t"(%{1})" markh_%{1} %; \\
       /push %{1} stack_markh %; \\
       /echo -aBCcyan <<<< %{1} is mark highlighted. >>>> %; \\
   /else \\
       /echo -aBCcyan <<<< markh error: You must provide an identifier. >>>> %; \\
   /endif

/alias unmarkh \\
   /if ( {#} == 1 ) \\
       /undef markh_%{1} %; \\
       /set stack_markh $ %; \\
       /echo -aBCcyan <<<< %{1} is no longer mark highlighted. >>>> %; \\
   /else \\
       /echo -aBCcyan <<<< unmarkh error: You must provide an identifier. >>>> %; \\
   /endif



;;;;;; enemy/unenemy a player (highlight in bolder color than enemyh)
;;; Syntax: enemy
/alias enemy \\
   /if ( {#} == 1 ) \\
       /def -mregexp -n0 -P1BCred -p2 -F -t"\\\\b(%{1})\\\\b" enemy_%{1} %; \\
       /push %{1} stack_enemy %; \\
       /send enemy %{1} %; \\
   /else \\
       /echo -aBCcyan <<<< enemy error: You must provide a name. >>>> %; \\
   /endif

/alias unenemy \\
   /if ( {#} == 1 ) \\
       /undef enemy_%{1} %; \\
       /set stack_enemy $ %; \\
       /send unenemy %{1} %; \\
   /else \\
       /echo -aBCcyan <<<< unenemy error: You must provide a name. >>>> %; \\
   /endif



;;;;;; ally/unally a player (highlight with same color as allyh)
;;; Syntax: enemy
/alias ally \\
   /if ( {#} == 1 ) \\
       /def -mregexp -n0 -P1BCblue -p2 -F -t"\\\\b(%{1})\\\\b" ally_%{1} %; \\
       /push %{1} stack_ally %; \\
       /send ally %{1} %; \\
   /else \\
       /echo -aBCcyan <<<< ally error: You must provide a name. >>>> %; \\
   /endif

/alias unally \\
   /if ( {#} == 1 ) \\
       /undef ally_%{1} %; \\
       /set stack_ally $ %; \\
       /send unally %{1} %; \\
   /else \\
       /echo -aBCcyan <<<< unally error: You must provide a name. >>>> %; \\
   /endif



tracking_unload.tf
CODE

;;;;;; declare/initialize variables
/eval /while ( {stack_enemyh} !~ "" ) \\
   /set current_enemy $(/pop stack_enemyh) %; \\
/undef enemyh_%{current_enemy} %; \\
/done
/unset stack_enemyh

/eval /while ( {stack_enemy} !~ "" ) \\
   /set current_enemy $(/pop stack_enemy) %; \\
/undef enemy_%{current_enemy} %; \\
/done
/unset stack_enemy

/eval /while ( {stack_allyh} !~ "" ) \\
   /set current_ally $(/pop stack_allyh) %; \\
/undef allyh_%{current_ally} %; \\
/done
/unset stack_allyh

/eval /while ( {stack_ally} !~ "" ) \\
   /set current_ally $(/pop stack_ally) %; \\
/undef ally_%{current_ally} %; \\
/done
/unset stack_ally

/eval /while ( {stack_markh} !~ "" ) \\
   /set current_mark $(/pop stack_markh) %; \\
/undef markh_%{current_mark} %; \\
/done
/unset stack_markh

/eval /while ( {stack_locate} !~ "" ) \\
   /set current_loc %(/pop stack_locate) %; \\
   /undef locate_%{current_loc} %; \\
/done
/unset stack_locate

/unset current_enemy
/unset current_ally
/unset current_mark
/unset current_loc



;;;;;; locate player
/unalias loc

/unalias loct

/unalias loce

/unalias loca

/unalias locm



;;;;;; default enemies and enemy highlights
;;; serenwilde enemies
;;; note: this command is run automatically by tfrc when you connect
/undef define_communeenemies
/undef communeenemies_start_catch
/undef communeenemies_row_catch
/unset stack_communeenemies_row
/undef communeenemies_done_catch

;;; serenguard enemies
;;; to get these set use GHELP ENEMIES and do it by hand for now.
/undef define_guildenemies

;;; personal enemies
/undef define_enemies



;;;;;; default allies and ally highlights
;;; serenguard leadership
/undef define_guildleadership

;;; business partners
/undef define_businesspartners

;;; suppliers
/undef define_suppliers

;;; personal allies
;;; note: this command is run automatically by tfrc when you connect
/undef define_allies



;;;;;; default mark highlights
/undef define_marks



;;;;;; add/remove enemy highlight
/unalias enemyh
/unalias unenemyh



;;;;;; add/remove ally highlight
/unalias allyh
/unalias unallyh



;;;;;; add/remove mark highlight
/unalias markh
/unalias unmarkh



;;;;;; enemy/unenemy a player (highlight in bolder color)
/unalias enemy
/unalias unenemy



;;;;;; ally/unally a player (highlight in bolder color)
/unalias ally
/unalias unally
Ixion2005-02-28 04:10:27
*boggle*

Too much coding for me. Let me reduce this for those of us who lack such comp skills.

THIRDEYE
WHO *look at red names quick*
MORE *look at red names quick*
MORE *look at red names quick*

Viola.
Unknown2005-02-28 04:19:27
hehe

That whole script isn't just for the Thirdeye stuff. The Thirdeye code is a very small portion near the top (the "loc" aliases). I included the entire tracking script for those people who are using it, or a derivative of it, so they could see how the new part fits in.

If you just wanted the Thirdeye portion, without the bells and whistles of the other systems integrated in, you'd just need the following:

CODE

/set stack_locate=



;;;;;; locate players
;;; Syntax: loc
/alias loc \\
  /if ( {#} > 0 ) \\
      /set stack_locate %{*} %; \\
      /while ( {stack_locate} !~ "" ) \\
          /let current_player $(/pop stack_locate) %; \\
          /def -mregexp -n0 -p4 -P1BCcyan -t".*\\\\b(%{current_player})\\\\b.*" locate_%{current_player} %; \\
      /done %; \\
      /set stack_locate %{*} %; \\
      /def -mregexp -n0 -p3 -ag -t".*" locate_gag_rest %; \\
      /def -mregexp -n1 -p4 -ag -t"^Your current pagelength: 25\\\\b" locate_finished = \\
          /while ( {stack_locate} !~ "" ) \\
              /let current_player $$(/pop stack_locate) %%; \\
              /undef locate_%%{current_player} %%; \\
          /done %%; \\
          /undef locate_gag_rest %; \\
      config pagelength 250 %; \\
      who %; \\
      config pagelength 25 %; \\
  /else \\
      who %; \\
  /endif

;;; locate target
/alias loct loc %{target}
Richter2005-02-28 05:18:46
That's just silly...

I have names color triggered, and when I type who, it lights up with all different colors. Red for enemies, orange for ooc friends, green for my merchants, and a few random ones.
Daganev2005-02-28 05:33:56
My third eye script is 5 lines of code, it shows you who your looking for and anybody else at thier location.
Ceres2005-02-28 08:55:05
We're waiting!

Mine's about 20 lines, and two classes sad.gif
Summer2005-02-28 09:36:15
QUOTE(daganev @ Feb 28 2005, 01:33 PM)
My third eye script is 5 lines of code, it shows you who your looking for and anybody else at thier location.
62144



If I had ZMud, I'd be begging biggrin.gif
Daganev2005-02-28 09:44:35
I'll sell my script for 2 credits.
Summer2005-02-28 10:39:57
Ooer, that's cheap. Really too bad I don't have Zmud then.
Unknown2005-02-28 13:05:13
Daganev:

Technically my script is only 1 line long...the TF language is designed to fit on one line. All of those "\\" tell TF to remove the line break and any leading whitespace for the following line. wink.gif

I'd be intersted in seeing your Thirdeye script. The feature of gathering everyone else at a person's location is what I was adding next. The easy way to do it would be to run WHO twice; once to get the target person's location and once to get everyone else at their location. The crafty way would be to run it once and store the WHO data in an array or stack of some sort, then run through the array the extra time.

Richter:

I understand it's possible to sift through the list of who names looking for highlighted names. But it's a chore at peak hours. I usualy run my client in a terminal with only 40-50 lines displayed (leaving room for my editors and maps and whatnot). I don't like having to type more 6 times and search 100 names. It's much easier to type "loc richter" and BAM, there it is. smile.gif It's possible to sift the who list, but why do it if you don't have to? wink.gif

Also, it's handy to use my script in a /repeat function. Just a quick command and every x number of seconds the location of the target person/group is printed on your screen. Nice to keep an eye out for them if you're waiting for them to leave a city/commune, or if you're out bashing and you know they might come try to jump you.
Daganev2005-03-03 20:39:45
yeah my script is very simple.
Run who twice with a wait
and capture all the information at once.
and gag it all.

offcourse it has to be in its own clas.
Soll2005-03-03 21:44:52
Selling Daganev's Thirdeye script for 1 credit. hide.gif

Only joking, Dag. halo.gif
Daganev2005-03-03 21:47:23
let me know if you get any takers....
celahir2005-03-04 12:56:19
Selling my own Thirdeye Script 2 credits, it tells you anyone in the room with the guy, plus you can say it over channels. Will soon be able to scry multiple people at once.
Alger2005-03-15 03:06:48
umm the tf location line is 1 line dag. Its just conventional writing why it looks long if you guys got your zmud trig and stack out the if/thens it would be pretty long and very repetative too i could imagine.