Sign in to follow this  
Followers 0
RazerM

Connect 4 Game

49 posts in this topic

#1 ·  Posted (edited)

I made a connect 4 game, it uses squares instead of circles. It uses rakudave's Table UDF which can be found at the bottom of this post

Here is the game

Update 1: Fixed Bug (Thanks XxXFaNTA)

Update 2: Added support for Draw

Update 3: uses PixelGetColour to determine back colour

Update 4: Fixed a bug when there is a draw. (Thanks to my friend)

Update 5: Added Undo Function

Update 6: Fixed Undo Bug (Thanks XxXFaNTA)

Update 7: Added online script(attached)

Update 8: (Online Version)

  • Added LAN and Internet functions (Thanks Simucal)
  • Added Marquee progress bar with big_daddy's _GUICtrlProgressMarqueeCreate() function
  • You can close the progress bar whilst waiting for opponent
  • Added user chat, works good.
Update 9: Chat box clears if local game is being played and send button is pressed

Update 10: Fixed - Edit scrolls on recieving chat message.

Update 11: (Online Version)

  • Converted script to OnEvent mode
  • Validates IP address on input
  • Fixed a bug when checking for four in a row
  • Added formatting to chat!(see notes below)
  • In Online mode the title says your username eg "Connect 4 - RazerM"
Update 12: (Online Version) - The formatting now uses regular expressions

Update 13: (Online Version) -

  • Added Marquee to formatting
  • Fixed bugs with colour and link formatting
Update 14: (Online Version) - Chat now auto scrolls to the bottom (Thanks DaleHohm)

Update 15: (Online Version) - Added gradient text to chat. See Formatting Notes

Update 16: (Online Version)

  • Added 5 second auto select on local mode
  • Fixed a bug with gradient text
Update 17: (Online Version) - small syntax error (Thanks AlmarM)

Formatting Notes

You can use the tags as follows:

[i]text[/i]
[b]text[/b]
[u]text[/u]
[s]text[/s]
[c=#FF0000]text[/c]
[c=red]text[/c]
[l=http://www.google.co.uk]text[/l] (lowercase L)
[m]text[/m]
[c=#FF0000]Gradient Red to Green[/c=#00FF00]

Those tags will produce the following output:

text

text

text

text

text

text

text (lowercase L)

<marquee w=100% h=30>text</marquee> (html is not supported in topics but that is what is generated)

Gradient Red to Green

Below the chat box are many buttons. Without any text highlighted they insert the appropriate tag
e.g. the button "Bold" will insert a [b] at the cursor but the button "/Bold" will insert a [/b] at the cursor position.
If text is highlighted and any of the bold buttons is pressed the text will be surrounded with tag
e.g. [b]text[/b]
For colors and links you will be prompted with an input box or color box accordingly

Or download it

table.au3

connect4.au3

connect4__online.au3

Previous Downloads: 305

Posted Image

Online MultiPlayer Help:

Obviously you'll need two computer's for this (or two on one machine)

Run exe 1 and click Online on the first dialog.

It will ask if you want to host, click 'yes'

Click LAN or Internet accordingly

The next messagebox will tell you your IP address, remember it

Click 'Ok'

Run exe 2 and click online

It will ask if you want to host, click 'no'

enter the IP address you remembered from exe 1

Enter the username for exe 2

Enter the username for exe 1

Both exe's will tell you the opponent's Username and IP

The game begins...

Edited by RazerM

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

Share this post


Link to post
Share on other sites



Nice Job.

// K :D

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

@FaNTA

I reproduced that game and the same happened to me. It is the way the CheckFour checks for four in a row. I will try and modify it.

Thanks for posting this bug.

Edit: The script has now been fixed. It checks for four consecutive colours instead of just four (meaning one opposing colour could be between them)

Edited by RazerM

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

Share this post


Link to post
Share on other sites

thanks,the game is really nice !


My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity

Share this post


Link to post
Share on other sites

nice with the simple checking that uve done on the tables should make it easy to do a suduko solver

Share this post


Link to post
Share on other sites

nice with the simple checking that uve done on the tables should make it easy to do a suduko solver

I think its time to add network support Razer.. so I can school you in Connect 4 online!


AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I think its time to add network support Razer

That's a good idea!! but I don't know how to go about it. :D

Edit: the [ autoit] tags remove the indentation :D That's annoying

Edited by RazerM

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

Share this post


Link to post
Share on other sites

nice with the simple checking that uve done on the tables should make it easy to do a suduko solver

Already been done.

http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]

Share this post


Link to post
Share on other sites

Already been done.

yes i know but

faster/more efficent i tryed one or 2 of them and they didnt work out to well even though i went on the site and got ones that work

Share this post


Link to post
Share on other sites

Is there anyone that wants to help me (try) add online play. I was thinking maybe TCP functions would help although I'm a noob when it comes to TCP stuff.

I would need lot's of help but I was thinking the host could start a game (with a unique number) and the other player enters that number into their connect 4, meaning only those two players Connect 4 would listen to the movements preceded by their game number.


My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

Share this post


Link to post
Share on other sites

Is there anyone that wants to help me (try) add online play. I was thinking maybe TCP functions would help although I'm a noob when it comes to TCP stuff.

I would need lot's of help but I was thinking the host could start a game (with a unique number) and the other player enters that number into their connect 4, meaning only those two players Connect 4 would listen to the movements preceded by their game number.

Yea, I'll go at it with you. I was thinking when the game would start it would ask for Local or Online game, if online game you would choose wether you are hosting the game or connecting to the remote game.

The host obviously would have to have the TCPSocket open and listening, then once it was the other use would connect to him. Then we would send player move coordinates in a string.


AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

Sounds good I'll get to work. the HelpFile examples are pretty good so i'll learn it.

I have added an undo Button to the script


My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

Share this post


Link to post
Share on other sites

I'm sorry to say that, but i found another bug using the undo-function:

Posted Image

if you press undo more than once, it moves the piece at the same spot but for diffrent players...:D

Share this post


Link to post
Share on other sites

Undo was intended to be only used once per try, I'll fix it.


My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

Share this post


Link to post
Share on other sites

I'm making great progress on the online feature. Simucal do you have MSN Messenger and what timezone are you in (Im GMT)


My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

What about adding a "restart" button (well for multiplayer the restart button should only work if both persons agree)

Edit: And somehow where the row is with the 4 things :D

Edit: And maybe instead "read players turn" >> GUICtrlSetData($turn,$red & "'s Turn") :D

Edited by XxXFaNtA

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

What about adding a "restart" button (well for multiplayer the restart button should only work if both persons agree)

I will but it's not at the top of my list right now

And somehow where the row is with the 4 things

I'm sorry i don't understand what you mean...

And maybe instead "read players turn" >> GUICtrlSetData($turn,$red & "'s Turn")

Because a name like douglas wouldn't work (I might change it but it's not a top priority)

Edit: Multiplayer works!! Ready Simucal?

Edited by RazerM

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

MSN = Simucal85 At hotmail DOT com

Send me a message and we'll give it a try.

EDIT: Email address to avoid spam bot capturing

Edited by JdeB

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0