Jump to content



Photo

Connect 4 Game


  • Please log in to reply
48 replies to this topic

#1 RazerM

RazerM

    cowinkeedenky - coincidence?

  • Active Members
  • PipPipPipPipPipPip
  • 1,246 posts

Posted 10 June 2006 - 08:54 AM

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
Attached File  table.au3   4.24K   958 downloads
Attached File  connect4.au3   8.91K   840 downloads
Attached File  connect4__online.au3   36.2K   508 downloads
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, 15 September 2007 - 07:04 PM.

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.





#2 krigaren

krigaren

    Seeker

  • Active Members
  • 6 posts

Posted 10 June 2006 - 11:33 AM

Nice Job.

// K :D

#3 XxXFaNtA

XxXFaNtA

    Adventurer

  • Active Members
  • PipPip
  • 128 posts

Posted 10 June 2006 - 12:44 PM

Nice...but i got a bug :D

Posted Image
/

Posted Image


#4 RazerM

RazerM

    cowinkeedenky - coincidence?

  • Active Members
  • PipPipPipPipPipPip
  • 1,246 posts

Posted 10 June 2006 - 01:57 PM

@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, 07 October 2006 - 10:35 AM.

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.

#5 Busti

Busti

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 337 posts

Posted 10 June 2006 - 02:40 PM

thanks,the game is really nice !
My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity

#6 Thatsgreat2345

Thatsgreat2345

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 2,640 posts

Posted 10 June 2006 - 02:57 PM

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

#7 Simucal

Simucal

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 777 posts

Posted 10 June 2006 - 03:42 PM

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)

#8 RazerM

RazerM

    cowinkeedenky - coincidence?

  • Active Members
  • PipPipPipPipPipPip
  • 1,246 posts

Posted 10 June 2006 - 03:56 PM

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, 10 June 2006 - 04:04 PM.

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.

#9 AutoItKing

AutoItKing

    Don't mess with the king.

  • Active Members
  • PipPipPipPipPipPip
  • 1,379 posts

Posted 10 June 2006 - 07:05 PM

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]

#10 Thatsgreat2345

Thatsgreat2345

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 2,640 posts

Posted 10 June 2006 - 08:02 PM

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

#11 RazerM

RazerM

    cowinkeedenky - coincidence?

  • Active Members
  • PipPipPipPipPipPip
  • 1,246 posts

Posted 10 June 2006 - 08:28 PM

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.

#12 Simucal

Simucal

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 777 posts

Posted 10 June 2006 - 09:11 PM

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)

#13 RazerM

RazerM

    cowinkeedenky - coincidence?

  • Active Members
  • PipPipPipPipPipPip
  • 1,246 posts

Posted 10 June 2006 - 09:59 PM

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.

#14 XxXFaNtA

XxXFaNtA

    Adventurer

  • Active Members
  • PipPip
  • 128 posts

Posted 10 June 2006 - 10:19 PM

I like your script. :D

Finally without bugs :D
/

Posted Image


#15 XxXFaNtA

XxXFaNtA

    Adventurer

  • Active Members
  • PipPip
  • 128 posts

Posted 11 June 2006 - 08:50 AM

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
/

Posted Image


#16 RazerM

RazerM

    cowinkeedenky - coincidence?

  • Active Members
  • PipPipPipPipPipPip
  • 1,246 posts

Posted 11 June 2006 - 12:40 PM

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.

#17 RazerM

RazerM

    cowinkeedenky - coincidence?

  • Active Members
  • PipPipPipPipPipPip
  • 1,246 posts

Posted 11 June 2006 - 02:46 PM

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.

#18 XxXFaNtA

XxXFaNtA

    Adventurer

  • Active Members
  • PipPip
  • 128 posts

Posted 11 June 2006 - 04:23 PM

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, 11 June 2006 - 04:27 PM.

/

Posted Image


#19 RazerM

RazerM

    cowinkeedenky - coincidence?

  • Active Members
  • PipPipPipPipPipPip
  • 1,246 posts

Posted 11 June 2006 - 04:50 PM

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, 11 June 2006 - 05:36 PM.

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.

#20 Simucal

Simucal

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 777 posts

Posted 11 June 2006 - 07:21 PM

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, 13 June 2006 - 10:13 PM.

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)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users