PowTTY actions / aliases for locate, teleport, portal

Here we discussed clients, mappers, tunnels and their settings.
Locked
Antti
Posts: 13
Joined: Sun Feb 24, 2008 9:13 am
Location: .fi

PowTTY actions / aliases for locate, teleport, portal

Post by Antti »

Moi,
what kind of actions / aliases you are using for getting port keys and storing them for teleport and portal commands ?
I am so sure that there must be a better way than what I am using currently...

Thanks, Antti
Imago
Posts: 18
Joined: Tue Oct 21, 2008 7:50 pm
Location: South Carolina, USA
Contact:

Re: PowTTY actions / aliases for locate, teleport, portal

Post by Imago »

I'm not sure how you would classify this, but it's basically just a variable system:

key1-8 sets the keys, key1is sets where it goes too, tp1-8 ports you there and all that. Same as wr1 watchkey, watchlabel etc. portkeys should show them in a nice little format.

Code: Select all

#("teleport/watchroom/scry/portal stuff")
#alias wr1=cast ${speed} 'watch room' ${watchkey} ${watchlabel}
#alias wr2=cast ${speed} 'watch room' ${watchkey2} ${watchlabel2}
#alias wr3=cast ${speed} 'watch room' ${watchkey3} ${watchlabel3}
#alias wr4=cast ${speed} 'watch room' ${watchkey4} ${watchlabel4}
#alias watchkey1={#var $watchkey=$1|#print ("# Watch room/scry key 1 is now set to: "+$watchkey)|#print (" ")}
#alias watchkey2={#var $watchkey2=$1|#print ("# Watch room/scry key 2 is now set to: "+$watchkey2)|#print (" ")}
#alias watchkey3={#var $watchkey3=$1|#print ("# Watch room/scry key 3 is now set to: "+$watchkey3)|#print (" ")}
#alias watchkey4={#var $watchkey4=$1|#print ("# Watch room/scry key 4 is now set to: "+$watchkey4)|#print (" ")}
#alias watchlabel1={#var $watchlabel=$1|#print ("# Watchroom label is now set to: "+$watchlabel)|#print (" ")}
#alias watchlabel2={#var $watchlabel2=$1|#print ("# Watchroom label 2 is now set to: "+$watchlabel2)|#print (" ")}
#alias watchlabel3={#var $watchlabel3=$1|#print ("# Watchroom label 3 is now set to: "+$watchlabel3)|#print (" ")}
#alias watchlabel4={#var $watchlabel4=$1|#print ("# Watchroom label 4 is now set to: "+$watchlabel4)|#print (" ")}
#alias tp1=cast ${speed} 'teleport' ${key}
#alias tp2=cast ${speed} 'teleport' ${key2}
#alias tp3=cast ${speed} 'teleport' ${key3}
#alias tp4=cast ${speed} 'teleport' ${key4}
#alias tp5=cast ${speed} 'teleport' ${key5}
#alias tp6=cast ${speed} 'teleport' ${key6}
#alias tp7=cast ${speed} 'teleport' ${key7}
#alias tp8=cast ${speed} 'teleport' ${key8}
#alias scry1=cast ${speed} 'scry' ${watchkey}
#alias scry2=cast ${speed} 'scry' ${watchkey2}
#alias scry3=cast ${speed} 'scry' ${watchkey3}
#alias scry4=cast ${speed} 'scry' ${watchkey4}
#alias safekey={#var $safekey=$1|#print (" ")|#print ("# Safe port key is now set to: "+$safekey)|#print (" ")}
#alias safekeyis={#var $safekeyis=$0|#print (" ")|#print ("# Safe port key ports to: "+$safekeyis)|#print (" ")}
#alias portal1=cast norm 'portal' ${direction} ${key}
#alias portal2=cast norm 'portal' ${direction} ${key2}
#alias portal3=cast norm 'portal' ${direction} ${key3}
#alias portal4=cast norm 'portal' ${direction} ${key4}
#alias portal5=cast norm 'portal' ${direction} ${key5}
#alias portal6=cast norm 'portal' ${direction} ${key6}
#alias portal7=cast norm 'portal' ${direction} ${key7}
#alias portal8=cast norm 'portal' ${direction} ${key8}
#alias portaldir={#var $direction=$1|#print ("- Portal casting direction is now set to: "+$direction)|#print (" ")}
#alias key1={#var $key=$1|#print ("# Port key 1 is now set to: "+$key)|#print (" ")}
#alias key1is={#var $key1is=$0|#print ("- Key 1 ports to: "+$key1is)|#print (" ")}
#alias key2={#var $key2=$1|#print ("# Port key 2 is now set to: "+$key2)|#print (" ")}
#alias key2is={#var $key2is=$0|#print ("- Key 2 ports to: "+$key2is)|#print (" ")}
#alias key3={#var $key3=$1|#print ("# Port key 3 is now set to: "+$key3)|#print (" ")}
#alias key3is={#var $key3is=$0|#print ("- Key 3 ports to: "+$key3is)|#print (" ")}
#alias key4={#var $key4=$1|#print ("# Port key 4 is now set to: "+$key4)|#print (" ")}
#alias key4is={#var $key4is=$0|#print ("- Key 4 ports to: "+$key4is)|#print (" ")}
#alias key5={#var $key5=$1|#print ("# Port key 5 is now set to: "+$key5)|#print (" ")}
#alias key5is={#var $key5is=$0|#print ("- Key 5 ports to: "+$key5is)|#print (" ")}
#alias key6={#var $key6=$1|#print ("# Port key 6 is now set to: "+$key6)|#print (" ")}
#alias key6is={#var $key6is=$0|#print ("- Key 6 ports to: "+$key6is)|#print (" ")}
#alias key7={#var $key7=$1|#print ("# Port key 7 is now set to: "+$key7)|#print (" ")}
#alias key7is={#var $key7is=$0|#print ("- Key 7 ports to: "+$key7is)|#print (" ")}
#alias key8={#var $key8=$1|#print ("# Port key 8 is now set to: "+$key8)|#print (" ")}
#alias key8is={#var $key8is=$0|#print ("- Key 8 ports to: "+$key8is)|#print (" ")}
#alias ack=cast norm 'teleport' ${safekey}
#($watchkey = "watchkey")
#($watchkey2 = "watchkey2")
#($watchkey3 = "watchkey3")
#($watchkey4 = "watchkey4")
#($watchlabel = "watchlabel")
#($watchlabel2 = "watchlabel2")
#($watchlabel3 = "watchlabel3")
#($watchlabel4 = "watchlabel4")
#($direction = "up")
#($key = "key1")
#($key1is = "Not set")
#($key2 = "key2")
#($key2is = "Not set")
#($key3 = "key3")
#($key3is = "Not set")
#($key4 = "key4")
#($key4is = "Not set")
#($key5 = "key5")
#($key5is = "Not set")
#($key6 = "key6")
#($key6is = "Not set")
#($key7 = "key7")
#($key7is = "Not set")
#($key8 = "key8")
#($key8is = "Not set")
#($safekey = "safekey")
#($safekeyis = "safekeyis")
#alias portkeys={#print ("Your port keys:")|#print ("- Key 1: "+$key)|#print ("^ Key 1 ports to: "+$key1is)|#print (" ")|#print ("- Key 2: "+$key2)|#print ("^ Key 2 ports to: "+$key2is)|#print (" ")|#print ("- Key 3: "+$key3)|#print ("^ Key 3 ports to: "+$key3is)|#print (" ")|#print ("- Key 4: "+$key4)|#print ("^ Key 4 ports to: "+$key4is)|#print (" ")|#print ("- Key 5: "+$key5)|#print ("^ Key 5 ports to: "+$key5is)|#print (" ")|#print ("- Key 6: "+$key6)|#print ("^ Key 6 ports to: "+$key6is)|#print (" ")|#print ("- Key 7: "+$key7)|#print ("^ Key 7 ports to: "+$key7is)|#print (" ")|#print ("- Key 8: "+$key8)|#print ("^ Key 8 ports to: "+$key8is)|#print (" ")|#print ("- SAFE PORT KEY: "+$safekey)|#print ("^ Safe Key ports to: "+$safekeyis)|#print (" ")|#print ("Portal direction: "+$direction)|#print (" ")}
#alias watchkeys={#print ("Your watch keys:")|#print ("- Watchkey1: "+$watchkey)|#print ("^ Watchkey1 is: "+$watchlabel)|#print (" ")|#print ("- Watchkey2: "+$watchkey2)|#print ("^ Watchkey2 is: "+$watchlabel2)|#print (" ")|#print ("- Watchkey3: "+$watchkey3)|#print ("^ Watchkey3 is: "+$watchlabel3)|#print (" ")|#print ("- Watchkey4: "+$watchkey4)|#print ("^ Watchkey4 is: "+$watchlabel4)|#print (" ")}
Antti
Posts: 13
Joined: Sun Feb 24, 2008 9:13 am
Location: .fi

Re: PowTTY actions / aliases for locate, teleport, portal

Post by Antti »

Does not fully belong under this topic but:

I use the same powtty script for all characters of mine.
It contains for example key- and herb- dictonaries, fancy substitutions like >>>EAST, some highlights etc.

The question is, how much actions, markings, aliases one can define in a script before it actually starts to slow down your playing ?
And quesstimations and which factors are the limiting ones (computer's CPU%, amount of lines is a script or what?)

ty.
Elestir
Posts: 231
Joined: Sat Feb 23, 2008 11:47 pm
Location: Olomouc, Czech Republic
Contact:

Re: PowTTY actions / aliases for locate, teleport, portal

Post by Elestir »

What makes the client slower are actions, substitutions and highlights that require the client to thoroughly examine each line that comes from the MUD. Some actions/etc. can be written more or less optimally, to minimize the overhead. Next candidate is of course actions/etc. that perform complex calculations, string manipulations, etc.

Example of optimally written powwow action (purpose is to highlight the "Leader leaves" line and store the direction of his movement in a variable):

Code: Select all

#action >optimal ^Elestir leaves $1={#print (attr"white"+$(0)+noattr);#($moving_dir=$(1).1)}
Example of equal non-optimally written one:

Code: Select all

#action >non_optimal ${leader} leaves &1.={#print (attr"white"+$(0)+noattr);#($moving_dir=$(1).1)}
  1. Why is the latter non-optimal?
  2. Because it lacks the ^ telling the client the line must start at the beginning of the line (it would simplify the comparison)
  3. Because it uses just-in-time variable ${leader}, and hence before each comparison (i.e. for every line coming from MUD) requires the client to lookup $leader variable (this is still very fast) and perform sub-string replacement (this is somewhat slower).
  4. Because it uses &1 followed by another character (in our case a dot: .) rather than $1 ($1 followed by nothing tells powwow it should look just for a single word and ignore the rest, while &1. doesnt allow client to ignore anything).
In respect to point 2, you could argue, that the second example is more generic as it will work on any leader, while first one only on Elestir. That is true, but optimal approach is to redefine the whole action each time the leader changes. This redefinition will then be of course bit more complicated than simple change of variable, but you change leader very rarely, while the action gets matched against the game input very frequently, hence you should optimize the action for speed rather than for customizability.
Locked