Jump to content
Sign in to follow this  
AJJ

Genius Idea For a Script

Recommended Posts

AJJ

My friend at university had a genius idea of a script from ages ago that i think we could make here. Basically you have a grid of pixels 500 by 500 big (or whatever, it doesnt matter) and each pixel is randomised to a colour and it is refreshed every second (or something). It creates an interesting philosophical portal, which in theory could potentially show every image of anything in the universe. (it might be better to do it in Black or white possibly). This sounds a bit nancy i know, but it would be a cool artistic idea. Is it difficult to do?

Share this post


Link to post
Share on other sites
SmOke_N

just sounds like it will create TV static >.<

Guess you've never seen poltergeist.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
torels

well it's not that complicated :D

make it using lables or better GDIPlus :o


Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
Share on other sites
myspacee

Monkey stop writing and start painting !

Your friend has very nice idea, make me smile !

I want someone realize it for community.

m.

Share this post


Link to post
Share on other sites
AJJ

Monkey stop writing and start painting !

yes! exactly, its just a million (well 500 by 500 would be 250000) monkeys in a computer changing dots (i imagine you could probably get one monkey to do at least 2 pixels, if not more)

just sounds like it will create TV static >.<

Yes, it would just make TV static, BUT it would have the POTENTIAL to create every single image in history, the future and anywhere in space and time. Literally, you could, if oyu waited long enough (and had infinite time (and patience) ) be able to see your future partners face, the face of your first born child, an alien race, the face of Jesus, anything!

If you were REALLY lucky, you would see video (but you would need 24 similiar frames a second in a row. probably quite unlikely!)

Im really rubbish at AUTOit still, i only really know how to Send("{space}") and thats about it, but im imagine all we would need to start off with is:

a code to create a 500 by 500 grid.

then a randomiser code between #000000 and #FFFFFF every - 1 or 2 seconds...

and thats it isnt it? - any takers?

Edited by AJJ

Share this post


Link to post
Share on other sites
AJJ

interestingly, on the wiki pedia article about monkeys and type writters it says there is a website:

A website entitled The Monkey Shakespeare Simulator, launched on July 1, 2003, contained a Java applet that simulates a large population of monkeys typing randomly, with the stated intention of seeing how long it takes the virtual monkeys to produce a complete Shakespearean play from beginning to end. For example, it produced this partial line from Henry IV, Part 2, reporting that it took "2,737,850 million billion billion billion monkey-years" to reach 24 matching characters:

RUMOUR. Open your ears; 9r"5j5&?OWTY Z0d...

Due to processing power limitations, the program uses a probabilistic model (by using a random number generator or RNG) instead of actually generating random text and comparing it to Shakespeare. When the simulator "detects a match" (that is, the RNG generates a certain value or a value within a certain range), the simulator simulates the match by generating matched text.[27]

In theory once we have created this program, there is just as much chance that the first image we see will be something just as much as nothing!

Share this post


Link to post
Share on other sites
myspacee

if you choose black & white image there are (500*500)^2 different images that can be generated (-> 62.500.000.000)

not speak about colour images....

but can be nice have a GDI random matrix;I prepare my LSD...

m.

Edited by myspacee

Share this post


Link to post
Share on other sites
Robin

it would have the POTENTIAL to create every single image in history, the future and anywhere in space and time. Literally, you could, if oyu waited long enough (and had infinite time (and patience) ) be able to see your future partners face, the face of your first born child, an alien race, the face of Jesus, anything!

If this could be true, it won't be worth it cause you'll only see the image for a split second...or should i say, as fast as the pixels move :D

Share this post


Link to post
Share on other sites
AJJ

yeah, this is true, but you could just make it last longer, so you would get a good look and had time to print screen! (maybe the code could export a print screen and save it as a small jpg...

or you could just sit there and watch it for the whole time - better use of time than world of Warcraft!

Share this post


Link to post
Share on other sites
Rishav

using probability, you will ALWAYS get static or unmeaningful dots all over,

you will have to allow for some selection.

something like if if any black pixel has another black pixel in the 3 pixel radius area, then make them adjacent, ensuring that the direction/orientation remains the same on moving the pixels.

this will give you patterns. from an artistic pov, studying patterns is much better than studying complete randomness.

my 2 cents.

Share this post


Link to post
Share on other sites
AJJ

yeah your right! although it would be nice to have both, but yeah,

can anyone actually give any code towards this?

Share this post


Link to post
Share on other sites
Robin

yeah your right! although it would be nice to have both, but yeah,

can anyone actually give any code towards this?

Easiest way is, "unplug" the antenna cable from a tv, grab a couple of beers, and start watching...

You never know what you might see after the 7th beer :D

Edited by Robin

Share this post


Link to post
Share on other sites
Rishav

actually you can't proceed till you decide on a pattern creation approach.

what i posted earlier is just one of many. some are quite complex. parsing signals from noise is a field in itself.

take your starting state as a uniform though random distribution of black and white dots. you want random patterns to emerge from them.

once you have decided on a simple enough approach, the write down the algorithm. the algorithm or the core method is always same no matter which programming language you use.

once you have the algorithm, its easy to place it in C++ or autoit.

sorry, not much help on the coding part. requires too much effort and time. something i am lacking at the moment. :D

Share this post


Link to post
Share on other sites
UEZ

Here the code for searching the universe for pictures :D Have fun while searching. If you find a picture make a screenshot and post it :o

;coded by UEZ 2009
#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>
#include <GuiButton.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

Global $hGUI, $hGraphic, $Bitmap, $GDI_Buffer, $brush
Global $i, $j, $k, $red, $green, $blue

Global Const $Pi = 3.1415926535897932384626
Global Const $width = @DesktopWidth / 5
Global Const $height = @DesktopHeight / 5

$hGUI = GUICreate("GDI+: Universe Picture Generator", $width, $height)
GUISetState(@SW_SHOW)


_GDIPlus_Startup ()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hGUI) ;create graphic
$Bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $hGraphic) ;create bitmap
$GDI_Buffer = _GDIPlus_ImageGetGraphicsContext($Bitmap) ;create buffer
$brush = _GDIPlus_BrushCreateSolid(0)
_GDIPlus_GraphicsClear($GDI_Buffer) ;clear buffer

$i = 0
Do
    For $j = 0 To $width -1
        $red = Random(1, 255, 1)
        $green = Random(1, 255, 1)
        $blue = Random(1, 255, 1)
        _GDIPlus_BrushSetSolidColor($brush, "0xFF" & Hex($red, 2) & Hex($green, 2) & Hex($blue, 2))
        _GDIPlus_GraphicsFillRect($GDI_Buffer, $j, $i, 1, 1, $brush)
    Next
    $i += 1
    If $i = $height Then $i = 0
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $Bitmap, 0, 0, $width, $height) ;copy to bitmap
    Sleep(1)
Until GUIGetMsg() = $GUI_EVENT_CLOSE

; Clean up resources
_GDIPlus_BrushDispose($brush)
_GDIPlus_GraphicsDispose($GDI_Buffer)
_GDIPlus_BitmapDispose($Bitmap)
_GDIPlus_GraphicsDispose ($hGraphic)
_GDIPlus_Shutdown ()

Func _GDIPlus_BrushSetSolidColor($hBrush, $iARGB = 0xFF000000)
    Local $aResult
    $aResult = DllCall($ghGDIPDll, "int", "GdipSetSolidFillColor", "hwnd", $hBrush, "int", $iARGB)
EndFunc   ;==>_GDIPlus_BrushSetSolidColor

Same with source codes. Every source code is in the universe, too - you just need to find it :D

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
AJJ

um ok thats AMAZING! dude,

did you just DO that? what? dude!

Share this post


Link to post
Share on other sites
AJJ

ive tried three so far and no photos yet!

im holding out hope though!

Share this post


Link to post
Share on other sites
Valuater

Then... Get the color

;coded by UEZ 2009
#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>
#include <GuiButton.au3>
#include <WindowsConstants.au3>

Opt("MouseCoordMode", 2) ;1=absolute, 0=relative, 2=client
Opt("PixelCoordMode", 2) ;1=absolute, 0=relative, 2=client

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "OnAutoitExit")

Global $hGUI, $hGraphic, $Bitmap, $GDI_Buffer, $brush
Global $i, $j, $k, $red, $green, $blue

Global Const $Pi = 3.1415926535897932384626
Global Const $width = @DesktopWidth / 5
Global Const $height = @DesktopHeight / 5

$hGUI = GUICreate("GDI+: Universe Picture Generator", $width, $height + 100)
$Edit1 = GUICtrlCreateEdit("", 0, $height, $width, 100)
GUISetState(@SW_SHOW)
WinSetOnTop($hGUI, "", 1)


_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;create graphic
$Bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $hGraphic) ;create bitmap
$GDI_Buffer = _GDIPlus_ImageGetGraphicsContext($Bitmap) ;create buffer
$brush = _GDIPlus_BrushCreateSolid(0)
_GDIPlus_GraphicsClear($GDI_Buffer) ;clear buffer

$i = 0
Do
    For $j = 0 To $width - 1
        $red = Random(1, 255, 1)
        $green = Random(1, 255, 1)
        $blue = Random(1, 255, 1)
        _GDIPlus_BrushSetSolidColor($brush, "0xFF" & Hex($red, 2) & Hex($green, 2) & Hex($blue, 2))
        _GDIPlus_GraphicsFillRect($GDI_Buffer, $j, $i, 1, 1, $brush)
    Next
    $i += 1
    If $i >= ($height - 1) Then ExitLoop ;$i = 0
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $Bitmap, 0, 0, $width, $height) ;copy to bitmap
    Sleep(1)
Until GUIGetMsg() = $GUI_EVENT_CLOSE

ToolTip("Hit (PAUSE) to Pause,   " & @CRLF & "Hit (ESC) to Exit  ", 10, 10, "GDI+: Universe Picture Reader", 1)
_ocr(0, 0, $width, $height)

While GUIGetMsg() <> -3
WEnd

Func _ocr($Ax, $Ay, $Dx, $Dy)

    $By = $Ay
    $nwidth = $Dx - $Ax
    $length = $Dy - $Ay

    Dim $char[$width][$length]

    For $xwidth = 0 To $nwidth - 1
        $Ax = $Ax + 1
        $Ay = $By
        For $xlength = 0 To $length - 1
            $char[$xwidth][$xlength] = Hex(PixelGetColor($Ax, $Ay), 6)
            GUICtrlSetData($Edit1, "Hex Color at " & $Ax & " and " & $Ay & " is " & $char[$xwidth][$xlength] & @CRLF, 1)
            MouseMove($Ax + 2, $Ay)
            ;GUICtrlSetBkColor( $color1, (PixelGetColor($Ax, $Ay)))
            Sleep(100)
            $Ay = $Ay + 1
        Next
    Next
    Return $char
EndFunc   ;==>_ocr

Func TogglePause()
    $Paused = Not $Paused
    While $Paused
        Sleep(100)
        ;ToolTip('Script is "Paused"',0,0)
    WEnd
    ;ToolTip("")
EndFunc   ;==>TogglePause

Func OnAutoItExit()
    ; Clean up resources
    _GDIPlus_BrushDispose($brush)
    _GDIPlus_GraphicsDispose($GDI_Buffer)
    _GDIPlus_BitmapDispose($Bitmap)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
    Exit 0
EndFunc   ;==>OnAutoitExit


Func _GDIPlus_BrushSetSolidColor($hBrush, $iARGB = 0xFF000000)
    Local $aResult
    $aResult = DllCall($ghGDIPDll, "int", "GdipSetSolidFillColor", "hwnd", $hBrush, "int", $iARGB)
EndFunc   ;==>_GDIPlus_BrushSetSolidColor

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Rishav

hah. this place is awesome.

do post some pics if you get anything interesting.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.