Sign in to follow this  
Followers 0
alienkillaz

photogen program

2 posts in this topic

run the program and then drag 1 of the 3 black and white pictures i have included in the .zip (any true black and white pic's will work (must be dec:0 for black!)) it will open the pic in mspaint and then just sit there for 10-30 seconds DONT STOP IT WHILE IT IS IN MSPAINT OR IT WONT WORK !! when the script is done it will minimize mspaint. then you need to open a .txt and just press the {puase} button in your keyboard. it will paste the image in the form of text.

plz test this

#include <GUIConstants.au3>

Global $Paused

HotKeySet("{PAUSE}", "TogglePause")

$select = IniRead("gen.ini", "gen", "select", "")

$outer = IniRead("gen.ini", "gen", "outer", "")

$inner = IniRead("gen.ini", "gen", "inner", "")

GUICreate(" Drawbot ver. 1.0 ", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, "", 0x00000018)

$file = GUICtrlCreateInput("drag the pic here", 7, 5, 300, 20);,"",$WS_EX_ACCEPTFILES)

GUICtrlSetState(-1, $GUI_ACCEPTFILES)

$btn = GUICtrlCreateButton("OK", 110, 58, 90, "", $BS_DEFPUSHBUTTON)

$outercon=GUICtrlCreateInput($outer,7,35)

$innercon=GUICtrlCreateInput($inner,7,57)

$btn1 = GUICtrlCreateButton("cancel", 210, 58, 90, "")

$opt1 = GUICtrlCreateRadio("copy/paste mode",108,33)

$opt2 = GUICtrlCreateRadio("type mode",210,33)

if $select = 1 Then

GUICtrlSetState($opt1,$GUI_CHECKED)

ElseIf $select = 2 Then

GUICtrlSetState($opt2,$GUI_CHECKED)

EndIf

GUISetState(@SW_SHOW) ; will display an empty dialog box

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

if $msg = $opt1 Then

iniwrite("gen.ini", "gen", "select", "1")

ElseIf $msg = $opt2 Then

iniwrite("gen.ini", "gen", "select", "2")

EndIf

if $msg = $btn1 Then

Exit

EndIf

If $msg = $btn Then

$inner=GUICtrlRead($innercon)

IniWrite("gen.ini", "gen", "inner", $inner)

$outer=GUICtrlRead($outercon)

Iniwrite("gen.ini", "gen", "outer", $outer)

$file1 = GUICtrlRead($file)

GUISetState(@SW_HIDE)

IniWrite("gen.ini", "gen", "coord1", "")

IniWrite("gen.ini", "gen", "coord2", "")

paint()

$coord3 = @DesktopWidth

$coord3 = $coord3 / 2

$coord1 = IniRead("gen.ini", "gen", "coord1", "")

$coord1 = $coord1 / 2

$coord3 = $coord3 - $coord1 ; left

$coord4 = @DesktopHeight

$coord4 = $coord4 / 2

$coord2 = IniRead("gen.ini", "gen", "coord2", "") / 2

$coord4 = $coord4 - $coord2 ; top

$coord5 = $coord3 + $coord1 + $coord1 ; right

$coord6 = $coord4 + $coord2 + $coord2 ; bottom

;MsgBox(1,"",$coord4 & "," & $coord6 &"," &$coord5 &"," & $coord3)

;MsgBox(1,"",$coord3 &","& $coord4)

ExitLoop

;EndIf

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

EndIf

WEnd

;Sleep(4000)

$height = IniRead("gen.ini", "gen", "coord2", "")

$width = IniRead("gen.ini", "gen", "coord1", "")

;$outer = "@"

;$inner = "."

;

$a = 1

Do

IniWrite("gen.ini", "gen", "line" & $a, "")

$a = $a + 1

Until $a = 50

$height = $height / 17

$height = Round($height, 0)

$width = $width / 7

$width = Round($width, 0)

$left = $coord3

$top = $coord4

$right = $coord5

$bottom = $coord6

$line = 0

$counter = 0

;MsgBox(1,"",$left &","& $top)

Do

$x = PixelGetColor($left, $top)

$left = $left + 7

If $left > $right Then

$left = $coord3

$top = $top + 17

$counter = $counter + 1

EndIf

If $x = 0 Then

$line = $outer

ElseIf $x <> 0 Then

$line = $inner

EndIf

$read = IniRead("gen.ini", "gen", "line" & $counter, "")

ClipPut($line)

IniWrite("gen.ini", "gen", "line" & $counter, $read & $line)

Until $counter > $height

$read1 = IniRead("gen.ini", "gen", "line1", "")

$read2 = IniRead("gen.ini", "gen", "line2", "")

$read3 = IniRead("gen.ini", "gen", "line3", "")

$read4 = IniRead("gen.ini", "gen", "line4", "")

$read5 = IniRead("gen.ini", "gen", "line5", "")

$read6 = IniRead("gen.ini", "gen", "line6", "")

$read7 = IniRead("gen.ini", "gen", "line7", "")

$read8 = IniRead("gen.ini", "gen", "line8", "")

$read9 = IniRead("gen.ini", "gen", "line9", "")

$read10 = IniRead("gen.ini", "gen", "line10", "")

$read11 = IniRead("gen.ini", "gen", "line11", "")

$read12 = IniRead("gen.ini", "gen", "line12", "")

$read13 = IniRead("gen.ini", "gen", "line13", "")

$read14 = IniRead("gen.ini", "gen", "line14", "")

$read15 = IniRead("gen.ini", "gen", "line15", "")

$read16 = IniRead("gen.ini", "gen", "line16", "")

$read17 = IniRead("gen.ini", "gen", "line17", "")

$read18 = IniRead("gen.ini", "gen", "line18", "")

$read19 = IniRead("gen.ini", "gen", "line19", "")

$read20 = IniRead("gen.ini", "gen", "line20", "")

$read21 = IniRead("gen.ini", "gen", "line21", "")

$read22 = IniRead("gen.ini", "gen", "line22", "")

$read23 = IniRead("gen.ini", "gen", "line23", "")

$read24 = IniRead("gen.ini", "gen", "line24", "")

$read25 = IniRead("gen.ini", "gen", "line25", "")

$read26 = IniRead("gen.ini", "gen", "line26", "")

$read27 = IniRead("gen.ini", "gen", "line27", "")

$read28 = IniRead("gen.ini", "gen", "line28", "")

$read29 = IniRead("gen.ini", "gen", "line29", "")

$read30 = IniRead("gen.ini", "gen", "line30", "")

$read31 = IniRead("gen.ini", "gen", "line31", "")

$read32 = IniRead("gen.ini", "gen", "line32", "")

$read33 = IniRead("gen.ini", "gen", "line33", "")

$read34 = IniRead("gen.ini", "gen", "line34", "")

$read35 = IniRead("gen.ini", "gen", "line35", "")

$read36 = IniRead("gen.ini", "gen", "line36", "")

$read37 = IniRead("gen.ini", "gen", "line37", "")

$read38 = IniRead("gen.ini", "gen", "line38", "")

$read39 = IniRead("gen.ini", "gen", "line39", "")

$read40 = IniRead("gen.ini", "gen", "line40", "")

$read41 = IniRead("gen.ini", "gen", "line41", "")

$read42 = IniRead("gen.ini", "gen", "line42", "")

$read43 = IniRead("gen.ini", "gen", "line43", "")

$read44 = IniRead("gen.ini", "gen", "line44", "")

MouseClick("left"); to exit paint

if iniread("gen.ini", "gen", "select", "") = 1 Then

ClipPut($read1 & @CRLF & $read2 & @CRLF & $read3 & @CRLF & $read4 & @CRLF & $read5 & @CRLF & $read6 & @CRLF & $read7 & @CRLF & $read8 & @CRLF & $read9 & @CRLF & $read10 & @CRLF & $read11 & @CRLF & $read12 & @CRLF & $read13 & @CRLF & $read14 & @CRLF & $read15 & @CRLF & $read16 & @CRLF & $read17 & @CRLF & $read18 & @CRLF & $read19 & @CRLF & $read20 & @CRLF & $read21 & @CRLF & $read22 & @CRLF & $read23 & @CRLF & $read24 & @CRLF & $read25 & @CRLF & $read26 & @CRLF & $read27 & @CRLF & $read28 & @CRLF & $read29 & @CRLF & $read30 & @CRLF & $read31 & @CRLF & $read32 & @CRLF & $read33 & @CRLF & $read34 & @CRLF & $read35 & @CRLF & $read36 & @CRLF & $read37 & @CRLF & $read38 & @CRLF & $read39 & @CRLF & $read40 & @CRLF & $read41 & @CRLF & $read42 & @CRLF & $read43 & @CRLF & $read44 & @CRLF)

elseIf iniread("gen.ini", "gen", "select", "") = 2 Then

send("{pause}")

EndIf

while 1

typer()

WEnd

func typer()

$counter = 1

Do

$read = IniRead("gen.ini", "gen", "line" & $counter, "")

clipput($read)

;MsgBox("",$read,"")

sleep(0)

send("{enter}")

sleep(0)

Send("{ctrlDOWN}")

sleep(0)

send("v")

sleep(0)

Send("{ctrlup}")

sleep(0)

;send("{enter}")

sleep(0)

$counter = $counter + 1

until $counter > $height

send("{pause}")

EndFunc

while 1

WEnd

;////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

Func paint()

Run("mspaint.exe")

WinWaitActive("untitled - Paint")

;sleep(1000)

Send("{ctrlDOWN}" & "o" & "{ctrlup}")

Sleep(1000)

Send($file1 & "{enter}")

Sleep(100)

Send("{ALTDOWN}" & "i" & "{altup}" & "a")

;ClipPut("")

;sleep(100)

Send("{ctrldown}" & "c" & "{ctrlup}")

$coord1 = ClipGet()

IniWrite("gen.ini", "gen", "coord1", $coord1)

Send("{tab}")

Send("{ctrldown}" & "c" & "{ctrlup}")

$coord2 = ClipGet()

IniWrite("gen.ini", "gen", "coord2", $coord2)

Send("{enter}")

Send("{ctrldown}" & "f" & "{ctrlup}")

;Send("{ALTDOWN}")

; send("f")

; send("{altup}" & "{up}")

; sleep(100)

; send("{enter}")

EndFunc ;==>paint

;////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

Func TogglePause()

$Paused = Not $Paused

While $Paused

Sleep(100)

ToolTip('Script is "Paused"', 0, 0)

WEnd

ToolTip("")

EndFunc ;==>TogglePause

gen.zip

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

WinWaitActive("untitled - Paint")
doesnt work on my dutch OS.

Send("{tab}")
Send("{ctrldown}" & "c" & "{ctrlup}")
can be simplyfied to
Send("{tab}^c")

sleep(0)
send("{enter}")
sleep(0)
Send("{ctrlDOWN}")
sleep(0)
send("v")
sleep(0)
Send("{ctrlup}")
sleep(0)
;send("{enter}")
sleep(0)
can be simplyfied to
send("{enter}^v")

so on.

and put a tinly sleep(100) or so between your while 1 loops to avoid eating cpu.

Edited by w0uter

My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

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  
Followers 0