AutoHotkey Community

It is currently May 27th, 2012, 10:53 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 31 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: My Aquarium
PostPosted: November 22nd, 2004, 2:57 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
Not a utility. Not useful. Just something i did while getting bored.

A little box with a fish swimming here n there in random paths.
To try just put both of these files in script's folder and run.

http://drop.io/myfishy

Maybe someday someone will write a game in ahk... ;)


Code:
; Generated by SmartGUI Creator 3.2

Gui, color, 0xA2C6EC

Gui, Add, Picture, +BackgroundTrans AltSubmit x333 y166 w32 h32, %a_scriptdir%\fish.ico
Gui, Add, Picture, +BackgroundTrans AltSubmit x-50 y-50 w32 h32, %a_scriptdir%\fish2.ico

Gui, Show, x158 y110 h350 w450, Rajat's Aquarium
Goto, MoveFish

GuiClose:
ExitApp


MoveFish:
   CurrFish = Static1
   OtherFish = Static2
   
   Loop
   {
      Random, UpDn, 1, 2
      Random, DistUpDn, 5, 10

      Loop, %DistUpDn%
      {
         ControlGetPos, F1X, F1Y,,, %CurrFish%, Rajat's Aquarium

         IfEqual, UpDn, 1
            IfGreater, F1Y, 40
               F1Y -= 2

         IfEqual, UpDn, 2
            IfLess, F1Y, 340
               F1Y += 2

         IfEqual, GoRight, 1
            F1X += 2
         Else
            F1X -= 2

         ControlMove, %CurrFish%, %F1X%, %F1Y%,,, Rajat's Aquarium
         sleep, 30
         Gosub, CheckPos
      }
   }
Return


CheckPos:
   ControlGetPos, F1X, F1Y,,, %CurrFish%, Rajat's Aquarium
   WinGetPos, WinX, WinY, WinW, WinH, Rajat's Aquarium
   
   IfLess, F1X, 0
   {
      Control, Hide,, %CurrFish%, Rajat's Aquarium
      ControlMove, %OtherFish%, %F1X%, %F1Y%,,, Rajat's Aquarium
      Control, Show,, %OtherFish%, Rajat's Aquarium
      
      TempStor = %CurrFish%
      CurrFish = %OtherFish%
      OtherFish = %TempStor%
      GoRight = 1
   }
   
   IfGreater, F1X, %WinW%
   {
      Control, Hide,, %CurrFish%, Rajat's Aquarium
      ControlMove, %OtherFish%, %F1X%, %F1Y%,,, Rajat's Aquarium
      Control, Show,, %OtherFish%, Rajat's Aquarium
      
      TempStor = %CurrFish%
      CurrFish = %OtherFish%
      OtherFish = %TempStor%
      GoRight = 0
   }
Return

_________________
Image


Last edited by Rajat on January 27th, 2008, 7:54 pm, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 22nd, 2004, 4:02 pm 
As I'm still @ work, havn't tried it yet, so im ILIA (laughing in advance) :lol: :D

Hope you get boooooored more often :wink:
Thx.

8)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 22nd, 2004, 4:48 pm 
Offline

Joined: July 12th, 2004, 3:51 am
Posts: 51
Location: Fife,Wa
As always, Thanks, Rajat, but angelfire doesn't like your links-

"Angelfire does not allow direct linking
from offsite, non-Angelfire pages,
to files hosted on Angelfire.

This practice of 'remote linking' reduces
our ability to serve out the homepages
of our members quickly and efficiently. "

Anxiously awaiting a new d\l site.
Don


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 22nd, 2004, 6:26 pm 
I've done Link/RightClick/SaveTargetAs and downloaded it. Perfect :!:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 22nd, 2004, 6:48 pm 
The fish is there (same dir) but won't make it into the aquarium :shock:

AHK 1.0.23 (downloaded/installed a min ago)
W2K SP4

Maybe there's a shark around as well :lol:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 22nd, 2004, 6:59 pm 
Is there an issue with value? --> Static1/2 :cry:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 22nd, 2004, 7:17 pm 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
Quote:
My Home Page

My Favorite things about Angelfire.

* Easy
* Fast
* Fun

My Favorite Web Sites

Angelfire - Free Home Pages
Free Web Building Help
Angelfire HTML Library
HTML Gear - free polls, guestbooks, and more!

Thank you for visiting my page at Angelfire. Please come back and visit again!


Rajat, please say you didn't write this home page. :-D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 22nd, 2004, 7:40 pm 
@ Jonny. You know that I know - it's a template (please Rajat confirm, please, please ... :lol: )


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 22nd, 2004, 11:18 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
Can't save icons, but looking from code it looks cool 8)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 22nd, 2004, 11:33 pm 
Offline

Joined: April 28th, 2004, 1:12 pm
Posts: 349
unofficial mirrors-
http://hometown.aol.co.uk/JRMC137/fish2.ico
http://hometown.aol.co.uk/JRMC137/fish.ico


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2004, 12:52 am 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
Jon wrote:


Lol, those are not pictures, they're code :?:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2004, 11:21 am 
Titan wrote:
Jon wrote:


Lol, those are not pictures, they're code :?:


They are definetely pictures but it looks like you've got to select "all files" and change the extension to ico when you download them.

Here is a zipped version instead-
http://hometown.aol.co.uk/JRMC137/fish.zip


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2004, 12:35 pm 
Offline

Joined: July 22nd, 2004, 6:33 am
Posts: 193
Location: cedar city UT
haha thats kool Rajat thanx 8) 8)

_________________
^sleepy^


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2004, 1:48 pm 
Quote:
Lol, those are not pictures, they're code


I've compiled it - and guess what I've got :!: shark.ico :!: aka it's malicious fish code !

:lol:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2004, 7:19 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
thanx Jon for giving alternate location for files, i've updated the main post to show them.

and no ... i didn't do the homepage... i just didn't change it.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 31 posts ]  Go to page 1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 5 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group