Jump to content
Sign in to follow this  
neo van matix

Totally stupid - Auto-Art-Creat0r for Paint :)

Recommended Posts

neo van matix

Hi Guys, i will try to explain you, why i wrote so stupid scripts *g*

Last tuesday, i was sitting at school... bored of the boring stuff our teacher tried to teach.

So, i had my laptop ahead, and after 10 minutes, my screensaver (with many light-clothed girls) pops up. I'm sitting near the teacher, so many guys behind my see, which are my favorite girls (naked, sometimes *g*)

So i wrote a script, that turns my mouse-cursor arround... then, i let it click to random positions in a square, thats ~120 px smaller than the Screenresolution.

My neighboor Kai said, "Hey dude... ehm... paint?". I looked like "wtf?".

Okay, this little script starts Paint and creates Lines (depends on the tool, that you selected), after each line, it changes the color. You can stop it with F2, and Pause/Resume it with F3 (if you like to choose another tool).

On Kai's pc that Hotkey-Function doesnt works, so he had to restart... i think, his logitech g15 is the problem. thousands of macro's... so i added a fuction, that stops the script for 8 seconds each half minute.

Try it, maybe you could give me some hints for better coding?

I'm sorry, the dialogs are german, but i think, you see what happens.

IMPORTANT If you start Paint for the First time, you must resize the... Workpaper? Artpaper? Dont know... It would be the best, if you resize it to the max. Size, that your resolution allows.

Sry 4 bad english :)

#cs
_______________________________________________________________________________

   Author   :     Bastian Müller
   Titel    :     Creative Art with Paint
   Descr.   :     Generates random Pics in Paint with autom. switching, different Colors
_______________________________________________________________________________

#ce 

#include <Array.au3>
Opt("MouseCoordMode", 1)

HotKeySet("{F2}", "CLOSE") 
HotkeySet("{F3}", "PAUSE")

const $BORDER  = 120                   ; Abstand nach innen vom Bildschirmrand aus legt das Quader fest, in dem gezeichnet wird
const $SPEED   = 1                     ; Geschwindigkeit, mit der die Linien & Co gezeichnet werden
global $PAUSE  = 0
$TITLE         = "Unbenannt - Paint"   ; Titel des Paint-Fensters (in engl. Versionen bspw. 'Untitled - Paint'
$start_time    = TimerInit()           ; Startet den Timer

msgbox(48, "INFO", "F2 zum beenden, F3 zuer Pause/Resume" & @CRLF & "Alle 30 Sekunden wird für 8 Sekunden das Script unterbrochen, damit es beendet werden kann, "&@CRLF&"sollten die Hotkey's nicht reagieren!")


IF NOT WinExists($TITLE, "") Then
   ShellExecute("mspaint.exe")
EndIf

msgbox(48, "Vorbereitung", "Wenn Sie dieses Script zum ersten mal aufrufen, vergrößeren Sie das Zeichenpapier durch Ziehen an den Ecken auf die komplette Bildschirmfläche. "&@CRLF&@CRLF& _
"Wenn Sie dies getan haben, klicken Sie auf OK!")

while(1)
   If NOT WinActive($TITLE, "") Then
      WinActivate($TITLE,"")
      WinSetState($TITLE, "", @SW_MAXIMIZE)
   EndIf
      WinWaitActive($TITLE,"")
   
   if $PAUSE = 0 Then
      if TimerDiff($start_time) > 30000 Then
         sleep(8000)
         $start_time = TimerInit()
      EndIf
      
      CLICK()
      FIND()
   EndIf
Wend

Func CLICK()
   $x1 = random($BORDER, @DesktopWidth-$BORDER)
   $y1 = random($BORDER, @DesktopHeight-$BORDER)
   $x2 = random($BORDER, @DesktopWidth-$BORDER)
   $y2 = random($BORDER, @DesktopHeight-$BORDER)
   
   MouseClickDrag("left", $x1, $y1,$x2, $y2, $SPEED)
EndFunc

Func FIND()
   $box_x   = @DesktopHeight-70
   $box_y   = @Desktopheight
   
   $colarr  = _arrayCreate(12, "0xC0C0C0", "0xFF0000", "0xFFFF00", "0x00FF00", "0x00FFFF", "0x0000FF", "0xFF00FF", "0x00FF80", "0x80FFFF", "0x0080FF", "0x00FF80", "0x804000")
   $rand    = random(1, $colarr[0])
   
   $color   = PixelSearch(0, $box_x, 270, $box_y, $colarr[$rand], 0, 2) 
   
   IF NOT @error Then
      MouseClick("left", $color[0], $color[1], 1, $SPEED)
   EndIf
EndFunc

Func PAUSE()
   if $PAUSE = 1 Then
      $PAUSE = 0
   Else
      $PAUSE = 1
   EndIf
EndFunc

Func CLOSE()
   Exit
EndFunc

generate_paintart.exe


Attention! English noob ^^

Share this post


Link to post
Share on other sites
Skrip

--EXE is safe--

That indeed is the source code for the file listed.

{Not tried the script. Might later}

Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites
jvanegmond

I can't get it to work. I haven't tried fixing it myself.

Share this post


Link to post
Share on other sites
Achilles

I can't get it to work. I haven't tried fixing it myself.

Seconded. I changed the "Unbenannt - Paint" to "Untitled - Paint" but still no luck...

EDIT: Found the problem:

#1: Change this code:

$x1 = random($BORDER, @DesktopWidth-$BORDER)
   $y1 = random($BORDER, @DesktopHeight-$BORDER)
   $x2 = random($BORDER, @DesktopWidth-$BORDER)
   $y2 = random($BORDER, @DesktopHeight-$BORDER)oÝ÷ ÚÚºÚ"µÍ ÌÍÞHH[ÛJ    ÌÍÐÔTÚÝÜÚYIÌÍÐÔTJB  ÌÍÞLHH[ÛJ   ÌÍÐÔTÚÝÜZYÚIÌÍÐÔTJB ÌÍÞH[ÛJ ÌÍÐÔTÚÝÜÚYIÌÍÐÔTJB  ÌÍÞLH[ÛJ    ÌÍÐÔTÚÝÜZYÚIÌÍÐÔTJ

#2: For people with English computers change Unbenannt - Paint" to "untitled - Paint"

Edited by Piano_Man

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites
neo van matix

Arg, sry - dont thought about the title-name in other languages :/


Attention! English noob ^^

Share this post


Link to post
Share on other sites
qwer85

Try:

ProcessExists("mspaint.exe")oÝ÷ Ú)ìµæjëh×6WinExists($TITLE, "")

P.S.: Doesn't work for me too :)

Edited by qwer85

Share this post


Link to post
Share on other sites
neo van matix

Arg damn, ..?!

I tried it on 3-4 german XP-Installations and it works... maybe you forgot to change the mspaint-title ?


Attention! English noob ^^

Share this post


Link to post
Share on other sites
jvanegmond

I couldn't stand the fact that it didn't work.

Here's a updated and working version, and translated to English.

Opt("MouseCoordMode", 1)
Opt("WinTitleMatchMode", 2) ;changed this

HotKeySet("{F2}", "CLOSE")
HotKeySet("{F3}", "PAUSE")

Const $BORDER = 120                   ; Abstand nach innen vom Bildschirmrand aus legt das Quader fest, in dem gezeichnet wird ; ??
Const $SPEED = 1                     ; Geschwindigkeit, mit der die Linien & Co gezeichnet werden ; ??
Global $PAUSE = 0 ; Change this to 1 to not have it pause every 30 seconds.
$TITLE = " - Paint"        ; Just leave this, unless the program is not called 'Paint'
$start_time = TimerInit()           ; Start the timer

Dim $colarr[13] = [12, "0xC0C0C0", "0xFF0000", "0xFFFF00", "0x00FF00", "0x00FFFF", "0x0000FF", "0xFF00FF", "0x00FF80", "0x80FFFF", "0x0080FF", "0x00FF80", "0x804000"]

;msgbox(48, "INFO", "F2 zum beenden, F3 zuer Pause/Resume" & @CRLF & "Alle 30 Sekunden wird für 8 Sekunden das Script unterbrochen, damit es beendet werden kann, "&@CRLF&"sollten die Hotkey's nicht reagieren!")
MsgBox(48, "INFO", "Press F2 to end the program. Press F3 to pause and resume the program. Every 30 seconds, the script is interupted for 8 seconds, so that you can exit the script should the hotkey's not respond.")


If Not WinExists($TITLE) Then
    ShellExecute("mspaint.exe")
EndIf

;msgbox(48, "Vorbereitung", "Wenn Sie dieses Script zum ersten mal aufrufen, vergrößeren Sie das Zeichenpapier durch Ziehen an den Ecken auf die komplette Bildschirmfläche. "&@CRLF&@CRLF& _
;"Wenn Sie dies getan haben, klicken Sie auf OK!")

MsgBox(48, "Preperation", "Make sure you maximize the white board that you are allowed to draw on in paint. When you have done this, press OK.")


If Not WinActive($TITLE, "") Then
    WinActivate($TITLE, "")
    WinSetState($TITLE, "", @SW_MAXIMIZE)
EndIf
WinWaitActive($TITLE, "")

While 1
    If $PAUSE = 0 Then
        If TimerDiff($start_time) > 30000 Then
            Sleep(8000)
            $start_time = TimerInit()
        EndIf
    EndIf
    CLICK()
    FIND()
WEnd

Func CLICK()
    $x1 = Random($BORDER, @DesktopWidth - $BORDER, 1)
    $y1 = Random($BORDER, @DesktopHeight - $BORDER, 1)
    $x2 = Random($BORDER, @DesktopWidth - $BORDER, 1)
    $y2 = Random($BORDER, @DesktopHeight - $BORDER, 1)

    MouseClickDrag("left", $x1, $y1, $x2, $y2, $SPEED)
EndFunc   ;==>CLICK

Func FIND()
    $box_x = @DesktopHeight - 70
    $box_y = @DesktopHeight

    $rand = Random(1, $colarr[0],1)

    $color = PixelSearch(0, $box_x, 270, $box_y, $colarr[$rand], 0, 1)

    If Not @error Then
        MouseClick("left", $color[0], $color[1], 1, $SPEED)
    EndIf
EndFunc   ;==>FIND

Func PAUSE()
    If $PAUSE = 1 Then
        $PAUSE = 0
    Else
        $PAUSE = 1
    EndIf
EndFunc   ;==>PAUSE

Func CLOSE()
    Exit
EndFunc   ;==>CLOSE
Edited by Manadar

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  

×