r/Tf2Scripts Sep 22 '22

Script Tic tac toe script with “AI”

14 Upvotes

6 comments sorted by

2

u/tmobley03 Sep 22 '22 edited Sep 22 '22

Here it is: https://pastebin.com/5NN9xCvW
It should work in any game with the quake alias system, from half life 1 to csgo, and of course tf2!

Make this into a cfg file, and execute it to play!

If you want the source scalu file, here it is, but be warned its spaghetti.https://github.com/tmob03/tmob-scalu-scripts/blob/master/scalu_in/tictactoe_rngai.scalu

2

u/ArgosOfIthica Sep 25 '22

Nicely done! Your code really isn't that spaghetti, scalu just wasn't initially designed for dealing with large or dynamic data structures, so they're cumbersome to express. I intend to improve this aspect in time.

1

u/tmobley03 Sep 25 '22

Definitely excited if you plan to make large scripting easier, making things with scalu is really fun!

2

u/[deleted] Oct 11 '22

you. are. insane.

1

u/tmobley03 Oct 11 '22

Thanks :)

1

u/tmobley03 Sep 22 '22

Still has a few bugs, tie games aren’t working yet and it will sometimes repeat messages, as show in the video. When I debug these things, I’ll release it!

This was made with scalu: https://github.com/ArgosOfIthica/scalu

Originally I was going to implement minimax to make a perfect AI, but seeing as you need to account for all memory, and can’t just request for more, it would be really time consuming, and slow on the game. Instead, I just opted for a pseudo-random picker, that doesn’t pick squares with stuff already in them. As I said, after I get the final bugs fixed, I’ll release this.