I made a silly macro that plays Crawl!


If it doesn't fit anywhere else, it belongs here. Also, come here if you just need to get hammered.

Mines Malingerer

Posts: 35

Joined: Wednesday, 5th February 2014, 19:07

Post Friday, 9th January 2015, 03:40

I made a silly macro that plays Crawl!

http://i.imgur.com/dj1HPZS.webm

Basically I just wrote a program that simulates Crawl-relevant keypresses in a pattern. It reads absolutely 0 information from the game, so it's not an AI of any form, just a dumb macro. I know it's nothing revolutionary, but I like to watch it and silently root for it nonetheless!

Notes and restrictions:
-Has to be a mummy, since a food clock would be hard to manage when we're effectively mashing buttons. As for class, Fighter is the best to spam tab with (winning over Gl in my experience since the extra defensive-oriented stuff helps in packs) and axes are a no-brainer since our mummy knows nothing of corridor fighting.
-Will get stuck infinitely if an enemy is in view but unreachable (plants, glass walls, etc.)
-Tie-in with the previous note, will be unable to do anything if TAB becomes unusable, most notably through low-HP. I think there's a way to shut this warning though, and I never use tab normally, so I wouldn't mind doing that if I knew how to.
-Sometimes takes so long turn-wise that OOD monsters will spawn. Vampire Mosquitoes on D:1!

And for anyone interested, here's some pseudocode for the key pattern it follows:
Spoiler: show
//Explore Loop
{
tab x8 //fight
shift+5 (wait 80ms) //rest
o (wait 200ms) //explore
space //--more-- handling
s //Stat increase, arbitrarily is Str
} x84

Y //Y/N dialog handling

//Leave Floor Loop
{
X, >, Enter (wait 100ms) //Go to staircase
> //Go to next floor
tab x8 //Fight enemies on the way
} x12

//And repeat.
//The numbers are more or less arbitrary and subject to change, I just found they worked well.


I hope you all found this interesting!
limboring→optimal sanity = 0

Sar

User avatar

Ziggurat Zagger

Posts: 6418

Joined: Friday, 6th July 2012, 12:48

Post Friday, 9th January 2015, 04:04

Re: I made a silly macro that plays Crawl!

Mines Malingerer

Posts: 35

Joined: Wednesday, 5th February 2014, 19:07

Post Friday, 9th January 2015, 04:12

Re: I made a silly macro that plays Crawl!

Ah, I figured something like that had already been made but I didn't explicitly know about it. But this is much smaller scope, basically it was me thinking "man, D:1-3 are so easy! I bet I could write something that does it for me!" This was a more Crazy Yiuf approach though, because it is entirely blind.
limboring→optimal sanity = 0

Ziggurat Zagger

Posts: 8786

Joined: Sunday, 5th May 2013, 08:25

Post Friday, 9th January 2015, 04:17

Re: I made a silly macro that plays Crawl!

dang i havent seen that game maker dialog box since like 2007

Mines Malingerer

Posts: 35

Joined: Wednesday, 5th February 2014, 19:07

Post Friday, 9th January 2015, 05:03

Re: I made a silly macro that plays Crawl!

Game Maker is great for making stuff quick! I made this in like 20 minutes (but then tweaked the numbers for a while after). But I've used GM for 11 years so maybe I'm just too attached :lol:
limboring→optimal sanity = 0

Ziggurat Zagger

Posts: 6454

Joined: Tuesday, 30th October 2012, 19:06

Post Friday, 9th January 2015, 05:49

Re: I made a silly macro that plays Crawl!

Veras wrote:http://i.imgur.com/dj1HPZS.webm

Basically I just wrote a program that simulates Crawl-relevant keypresses in a pattern. It reads absolutely 0 information from the game, so it's not an AI of any form, just a dumb macro. I know it's nothing revolutionary, but I like to watch it and silently root for it nonetheless!

Notes and restrictions:
-Has to be a mummy, since a food clock would be hard to manage when we're effectively mashing buttons. As for class, Fighter is the best to spam tab with (winning over Gl in my experience since the extra defensive-oriented stuff helps in packs) and axes are a no-brainer since our mummy knows nothing of corridor fighting.
-Will get stuck infinitely if an enemy is in view but unreachable (plants, glass walls, etc.)
-Tie-in with the previous note, will be unable to do anything if TAB becomes unusable, most notably through low-HP. I think there's a way to shut this warning though, and I never use tab normally, so I wouldn't mind doing that if I knew how to.
-Sometimes takes so long turn-wise that OOD monsters will spawn. Vampire Mosquitoes on D:1!

And for anyone interested, here's some pseudocode for the key pattern it follows:
Spoiler: show
//Explore Loop
{
tab x8 //fight
shift+5 (wait 80ms) //rest
o (wait 200ms) //explore
space //--more-- handling
s //Stat increase, arbitrarily is Str
} x84

Y //Y/N dialog handling

//Leave Floor Loop
{
X, >, Enter (wait 100ms) //Go to staircase
> //Go to next floor
tab x8 //Fight enemies on the way
} x12

//And repeat.
//The numbers are more or less arbitrary and subject to change, I just found they worked well.


I hope you all found this interesting!

If you wanted to make it more effective, you could use G> to always go downstairs (As long as you've found at least one)

You can also do 'eaebecedeeefegeheiejekel.....eZ' to feed yourself at periodic intervals if you wanted to make it not require you be a mummy.

You could use "dZctrl-F<battleaxe><enter>=ibZ=iab,db,wadb" (and similar) to upgrade weapons, presuming you were using a gladiator and not a fighter (You could probably remove the shield and then try to wear it again after wielding, that way if you were still using a one handed weapon, you'd re-wear the shield, but if you were using a two handed weapon, it'd just fail.)

control-F<something><enter> is probably a good way to have your "blind macro" guy get various things you might have found and want.

It's interesting to wonder how "smart" you could make it.

Oh, and I'd probably just alternate {o} and {tab}, since you can only autoexplore if there's no critters in sight, and you can only autofight something if there is a critter in sight, so hitting o/tab is "Fight or explore there's nothing to fight"

I'd probably also have the the macro turn on autopickup of tomahawks and javalins, at game start (That way your {tab} would attack at range where possible, reducing damage taken)

If you turn off travel delays and waiting delays in your init file, you probably won't have to stick the waits in your macros.
Spoiler: show
This high quality signature has been hidden for your protection. To unlock it's secret, send 3 easy payments of $9.99 to me, by way of your nearest theta band or ley line. Complete your transmission by midnight tonight for a special free gift!
User avatar

Ziggurat Zagger

Posts: 4478

Joined: Wednesday, 23rd October 2013, 07:56

Post Friday, 9th January 2015, 07:58

Re: I made a silly macro that plays Crawl!

That was fun to watch. Maybe you should increase dex, though?
DCSS: 97:...MfCj}SpNeBaEEGrFE{HaAKTrCK}DsFESpHu{FoArNaBe}
FeEE{HOIEMiAE}GrGlHuWrGnWrNaAKBaFi{MiDeMfDe}{DrAKTrAMGhEnGnWz}
{PaBeDjFi}OgAKPaCAGnCjOgCKMfAEAtCKSpCjDEEE{HOSu
Bloat: 17: RaRoPrPh{GuStGnCa}{ArEtZoNb}KiPaAnDrBXDBQOApDaMeAGBiOCNKAsFnFlUs{RoBoNeWi

Mines Malingerer

Posts: 35

Joined: Wednesday, 5th February 2014, 19:07

Post Friday, 9th January 2015, 16:02

Re: I made a silly macro that plays Crawl!

Thanks for the advice Siegurt. I tried out a food-eating character to good results. It only took me a few tests and several miscalculated starvations to get down to D:4 and even kill a player ghost (though I died to another one).

Image

I went with a MiFi. Gl might be better, but I'm worried about the flimsiness in large crowds. It currently switches training to mode 2 and supertrains axes. Not sure what would be optimal though. It doesn't switch weapons yet but if it were to theoretically drop everything at game start and then Ctrl+F for things in order I could get the inventory in a predictable layout and then work from there. The eat loop currently Ctrl+Fs for corpses and butchers them and then tries to eat chunks, and then eats any permafood until it's engorged. It might just butcher a kobold though, but it's worth a shot in preserving some food. I'm also thinking about adding long-ish timers that search for altars or Go to the temple if possible. But I would probably want a god with good passive abilities and few actives since it's impossible to know when to activate them. Maybe Qaz since no sacs, good passives, brainless resistances, and this thing won't end up being stealthy whatsoever. Plus his piety gain kind of appreciates you being brave/an idiot, so there's that.

Good point Sprucery, I will probably change it to Dex. Str was just a random choice to get past the menu :P
limboring→optimal sanity = 0

Ziggurat Zagger

Posts: 2996

Joined: Tuesday, 28th June 2011, 20:41

Location: Berlin

Post Friday, 9th January 2015, 16:16

Re: I made a silly macro that plays Crawl!

I think Makhleb would be better than Qaz for this (heals-on-kills being better than clouds, especially if you are recklessly tabbing with axes).

Mines Malingerer

Posts: 35

Joined: Wednesday, 5th February 2014, 19:07

Post Saturday, 10th January 2015, 00:46

Re: I made a silly macro that plays Crawl!

Good point on Makhleb. I might add the god clause and a weapon search and then carry this a little further before I stop, since diminishing returns will kick in fast. Plus if this thing ever made it to Lair it would attempt to chop a hydra's heads off until it died (which would be funny to watch but not intended behavior :mrgreen: ) I do want to get down somewhere respectable like D:8 or something, before the game becomes too complex for a series of repeating keypresses to handle.

Oh yeah and I think imgur killed my gif so here's a rehost.
https://copy.com/nOmyvARBoi1PhTbc
limboring→optimal sanity = 0

Return to Crazy Yiuf's Corner

Who is online

Users browsing this forum: No registered users and 21 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.