Paulie Posted June 10, 2007 Share Posted June 10, 2007 (edited) Just a little thing I made to impress a few onlookers. Figured I'd post it. CODE expandcollapse popup#include <GuiConstants.au3> $GUI = GUICreate("Fortune Cookie", 380, 300, -1, -1) GUISetBkColor(0xDDD9CE, $GUI) GUICtrlCreatePic(@ScriptDir&"\Fortune_Cookie.jpg",0,0,380,300) GuiCtrlSetState(-1,$GUI_DISABLE) $New = GUICtrlCreateButton("Get Fortune!", (380/2)-50, 250, 100, 25) $Fortune = GUICtrlCreateLabel("",70,125,240, 75) GUICtrlSetColor(-1, 0xFF0000) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetFont(-1, 10, 400, "", "Arial") GUISetState() While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit Case $New GUICtrlSetData($Fortune, _RandomFortune()&@CRLF&LuckyNum()) EndSwitch WEnd Func _RandomFortune() Do $Split = StringSplit(FileRead(@ScriptDir&"\Fortunes.txt"),"|"&@CRLF) $Num=Random(1, $Split[0],1) If $Split[$num] <> "" Then Return $Split[$Num] EndIf Until $Split[$num] <> "" EndFunc Func LuckyNum() Local $String = "Lucky Numbers: "&Random(01, 99,1) For $i = 1 to 5 $String &= ", "&Random(01, 99,1) Next Return $String EndFunc In the same directory, You will also need: Fortunes.txt: CODEThere is a true and sincere friendship between you and your friends.|You find beauty in ordinary things, do not lose this ability.|Ideas are like children; there are none so wonderful as your own.|It takes more than good memory to have good memories.|A thrilling time is in your immediate future.|Your blessing is no more than being safe and sound for the whole lifetime.|Plan for many pleasures ahead.|The joyfulness of a man prolongeth his days.|Your everlasting patience will be rewarded sooner or later.|Make two grins grow where there was only a grouch before.|Something you lost will soon turn up.|Your heart is pure, and your mind clear, and your soul devout.|Excitement and intrigue follow you closely wherever you go!|A pleasant surprise is in store for you.|May life throw you a pleasant curve.|As the purse is emptied the heart is filled.|Be mischievous and you will not be lonesome.|You have a deep appreciation of the arts and music.|Your flair for the creative takes an important place in your life.|Your artistic talents win the approval and applause of others.|Pray for what you want, but work for the things you need.|Your many hidden talents will become obvious to those around you.|Don't forget, you are always on our minds.|Your greatest fortune is the large number of friends you have.|A firm friendship will prove the foundation on your success in life.|Don't ask, don't say. Everything lies in silence.|Look for new outlets for your own creative abilities.|Be prepared to accept a wonderous opportunity in the days ahead!|Fame, riches and romance are yours for the asking.|Good luck is the result of good planning.|Good things are being said about you.|Smiling often can make you look and feel younger.|Someone is speaking well of you.|The time is right to make new friends.|You will inherit some money or a small piece of land.|Your life will be happy and peaceful.|A friend is a present you give yourself.|A member of your family will soon do something that will make you proud.|A quiet evening with fiends is the best tonic for a long day.|A single kind word will keep one warm for years.|Anger begins with folly, and ends with regret.|Generosity and perfection are your everlasting goals.|Happy news is on its way to you.|He who laughs at himself never runs out of things to laugh at.|If your desires are not extravagant they will be granted.|Let there be magic in your smile and firmness in your handshake.|If you want the rainbow, you must to put up with the rain.|Nature, time and patience are the three best physicians.|Strong and bitter words indicate a weak cause.|The beginning of wisdom is to desire it.|You will have a very pleasant experience.|You will inherit some money or a small piece of land.|You will live a long, happy life.|You will spend old age in comfort and material wealth.|You will step on the soil of many countries.|You will take a chance in something in the near future.|You will witness a special ceremony.|Your everlasting patience will be rewarded sooner or later.|Your great attention to detail is both a blessing and a curse.|Your heart is a place to draw true happiness.|Your ability to juggle many tasks will take you far.|A friend asks only for your time, not your money.|You will be invited to an exciting event.| And This Picture (Fortune Cookie.jpg) lol I dunno... Totally useless, but fun and kinda cute. Edited June 11, 2007 by Paulie Link to comment Share on other sites More sharing options...
theguy0000 Posted June 10, 2007 Share Posted June 10, 2007 hehe, I like it nice job The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
TehBeyond Posted June 10, 2007 Share Posted June 10, 2007 Pretty amusing, and pretty cool as well. Kudos. I would have told you I have Alzheimer's, but I forgot.My Splendid-Tastic Blog Link to comment Share on other sites More sharing options...
BrettF Posted June 10, 2007 Share Posted June 10, 2007 Nice Apparently I'm inheriting some money soon????? Hmmmmm....... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
RazerM Posted June 10, 2007 Share Posted June 10, 2007 Good idea. In your script change GUICtrlCreatePic(@ScriptDir&"\Fortune Cookie.jpg",0,0,380,300)oÝ÷ ÚÚºÚ"µÍÕRPÝÜX]TXÊØÜ[É][ÝÉÌLÑÜ[WÐÛÛÚÚYKÉ][ÝËÎÌ because that's what it is named when downloaded. 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. Link to comment Share on other sites More sharing options...
theguy0000 Posted June 10, 2007 Share Posted June 10, 2007 Good idea. In your script change GUICtrlCreatePic(@ScriptDir&"\Fortune Cookie.jpg",0,0,380,300)oÝ÷ ÚÚºÚ"µÍÕRPÝÜX]TXÊØÜ[É][ÝÉÌLÑÜ[WÐÛÛÚÚYKÉ][ÝËÎÌ because that's what it is named when downloaded.agreed, that confused me. and wtf is up with the quotes? I quoted your post, RazerM, and came up with this: http://images.theguy0000.com/quotes.PNG The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
Paulie Posted June 11, 2007 Author Share Posted June 11, 2007 Done Again i know its nothing spectacular, but its just another example of the "Random" function Link to comment Share on other sites More sharing options...
Eru Posted June 25, 2007 Share Posted June 25, 2007 Nice. Now I just have to change all the fortunes to say "...IN BED" at the end. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now