-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathidentify.mod
68 lines (58 loc) · 1.75 KB
/
identify.mod
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ACTION {It may be referred to as "%1"} {#VAR {itemwords} {%1}}
#NOP : Quick and dirty way to save where we pick up items by using room vnums
#ALIAS {store} {look %1; #DELAY 0.5 {#line log item_room.vnm {$itemwords found in $playerpos}}}
#ALIAS {liststore} {#SYS cat item_room.vnm}
#ALIAS {rmstore} {#SYS rm item_room.vnm}
#NOP : Grab the keywords for the item and begin logging output to temp item file
#ACTION {You give %1 to Parth the Appraiser}
{
#VAR {itemlong} {%1};
#LOG overwrite .itemlog
}
#NOP : Stop logging, call cleanup alias and most importantly reset the variables
#ACTION {Parth the Appraiser gives you %1.}
{
#DELAY 0.3 {#LOG {off}};
cleanup
}
#NOP : Append the keywords to the item textfile, then append the item data afterward
#ALIAS {cleanup}
{
#SYS {echo "ITEM $itemwords" > .itemlog_temp};
#SYS {sed -ne "/\"$itemlong/,$ p" .itemlog >> .itemlog_temp};
#SYS {./itemparse.py}
}
#NOP : Force itemvariables to reset after each cycle
#ALIAS {resetvar}
{
#var itemwords {NULL};
#var itemlong {NULL}
}
#NOP : Look at item to grab keywords, then force a delay so $itemwords gets a real
#NOP value, then give the item to identify NPC
#ALIAS {identify}
{
look %1;
#DELAY 0.75 {give %1 parth}
}
#NOP : Crude search by $itemwords, then forces a carriage return for formatting
#ALIAS {find}
{
#VAR itemwords NULL;
#DELAY 0.3 {look %1};
#DELAY 1 {finditem $itemwords}
}
#NOP : Lets us pick an item ourselves without looking
#ALIAS {finditem}
{
#VAR item NULL;
#VAR item %1;
#SYS {grep -i $item mozart.db}
}
#NOP : Lets us assign a room vnum to where an item is located!
#ALIAS {itemvnum}
{
#SYS {./itemparse.py setvnum %1 %2}
}
#NOP : Shows A complete list of identified items
#ALIAS {listitems} {#SYS cat mozart.db}