Automatizing automatizer

Everything about ToME 2.x.x. No spoilers, please

Moderator: Moderator

Post Reply
Message
Author
Shany
Low Yeek
Posts: 8
Joined: Wed May 27, 2015 1:32 pm

Automatizing automatizer

#1 Post by Shany »

Remembered about my old old script and .prf file from times when I decided not to write automat.atm by hand but to generate it from the start of every new game by destroying certain unneeded items. I found it more handy comparing to any universal pre-written rules. Ok, more controllable at least.

I use F8 and F9 keys to "destroy and add rule" for item on the floor (by type and by family respectively), and F10 to "save rules and exit":

Code: Select all

A:\e\e\e\e\e\e\e\e\e\e099^D$-\ry\sST
P:\[F8]
A:\e\e\e\e\e\e\e\e\e\e099^D$-\ry\sSF
P:\[F9]
A:\e\e\e\e\e\e\e\e\e\e=Ts\ry\s\e\e^X\e
P:\[F10]
Also I wrote this script to erase dupes from automat.atm, and to have more sensible names like "d RING" or "d POTION" instead of this bunch of nameless "destroy"-s:

Code: Select all

#!/bin/bash
d=$HOME/.tome/2.4
a=$d/automat.atm
[ -f $a ] && {
  cat $a | tr '\n' ' ' | tr -s ' ' | sed 's/{\s*"action":/\n&/g; s/\s*]\s*$/\n]/' |
    grep '^{' | sort -u >$a.tmp
  grep -o 'TV_[a-Z0-9_]*]*  *[0-9][0-9]*' <lib/help/defines.txt | tr -d ']' | sed s/TV_// |
    while read tv n; do
      sed -i '/"tval": '$n',/ s/"name": "destroy"/"name": "d '$tv'"/' $a.tmp
    done
  { echo \[
    grep -o '"name":[^}]*' $a.tmp | cut -d \" -f4 | sort -u | while read n; do
      grep '"name": "'"$n"\" $a.tmp
    done | sed 's/}$/},/; $ s/},\s*$/}/'
    echo \]
  } >$a
  rm $a.tmp
}
./src/tome
Maybe someone else will find it useful.

Yottle
Reaper
Posts: 1753
Joined: Sun Jan 26, 2003 11:49 pm
Location: West Virginia

Re: Automatizing automatizer

#2 Post by Yottle »

I have always used (N)ame instead of (T)ype. I assume that they do the same thing most of the time, although some ego items like indestructible rings have different names from vanilla ones.

Shany
Low Yeek
Posts: 8
Joined: Wed May 27, 2015 1:32 pm

Re: Automatizing automatizer

#3 Post by Shany »

Yottle wrote:I have always used (N)ame instead of (T)ype. I assume that they do the same thing most of the time, although some ego items like indestructible rings have different names from vanilla ones.
Maybe I used (T)ype because I played an Alchemist, so I never destroyed any "very good" and better equipment, but extracted essences from it. For other classes it's a good idea to use (N)ame instead.

jacobrosoto
Posts: 1
Joined: Tue Oct 27, 2015 10:58 pm

Re: Automatizing automatizer

#4 Post by jacobrosoto »

Is alchemist is good? What is this all about? And is the main function of an Alchemist?

_______________
automatic knife
Last edited by jacobrosoto on Mon Nov 23, 2015 7:00 am, edited 1 time in total.

Yottle
Reaper
Posts: 1753
Joined: Sun Jan 26, 2003 11:49 pm
Location: West Virginia

Re: Automatizing automatizer

#5 Post by Yottle »

jacobrosoto wrote:Is alchemist is good? What is this all about? And is the main function of an Alchemist?
Alchemists can learn to make potions, scrolls, rings, amulets, weapons, and armor at will. At high levels they can add properties and increase the pluses on artifacts.

They need tons of gold to buy stuff to learn the recipes to make it, but they can make valuable stuff from trash, including essences. So they are pretty easy to play early on. Once they can make artifacts with high +life they are invincible (and boring). Take a look at the alchemist winners on the ladder.

Post Reply