Skip to content

Commit 8a5aed9

Browse files
committed
feat: Move qw Lua to a separate file
This commit moves qw's lua into `qw.lua` and provides instructions in `qw.rc` for how to include the lua file when running crawl. The benefit of this is allowing the editing of qw's complicated Lua in an editor's Lua mode without requiring a special syntax file. This commit updates README.md with updated instructions for running qw and also updates various outdated information.
1 parent b34f1df commit 8a5aed9

File tree

3 files changed

+8338
-8309
lines changed

3 files changed

+8338
-8309
lines changed

README.md

Lines changed: 45 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,50 +3,67 @@
33
This rcfile is elliptic's DCSS bot "qw", the first bot to win DCSS with no
44
human assistance. A substantial amount of code here was contributed by elliott
55
or borrowed from N78291's bot "xw", and many others have contributed as well.
6-
The bot is now maintained by the dcss devteam. Please post bug reports as issues
7-
on the official crawl qw repository:
6+
The bot is now maintained by the dcss devteam. Please post bug reports as
7+
issues on the official crawl qw repository:
88

99
https://github.com/crawl/qw/issues/new
1010

11-
The current version of qw can start as any species/background combination
12-
and has some basic grasp of how many of the gods work (see qw.rc
13-
for configuration details). Note though that most spells and racial
14-
abilities aren't used, and qw is not very good at most combos! Its best
15-
3-rune combo at the moment is DDFi^Makhleb, which manages a winrate of about
16-
15% in offline testing. It can optionally try to get more runes, with its
17-
preferred combo for that being GrFi^Okawaru, converting to TSO after Slime
18-
(15-rune winrate for this build is about 1%).
11+
The current version of qw can start as any species/background combination and
12+
has some basic grasp of how many of the gods work (see qw.rc for configuration
13+
details). Note though that most spells and racial abilities aren't used, and qw
14+
is not very good at most combos! Its best 3-rune combo at the moment is
15+
DDFi^Makhleb, which manages a winrate of about 15% in offline testing. It can
16+
optionally try to get more runes, with its preferred combo for that being
17+
GrFi^Okawaru, converting to TSO after Slime (15-rune winrate for this build is
18+
about 1%).
1919

20-
## running on remote DCSS server
20+
## Running on remote DCSS server
2121
* Please make sure you have permission to run a bot on your server of choice!
2222
Misconfigured (or even well-configured) bots can eat up server CPU from
2323
actual players.
24-
* go to e.g. http://crawl.akrasiac.org:8080/
25-
* click "(edit rc)" link for DCSS trunk
26-
* replace text that were here with contents of qw.rc file from this repo
27-
* in ": DELAYED = false" and ": AUTO_START = false" lines change "false" to "true"
28-
* you may also want to edit some of the configuration lines near the top
24+
* Go to e.g. http://crawl.akrasiac.org:8080/
25+
* Click "(edit rc)" link for DCSS trunk
26+
* Replace text that were here with contents of `qw.rc` file from this repo
27+
in `: DELAYED = false` and `: AUTO_START = false` lines change `false` to
28+
`true`
29+
* You may also want to edit some of the configuration lines near the top
2930
of qw.rc (for instance to choose which combos qw will play)
30-
* save and run DCSS trunk (either in webtiles or in console)
31-
* enjoy!
31+
* At the end of the contents of `qw.rc`, remove the line with `include =
32+
qw.lua` and put the contents of the `qw.lua` file in this repository in
33+
its place. Note that the line with `{` at the beginning of `qw.lua` and the
34+
line with `}` at the end must also be included.
35+
* Save and run DCSS trunk (either in webtiles or in console)
36+
* Enjoy!
3237

3338
Since clua works on the server side, webtiles drawing can lag behind things
34-
actually happening, so the IRC bot [Sequell](https://github.com/greensnark/dcss_sequell) may tell you your character killed Sigmund or died to him before you see that with your own eyes. To see more current events just refresh the page and press "Tab". Alternatively, run or watch the bot in console (via ssh).
39+
actually happening, so the IRC bot [Sequell](https://github.com/crawl/sequell)
40+
may tell you your character killed Sigmund or died to him before you see that
41+
with your own eyes. To see more current events just refresh the page and press
42+
"Tab". Alternatively, run or watch the bot in console (via ssh).
3543

3644
If you are familiar with Sequell, please add the name of the account that
3745
you are using for qw to the "bot" nick with "!nick bot <accountname>" so
3846
that games on the account can be easily filtered out of queries. (Also, please
3947
don't run qw on the same account that you use for your own personal games!)
4048

41-
## running locally
42-
* clone this repo
43-
* run crawl locally with command like "./crawl -rc qw/qw.rc"
44-
* enter name if necessary and start game. If you did not change "AUTO_START" variable, press "Tab"
45-
* enjoy!
49+
## Running locally
50+
* Clone this repo
51+
* Run crawl locally with command like `./crawl -rc qw/qw.rc -rcdir qw`. The
52+
`-rcdir` option is necessary for `crawl` to find the `qw.lua` file.
53+
Alternately you can put the contents of `qw.lua` directly in `qw.rc` per the
54+
instructions above for online play.
55+
* Enter name if necessary and start game. If you did not change `AUTO_START`
56+
variable, press "Tab"
57+
* Enjoy!
4658

47-
The file qw.exp is a simple expect script that automates running qw for many games in a row. The "AUTO_START" variable should be left at false when when using this. (With minor modifications, this can also be used to run games on a remote server over ssh.)
59+
The file qw.exp is a simple expect script that automates running qw for many
60+
games in a row. The `AUTO_START` variable should be left at false when when
61+
using this. (With minor modifications, this can also be used to run games on a
62+
remote server over ssh.)
4863

49-
## miscellaneous tips for coding/testing qw
64+
## Miscellaneous tips for coding/testing qw
5065
* run qw locally with the DCSS command-line option -seed <n> to use a seeded RNG for (mostly) reproducible testing
51-
* uncomment the "say(plandata[2])" line in the cascade function to track what the bot is doing (very spammy)
52-
* put code you want to test in the "ttt()" funtion on the bottom; make it run by macroing some key to "===ttt"
66+
* uncomment the "say(plandata[2])" line in the cascade function to track what
67+
the bot is doing (very spammy)
68+
* put code you want to test in the "ttt()" funtion on the bottom; make it run
69+
by macroing some key to "===ttt"

0 commit comments

Comments
 (0)