StealthBot.net: Tic Tac Toe - StealthBot.net

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Tic Tac Toe On stealthbot!?

#1 User is offline   oblivious Icon

  • Full Member
  • PipPipPip
  • Group: Senior Members
  • Posts: 315
  • Joined: October-25 09

Posted January 04, 2010 - 07:13 AM

Tic Tac Toe

Author: Oblivious
Version: 1.0 Revision 0
Description: Allows a user to play Tic Tac Toe with another stealthbot user (or if you're smart about it, anyone!)

Installation Notes:

Save the text file into the script folder.


Commands:

tictactoe [command] = Allows you to perform a few commands to control the tic tac toe game. Default required access is 200.

Internal Commands:
Note: You must include the fullstops if there is a full stop in front of the command.
.reset = Allows the user to reset the game.
.forfeit = Allows the user to forfeit the game.
.accept = Allows the user to accept a challenge.
(username) = Allows the user to challenge the specified username.

Example Usages:
/tictactoe friend - will challenge the user 'friend' to a game of tic tac toe.
/tictactoe .accept - will accept a challenge issued to you


Notes:

  • The . in front of internal commands makes sure you can play with people named 'reset' or 'accept' or 'forfeit'. You must type the . It is unrelated to your trigger.
  • It is possible to write your own client for Tic Tac Toe, or play without using a stealthbot script by following the protocol (or using your own protocol, but then you can't communicate with people using this one!) It is simple.
    • A challenge is initiated (or sent) by sending to the person "TIC" (Tic Tac Toe Initiate Challenge).
    • A challenge is Accepted by replying "TAC" (Tic Tac Toe Accept Challenge).
    • If you forfeit, send "TFF", that stands for Tic Tac Toe ForFeit.
    • If you want to reset your game board, it is polite to notify the other player, so send "TRG" (Tic Tac Toe Reset Game).
    • Moves are sent by sending "TM" followed by the cell represented by a number 0 to 8. 0 is top left, and the numbers proceed to the right. The following represents the game board.

      012
      345
      678

    • The "TOE" has no meaning, it's there for a bit of fun

  • Please post in this thread or send me a message if you find any problems with this script. I've tested it and it works well, you can win and lose a game perfectly fine, but there might have been something I missed.


#2 User is offline   oblivious Icon

  • Full Member
  • PipPipPip
  • Group: Senior Members
  • Posts: 315
  • Joined: October-25 09

Posted January 04, 2010 - 08:19 AM

I fixed a problem which occurred because of my stupidity.




This one fixes the error of trying to whisper someone who does not exist when reloading the script.

This post has been edited by oblivious: January 04, 2010 - 08:23 AM


#3 User is offline   Novynn Icon

  • Silver Member
  • PipPipPipPipPip
  • Group: Senior Members
  • Posts: 873
  • Joined: October-07 09

Posted January 04, 2010 - 09:15 AM

Um, you do know that you don't have to wait to play?

In other words, I can click on all of the grid items, without the other player doing anything...

Quote

[22:12:56] <From Northwind#2> TIC
[22:12:56] [TTT] You have been requested by Northwind#2 to play a game of Tic Tac Toe. Type /tictactoe .accept to play.
[22:13:02] [TTT] Resetting game board...
[22:13:03] <To Northwind#2> TAC
[22:13:03] <From Northwind#2> TOE
[22:13:07] <From Northwind#2> TM0
[22:13:09] <From Northwind#2> TM1
[22:13:11] <From Northwind#2> TM2
[22:13:13] <From Northwind#2> TM5
[22:13:16] <From Northwind#2> TM4
[22:13:18] <From Northwind#2> TM3
[22:13:20] <From Northwind#2> TM6
[22:13:22] <From Northwind#2> TM7
[22:13:24] <From Northwind#2> TRG
[22:13:25] [TTT] Your opponent as reset the game. Type /tictactoe .reset to reset your game.
[22:14:09] [TTT] Resetting game board...
[22:14:09] <To Northwind#2> TRG


#4 User is offline   oblivious Icon

  • Full Member
  • PipPipPip
  • Group: Senior Members
  • Posts: 315
  • Joined: October-25 09

Posted January 04, 2010 - 09:35 AM

That's odd. That was never able to be done when I was testing it. You couldn't play by yourself either..

Anyway, it's fixed. You can't play by yourself any more too. You need two active scripts.

I might make it into a class when I make more games :P That would allow you to play by yourself, because two forms would be created.

Attached File  tictactoe.txt (7.6K)
Number of downloads: 481


I also added in a piece of code which tells you if your opponent tried to cheat (and ignores it).

This post has been edited by oblivious: January 04, 2010 - 09:37 AM


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users