Jump to content

prospeed


jpam
 Share

Recommended Posts

download prospeed udf @ first post

you are using an old version !

put the prospeed udf in autoit/include

or if you are using beta in autoit/beta/include

Edited by jpam
Link to comment
Share on other sites

  • Replies 511
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

I am using the updated version...

Spoiler

 

"If a vegetarian eats vegetables,What the heck does a humanitarian eat?"

"I hear voices in my head, but I ignore them and continue on killing."

"You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring."

An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist.

 

 
Link to comment
Share on other sites

@ draygoes

you should update autoit to !

the new AutoIt v3.2.10.0 has WM_PAINT allready declared

@ NewBe

the .au3 demos don't work properly any more, because i continue improve the udf

the .exe demos have the old udf included, so they run fine

try the last examples on this page

Link to comment
Share on other sites

#cs
Function MouseOverSprite
Syntax = $check = MouseOverSprite($bee1)
note;  Alias = use defined Spritename
example; $check = MouseOverSprite($bee1)
               If $check <> 0 the function()
Return string = sprite ID
#CE

#CS
Function MouseButton()
Syntax = $MouseClick = MouseButton()
note;  Return strings 
        0 = No mouseclick 
        1 = Left button
        2 = Right button
        4 = mid button
#CE

Link to comment
Share on other sites

Func _Shoot()
    $MouseOver = MouseOverSprite($Target)
        If $MouseOver <> 0 Then
        $MouseBut = MouseButton()
            If $MouseBut = 1 Then MsgBox(0 , "" , "test")
        EndIf
EndFunc
Thanks your really Great one tiny problem for some reason the background counts as the $Target?

I don't get it I think it is the MouseButton() that is causing this so somehow ill try and figure out a solution but if you can help me that would be great considering your method will beat mine I am sure.

Link to comment
Share on other sites

if you want to count how many times you click the sprite then this would mybe help

$count =0

Func _Shoot()
    $MouseOver = MouseOverSprite($Target)
        If $MouseOver <> 0 Then
            $MouseBut = MouseButton()
            If $MouseBut = 1 Then $count +=1
        EndIf
EndFunc

$count holds the value how many times you clicked the sprite

Edited by jpam
Link to comment
Share on other sites

if you want to count how many times you click the sprite then this would mybe help

$count =0

Func _Shoot()
    $MouseOver = MouseOverSprite($Target)
        If $MouseOver <> 0 Then
            $MouseBut = MouseButton()
            If $MouseBut = 1 Then $count +=1
        EndIf
EndFunc

$count holds the value how many times you clicked the sprite

Sorry you misunderstood.

I meant that when I click the Background() it thinks I clicked the Sprite() I think it has to do with the MouseButton() function I don't think it knows exactly what I "LEFT" clicked on and it needs a better understanding of what I am "LEFT" clicking on.

Thanks for putting up with me lol

Hopefully once this is figured out it will help many others

MouseOverSprite + MouseButton = SpriteClicked() :D

Anyways I hope you can understand me a bit better (Ive been up all night)

Thanks again for all the help and sorry for so many posts (Im going to delete a few)

Link to comment
Share on other sites

Opt("MouseCoordMode",2)

your MouseCoordMode is not set

you must set the coord mode relative to your window not the desktop

Thanks for trying but I am clicking the background in the GUI and the GUI is active by clicking the background it thinks its the sprite I really don't want to release code until it is done because it will ruin it.

I am not good with art but maybe this can help

heres my GUI/Box

=======================

----------@

>

=======================

- = blank space (forum is so fubar)

@ = My Sprite

> = Clicked Area

When I click in my GUI/Background it thinks I am clicking the Sprite

hope this helps I still have not managed to find out my problem but I think it has to do with this part right here

Func _Shoot()
    $MouseOver = MouseOverSprite($Target)
    If $MouseOver <> 1 Then
        $MouseBut = MouseButton() ; <==== I think this has to do with the problem since it is the only thing that is checking for a left click
        If $MouseBut = 1 Then _Damage()
    EndIf
EndFunc
Edited by NewBe
Link to comment
Share on other sites

is it on every location on the background or just left under the sprite ?

how big is the picture of the sprite and hoe big is the sprite in the picture ?

the mouseoversprite function react on the sprite picture even the transparant region

did you set Opt("MouseCoordMode",2)

if not, do it

Link to comment
Share on other sites

is it on every location on the background or just left under the sprite ?

how big is the picture of the sprite and hoe big is the sprite in the picture ?

the mouseoversprite function react on the sprite picture even the transparant region

did you set Opt("MouseCoordMode",2)

if not, do it

Sorry was out.

It happens everywere on the background.

Background 800x400

Sprite 54x52

hope that helps

Edited by NewBe
Link to comment
Share on other sites

internal sprite drawing example

no pictures needed !

#include <Prospeed.au3>
#include <String.au3>

Opt("GUIOnEventMode", 1)
Opt("PixelCoordMode", 2)
HotKeySet("{Esc}","_Exit")

$GUI = GUICreate("Internal Sprite Drawing",600, 400, -1, -1)
GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
GUISetState()
        
Background("" , 0, 0, 600, 400)
                                                
; <= Begin SpriteData 6 digit hex colordata (BGR) Bitmap Dimensions (Width 68 x Height 19)
$STR90 ="000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000060000060000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
$STR90&="000000000000000000000000000000000000000000000000000000000000000000000000000000ECECECECECEC00009C00009C0000E40000E4ECECECECECEC000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004800004800000060000060000060000060004800004800000000000000000000000000000000000000000000000000000000000000000000000000000000"
$STR90&="000000000000000000000000000000000000000000000000000000000000000000000000000000ECECECECECEC00009C00009C0000E40000E4ECECECECECEC000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004800004800000060000060000060000060004800004800000000000000000000000000000000000000000000000000000000000000000000000000000000"
$STR90&="000000000000000000000000000000000000000000000000000000000000000000000000000000008800008800000060000060000060000060008800008800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ECECECECECEC00009C00009C0000E40000E4ECECECECECEC000000000000000000000000000000000000000000000000000000000000000000000000000000"
$STR90&="000000000000000000000000000000000000000000000000000000000000000000000000000000008800008800000060000060000060000060008800008800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ECECECECECEC00009C00009C0000E40000E4ECECECECECEC000000000000000000000000000000000000000000000000000000000000000000000000000000"
$STR90&="00000000000000000000000000000000480000480000600000600000600000600000880000880000EC0000EC0000600000600000600000600000EC0000EC00008800008800006000006000006000006000004800004800000000000000000000000000000000000000000000000000004800004800006000006000006000006000006000006000006000006000008800008800004800004800004800004800008800008800006000006000006000006000006000006000006000006000004800004800000000000000000000"
$STR90&="00000000000000000000000000000000480000480000600000600000600000600000880000880000EC0000EC0000600000600000600000600000EC0000EC00008800008800006000006000006000006000004800004800000000000000000000000000000000000000000000000000004800004800006000006000006000006000006000006000006000006000008800008800004800004800004800004800008800008800006000006000006000006000006000006000006000006000004800004800000000000000000000"
$STR90&="00000000000000000000480000480000880000880000A80000A80000AC0000AC0000EC0000EC004060B04060B05CA8EC5CA8EC5088D05088D04060B04060B000EC0000EC0000AC0000AC0000A80000A80000880000880000480000480000000000000000000000000000480000480000880000880000880000880000880000880000880000880000AC0000AC0000EC0000EC005CA8EC5CA8EC4060B04060B000EC0000EC0000AC0000AC00008800008800008800008800008800008800008800008800004800004800000000"
$STR90&="00000000000000000000480000480000880000880000A80000A80000AC0000AC0000EC0000EC004060B04060B05CA8EC5CA8EC5088D05088D04060B04060B000EC0000EC0000AC0000AC0000A80000A80000880000880000480000480000000000000000000000000000480000480000880000880000880000880000880000880000880000880000AC0000AC0000EC0000EC005CA8EC5CA8EC4060B04060B000EC0000EC0000AC0000AC00008800008800008800008800008800008800008800008800004800004800000000"
$STR90&="00000000480000480000880000880000A80000A80000AC0000AC0000EC0000EC0000006000006000009C00009C0000E40000E40000E40000E400009C00009C00006000006000EC0000EC0000AC0000AC0000A80000A80000880000880000480000480000000000000000480000480000AC0000AC0000AC0000AC0000AC0000AC0000AC0000AC0000EC0000EC0000009C00009C0000E40000E40000E40000E400009C00009C00EC0000EC0000AC0000AC0000AC0000AC0000AC0000AC0000AC0000AC00004800004800000000"
$STR90&="00000000480000480000880000880000A80000A80000AC0000AC0000EC0000EC0000006000006000009C00009C0000E40000E40000E40000E400009C00009C00006000006000EC0000EC0000AC0000AC0000A80000A80000880000880000480000480000000000000000480000480000AC0000AC0000AC0000AC0000AC0000AC0000AC0000AC0000EC0000EC0000009C00009C0000E40000E40000E40000E400009C00009C00EC0000EC0000AC0000AC0000AC0000AC0000AC0000AC0000AC0000AC00004800004800000000"
$STR90&="00000000480000480000A80000A80000AC0000AC0000EC0000EC004060B04060B05088D05088D05CA8EC5CA8EC88CCFC88CCFCECECECECECEC5CA8EC5CA8EC5088D05088D04060B04060B000EC0000EC0000AC0000AC0000A80000A80000480000480000000000000000000000000000480000480000EC0000EC0000EC0000EC0000EC0000EC005088D05088D05CA8EC5CA8EC88CCFC88CCFCECECECECECEC5CA8EC5CA8EC5088D05088D000EC0000EC0000EC0000EC0000EC0000EC00004800004800000000000000000000"
$STR90&="00000000480000480000A80000A80000AC0000AC0000EC0000EC004060B04060B05088D05088D05CA8EC5CA8EC88CCFC88CCFCECECECECECEC5CA8EC5CA8EC5088D05088D04060B04060B000EC0000EC0000AC0000AC0000A80000A80000480000480000000000000000000000000000480000480000EC0000EC0000EC0000EC0000EC0000EC005088D05088D05CA8EC5CA8EC88CCFC88CCFCECECECECECEC5CA8EC5CA8EC5088D05088D000EC0000EC0000EC0000EC0000EC0000EC00004800004800000000000000000000"
$STR90&="00000000000000000000EC0000EC0000EC0000EC0000000000000000006000006000009C00009C0000E40000E40000E40000E40000E40000E40000E40000E400009C00009C00006000006000000000000000EC0000EC0000EC0000EC0000000000000000000000000000000000000000000000000000000000000000000000000000006000006000009C00009C0000E40000E40000E40000E40000E40000E40000E40000E400009C00009C000060000060000000000000000000000000000000000000000000000000000000"
$STR90&="00000000000000000000EC0000EC0000EC0000EC0000000000000000006000006000009C00009C0000E40000E40000E40000E40000E40000E40000E40000E400009C00009C00006000006000000000000000EC0000EC0000EC0000EC0000000000000000000000000000000000000000000000000000000000000000000000000000006000006000009C00009C0000E40000E40000E40000E40000E40000E40000E40000E400009C00009C000060000060000000000000000000000000000000000000000000000000000000"
$STR90&="0000000000000000000000000000000000000000000000000000004060B04060B05088D05088D05CA8EC5CA8EC88CCFC88CCFCECECECECECEC5CA8EC5CA8EC5088D05088D04060B04060B00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004060B04060B05088D05088D05CA8EC5CA8EC88CCFC88CCFCECECECECECEC5CA8EC5CA8EC5088D05088D04060B04060B0000000000000000000000000000000000000000000000000000000"
$STR90&="0000000000000000000000000000000000000000000000000000004060B04060B05088D05088D05CA8EC5CA8EC88CCFC88CCFCECECECECECEC5CA8EC5CA8EC5088D05088D04060B04060B00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004060B04060B05088D05088D05CA8EC5CA8EC88CCFC88CCFCECECECECECEC5CA8EC5CA8EC5088D05088D04060B04060B0000000000000000000000000000000000000000000000000000000"
$STR90&="00000000000000000000000000000000000000000000000000000000000000000000006000006000009C00009C0000E40000E40000E40000E400009C00009C00006000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000006000009C00009C0000E40000E40000E40000E400009C00009C000060000060000000000000000000000000000000000000000000000000000000000000000000"
$STR90&="00000000000000000000000000000000000000000000000000000000000000000000006000006000009C00009C0000E40000E40000E40000E400009C00009C00006000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000006000009C00009C0000E40000E40000E40000E400009C00009C000060000060000000000000000000000000000000000000000000000000000000000000000000"
; <= End SpriteData

; <= Begin SpriteData 6 digit hex colordata (BGR) Bitmap Dimensions (Width 64 x Height 18)
$STR16 ="B4B4B400000000000000000000000000000000000000EC0000EC0000880000880000009C00009C0000E40000E400009C00009C00880000880000EC0000EC00000000000000000000000000000000000000B4B4B4B4B4B400000000000000000000000000000000000000000000000000000000000000000000000000EC0000EC0000880000880000009C00009C0000E40000E400009C00009C00880000880000EC0000EC00000000000000000000000000000000000000000000000000000000"
$STR16&="B4B4B400000000000000000000000000000000000000EC0000EC0000880000880000009C00009C0000E40000E400009C00009C00880000880000EC0000EC00000000000000000000000000000000000000B4B4B4B4B4B400000000000000000000000000000000000000000000000000000000000000000000000000EC0000EC0000880000880000009C00009C0000E40000E400009C00009C00880000880000EC0000EC00000000000000000000000000000000000000000000000000000000"
$STR16&="7C7C7CB4B4B4B4B4B40000000000000000000000000088000088000000840000840000C00000C00000C00000C00000C00000C0000084000084008800008800000000000000000000000000B4B4B4B4B4B47C7C7C7C7C7C0000000000000000000000000000000000000000000000000000000000000000000000000088000088000000600000600000C00000C00000C00000C00000C00000C0000060000060008800008800000000000000000000000000000000000000000000000000000000"
$STR16&="7C7C7CB4B4B4B4B4B40000000000000000000000000088000088000000840000840000C00000C00000C00000C00000C00000C0000084000084008800008800000000000000000000000000B4B4B4B4B4B47C7C7C7C7C7C0000000000000000000000000000000000000000000000000000000000000000000000000088000088000000600000600000C00000C00000C00000C00000C00000C0000060000060008800008800000000000000000000000000000000000000000000000000000000"
$STR16&="6060607C7C7C7C7C7CB4B4B4B4B4B40000E40000E400009C00009C508CD4508CD45CA8EC5CA8EC88CCFC88CCFC5CA8EC5CA8EC508CD4508CD400009C00009C0000E40000E4B4B4B4B4B4B47C7C7C7C7C7C6060606060600000000000000000000000000000000000000000000000000000000000000000E40000E4000084000084508CD4508CD45CA8EC5CA8EC88CCFC88CCFC5CA8EC5CA8EC508CD4508CD400009C00009C000084000084000000000000000000000000000000000000000000"
$STR16&="6060607C7C7C7C7C7CB4B4B4B4B4B40000E40000E400009C00009C508CD4508CD45CA8EC5CA8EC88CCFC88CCFC5CA8EC5CA8EC508CD4508CD400009C00009C0000E40000E4B4B4B4B4B4B47C7C7C7C7C7C6060606060600000000000000000000000000000000000000000000000000000000000000000E40000E4000084000084508CD4508CD45CA8EC5CA8EC88CCFC88CCFC5CA8EC5CA8EC508CD4508CD400009C00009C000084000084000000000000000000000000000000000000000000"
$STR16&="4444446060606060607C7C7C7C7C7C00009C00009C5CA8EC5CA8EC000060000060ECECECECECEC000060000060ECECECECECEC0000600000605CA8EC5CA8EC00009C00009C7C7C7C7C7C7C6060606060604444444444440000000000000000000000007C7C7C7C7C7CB4B4B4B4B4B4B4B4B4B4B4B400009C00009C5CA8EC5CA8EC000060000060ECECECECECEC000060000060ECECECECECEC0000600000605CA8EC5CA8EC00009C00009CB4B4B4B4B4B4B4B4B4B4B4B47C7C7C7C7C7C000000"
$STR16&="4444446060606060607C7C7C7C7C7C00009C00009C5CA8EC5CA8EC000060000060ECECECECECEC000060000060ECECECECECEC0000600000605CA8EC5CA8EC00009C00009C7C7C7C7C7C7C6060606060604444444444440000000000000000000000007C7C7C7C7C7CB4B4B4B4B4B4B4B4B4B4B4B400009C00009C5CA8EC5CA8EC000060000060ECECECECECEC000060000060ECECECECECEC0000600000605CA8EC5CA8EC00009C00009CB4B4B4B4B4B4B4B4B4B4B4B47C7C7C7C7C7C000000"
$STR16&="00000044444444444460606060606000009C00009C000084000084508CD4508CD45CA8EC5CA8EC88CCFC88CCFC5CA8EC5CA8EC508CD4508CD400008400008400009C00009C60606060606044444444444400000000000000000000000000000000000000000000000044444444444444444444444400009C00009C5CA8EC5CA8EC0000600000600000600000600000600000600000600000600000600000605CA8EC5CA8EC00009C00009C444444444444444444444444000000000000000000"
$STR16&="00000044444444444460606060606000009C00009C000084000084508CD4508CD45CA8EC5CA8EC88CCFC88CCFC5CA8EC5CA8EC508CD4508CD400008400008400009C00009C60606060606044444444444400000000000000000000000000000000000000000000000044444444444444444444444400009C00009C5CA8EC5CA8EC0000600000600000600000600000600000600000600000600000600000605CA8EC5CA8EC00009C00009C444444444444444444444444000000000000000000"
$STR16&="00000000000000000000000000000000009C00009C0000E40000E40000C00000C00000C00000C00000C00000C00000C00000C00000C00000C00000E40000E400009C00009C00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009C00009C0000E40000E4508CD4508CD45CA8EC5CA8EC88CCFC88CCFC5CA8EC5CA8EC508CD4508CD40000E40000E400009C00009C000000000000000000000000000000000000000000"
$STR16&="00000000000000000000000000000000009C00009C0000E40000E40000C00000C00000C00000C00000C00000C00000C00000C00000C00000C00000E40000E400009C00009C00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009C00009C0000E40000E4508CD4508CD45CA8EC5CA8EC88CCFC88CCFC5CA8EC5CA8EC508CD4508CD40000E40000E400009C00009C000000000000000000000000000000000000000000"
$STR16&="00000000000000000000000000000000000000000000009C00009C0000E40000E40000FC0000FC0000FC0000FC0000FC0000FC0000E40000E400009C00009C0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005CA8EC5CA8EC00009C00009C0000E40000E40000FC0000FC0000FC0000FC0000FC0000FC0000E40000E400009C00009C5CA8EC5CA8EC000000000000000000000000000000000000000000"
$STR16&="00000000000000000000000000000000000000000000009C00009C0000E40000E40000FC0000FC0000FC0000FC0000FC0000FC0000E40000E400009C00009C0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005CA8EC5CA8EC00009C00009C0000E40000E40000FC0000FC0000FC0000FC0000FC0000FC0000E40000E400009C00009C5CA8EC5CA8EC000000000000000000000000000000000000000000"
$STR16&="0000000000000000005CA8EC5CA8EC5088D05088D000000000000000009C00009C0000E40000E40000FC0000FC0000E40000E400009C00009C0000000000005088D05088D05CA8EC5CA8EC0000000000000000000000000000000000000000000000000000000000000000000000005CA8EC5CA8EC0000000000005CA8EC5CA8EC00009C00009C0000E40000E40000FC0000FC0000E40000E400009C00009C5CA8EC5CA8EC0000000000005CA8EC5CA8EC000000000000000000000000000000"
$STR16&="0000000000000000005CA8EC5CA8EC5088D05088D000000000000000009C00009C0000E40000E40000FC0000FC0000E40000E400009C00009C0000000000005088D05088D05CA8EC5CA8EC0000000000000000000000000000000000000000000000000000000000000000000000005CA8EC5CA8EC0000000000005CA8EC5CA8EC00009C00009C0000E40000E40000FC0000FC0000E40000E400009C00009C5CA8EC5CA8EC0000000000005CA8EC5CA8EC000000000000000000000000000000"
$STR16&="0000005CA8EC5CA8EC0000000000005CA8EC5CA8EC0000000000000000000000000000000000000000000000000000000000000000000000000000000000005CA8EC5CA8EC0000000000005CA8EC5CA8EC000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
$STR16&="0000005CA8EC5CA8EC0000000000005CA8EC5CA8EC0000000000000000000000000000000000000000000000000000000000000000000000000000000000005CA8EC5CA8EC0000000000005CA8EC5CA8EC000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
; <= End SpriteData

$bitmap1 = DrawSprite(1, $STR90, 68, 19)
$bitmap2 = DrawSprite(2, $STR16, 64, 18)

$sprite1 = Sprite($bitmap1 ,0 ,0 ,34 ,19 ,2 ,1 ,8 ,350 ,100)
$sprite2 = Sprite($bitmap2 ,0 ,0 ,32 ,18 ,2 ,1 ,8 ,400 ,150)

SetSpriteMovingMode($sprite1, 1)
SetSpriteMovingMode($sprite2, 1)

While 1
    movesprite($sprite1, Random(0,600,1), Random(0,400,1))
    movesprite($sprite2, Random(0,600,1), Random(0,400,1))
    Sleep(1000)
WEnd

Func DrawSprite($SP_Num, $SP_String, $SP_Width, $SP_Height)
    Dim $SP_bitmap[10] ; <= dim for 10 sprites
    $SP_bitmap[$SP_Num] = CreateExtBmp($SP_Width, $SP_Height)
    $SP_o = 1
    $SP_copyY = 0
    For $SP_i = 1 To $SP_Height
        For $SP_w = 1 To $SP_Width
            $SP_var = "0x"&StringMid($SP_String, $SP_o, 6)  
            FillExtBmp($SP_bitmap[$SP_Num], $SP_w, $SP_w+1, $SP_copyY, $SP_copyY+1, $SP_var)
            $SP_o +=6
        Next
        $SP_copyY +=1   
    Next
    Return $SP_bitmap[$SP_Num]
EndFunc

Func _exit()
    Exit
EndFunc
Edited by jpam
Link to comment
Share on other sites

Bitmap to String ;

#include <Prospeed.au3>
Opt("GUIOnEventMode", 1)
Opt("PixelCoordMode", 2)

$GUI = GUICreate("Image To String", 600, 400, -1, -1)
$var = FileOpenDialog("", "C:\", "Images (*.jpg;*.bmp;*.png;*.gif)", 1 + 4)
If @error Then
    MsgBox(4096,"","No File(s) chosen")
    Exit
Else
    $var = StringReplace($var, "|", @CRLF)
EndIf
GUISetState()

Background("" , 0, 0, 600, 400)

BitmapToString($var, Random(1,99,1))

Func BitmapToString($SP_Raw_pic, $SP_Stringnum)
    $SP_Bitmap = LoadExtImage($SP_Raw_pic)
    $SP_Width  = GetBmpWidth($SP_Bitmap)
    $SP_Height = GetBmpHeight($SP_Bitmap)
    $SP_FILE   = FileOpen(@ScriptDir & "\tmp.au3", 2)
    FileWrite($SP_FILE,"; <= Begin SpriteData 6 digit hex colordata (BGR)"&" Bitmap Dimensions (Width "&$SP_Width&" x Height "&$SP_Height&")"&@CRLF)    
    CopyExtBmp($hdc, 0, 0, $SP_Width, $SP_Height, $SP_Bitmap, 0, 0, 0)
    $SP_copyY  = 0
    For $i = 1 To $SP_Height
        If $i = 1 Then FileWrite($SP_FILE,'$STR'&$SP_Stringnum&' ="')
        If $i > 1 Then FileWrite($SP_FILE,'$STR'&$SP_Stringnum&'&="')
        For $SP_w = 1 To $SP_Width
            $getpixel = PixelGetColor($SP_w, $SP_copyY)
            $getpixel = Hex($getpixel, 6)       
            $SP_split = StringSplit($getpixel, "")
            FileWrite($SP_FILE, $SP_split[5]&$SP_split[6]&$SP_split[3]&$SP_split[4]&$SP_split[1]&$SP_split[2])
        Next
        FileWrite($SP_FILE,'"'&@CRLF)
        $SP_copyY +=1   
    Next
    FileWrite($SP_FILE,"; <= End SpriteData")
    FileClose($SP_FILE)
    FreeExtBmp($SP_Bitmap)
    ShellExecute("tmp.au3", "", @ScriptDir, "") 
    Exit
EndFunc
Link to comment
Share on other sites

I get a error like: line 15 unterminetated string... how can i fix this?

internal sprite drawing example

no pictures needed !

#include <Prospeed.au3>
#include <String.au3>

Opt("GUIOnEventMode", 1)
Opt("PixelCoordMode", 2)
HotKeySet("{Esc}","_Exit")

$GUI = GUICreate("Internal Sprite Drawing",600, 400, -1, -1)
GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
GUISetState()
        
Background("" , 0, 0, 600, 400)
                                                
; <= Begin SpriteData 6 digit hex colordata (BGR) Bitmap Dimensions (Width 68 x Height 19)
$STR90 ="000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000060000060000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
$STR90&="000000000000000000000000000000000000000000000000000000000000000000000000000000ECECECECECEC00009C00009C0000E40000E4ECECECECECEC000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004800004800000060000060000060000060004800004800000000000000000000000000000000000000000000000000000000000000000000000000000000"
$STR90&="000000000000000000000000000000000000000000000000000000000000000000000000000000ECECECECECEC00009C00009C0000E40000E4ECECECECECEC000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004800004800000060000060000060000060004800004800000000000000000000000000000000000000000000000000000000000000000000000000000000"
$STR90&="000000000000000000000000000000000000000000000000000000000000000000000000000000008800008800000060000060000060000060008800008800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ECECECECECEC00009C00009C0000E40000E4ECECECECECEC000000000000000000000000000000000000000000000000000000000000000000000000000000"
$STR90&="000000000000000000000000000000000000000000000000000000000000000000000000000000008800008800000060000060000060000060008800008800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ECECECECECEC00009C00009C0000E40000E4ECECECECECEC000000000000000000000000000000000000000000000000000000000000000000000000000000"
$STR90&="00000000000000000000000000000000480000480000600000600000600000600000880000880000EC0000EC0000600000600000600000600000EC0000EC00008800008800006000006000006000006000004800004800000000000000000000000000000000000000000000000000004800004800006000006000006000006000006000006000006000006000008800008800004800004800004800004800008800008800006000006000006000006000006000006000006000006000004800004800000000000000000000"
$STR90&="00000000000000000000000000000000480000480000600000600000600000600000880000880000EC0000EC0000600000600000600000600000EC0000EC00008800008800006000006000006000006000004800004800000000000000000000000000000000000000000000000000004800004800006000006000006000006000006000006000006000006000008800008800004800004800004800004800008800008800006000006000006000006000006000006000006000006000004800004800000000000000000000"
$STR90&="00000000000000000000480000480000880000880000A80000A80000AC0000AC0000EC0000EC004060B04060B05CA8EC5CA8EC5088D05088D04060B04060B000EC0000EC0000AC0000AC0000A80000A80000880000880000480000480000000000000000000000000000480000480000880000880000880000880000880000880000880000880000AC0000AC0000EC0000EC005CA8EC5CA8EC4060B04060B000EC0000EC0000AC0000AC00008800008800008800008800008800008800008800008800004800004800000000"
$STR90&="00000000000000000000480000480000880000880000A80000A80000AC0000AC0000EC0000EC004060B04060B05CA8EC5CA8EC5088D05088D04060B04060B000EC0000EC0000AC0000AC0000A80000A80000880000880000480000480000000000000000000000000000480000480000880000880000880000880000880000880000880000880000AC0000AC0000EC0000EC005CA8EC5CA8EC4060B04060B000EC0000EC0000AC0000AC00008800008800008800008800008800008800008800008800004800004800000000"
$STR90&="00000000480000480000880000880000A80000A80000AC0000AC0000EC0000EC0000006000006000009C00009C0000E40000E40000E40000E400009C00009C00006000006000EC0000EC0000AC0000AC0000A80000A80000880000880000480000480000000000000000480000480000AC0000AC0000AC0000AC0000AC0000AC0000AC0000AC0000EC0000EC0000009C00009C0000E40000E40000E40000E400009C00009C00EC0000EC0000AC0000AC0000AC0000AC0000AC0000AC0000AC0000AC00004800004800000000"
$STR90&="00000000480000480000880000880000A80000A80000AC0000AC0000EC0000EC0000006000006000009C00009C0000E40000E40000E40000E400009C00009C00006000006000EC0000EC0000AC0000AC0000A80000A80000880000880000480000480000000000000000480000480000AC0000AC0000AC0000AC0000AC0000AC0000AC0000AC0000EC0000EC0000009C00009C0000E40000E40000E40000E400009C00009C00EC0000EC0000AC0000AC0000AC0000AC0000AC0000AC0000AC0000AC00004800004800000000"
$STR90&="00000000480000480000A80000A80000AC0000AC0000EC0000EC004060B04060B05088D05088D05CA8EC5CA8EC88CCFC88CCFCECECECECECEC5CA8EC5CA8EC5088D05088D04060B04060B000EC0000EC0000AC0000AC0000A80000A80000480000480000000000000000000000000000480000480000EC0000EC0000EC0000EC0000EC0000EC005088D05088D05CA8EC5CA8EC88CCFC88CCFCECECECECECEC5CA8EC5CA8EC5088D05088D000EC0000EC0000EC0000EC0000EC0000EC00004800004800000000000000000000"
$STR90&="00000000480000480000A80000A80000AC0000AC0000EC0000EC004060B04060B05088D05088D05CA8EC5CA8EC88CCFC88CCFCECECECECECEC5CA8EC5CA8EC5088D05088D04060B04060B000EC0000EC0000AC0000AC0000A80000A80000480000480000000000000000000000000000480000480000EC0000EC0000EC0000EC0000EC0000EC005088D05088D05CA8EC5CA8EC88CCFC88CCFCECECECECECEC5CA8EC5CA8EC5088D05088D000EC0000EC0000EC0000EC0000EC0000EC00004800004800000000000000000000"
$STR90&="00000000000000000000EC0000EC0000EC0000EC0000000000000000006000006000009C00009C0000E40000E40000E40000E40000E40000E40000E40000E400009C00009C00006000006000000000000000EC0000EC0000EC0000EC0000000000000000000000000000000000000000000000000000000000000000000000000000006000006000009C00009C0000E40000E40000E40000E40000E40000E40000E40000E400009C00009C000060000060000000000000000000000000000000000000000000000000000000"
$STR90&="00000000000000000000EC0000EC0000EC0000EC0000000000000000006000006000009C00009C0000E40000E40000E40000E40000E40000E40000E40000E400009C00009C00006000006000000000000000EC0000EC0000EC0000EC0000000000000000000000000000000000000000000000000000000000000000000000000000006000006000009C00009C0000E40000E40000E40000E40000E40000E40000E40000E400009C00009C000060000060000000000000000000000000000000000000000000000000000000"
$STR90&="0000000000000000000000000000000000000000000000000000004060B04060B05088D05088D05CA8EC5CA8EC88CCFC88CCFCECECECECECEC5CA8EC5CA8EC5088D05088D04060B04060B00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004060B04060B05088D05088D05CA8EC5CA8EC88CCFC88CCFCECECECECECEC5CA8EC5CA8EC5088D05088D04060B04060B0000000000000000000000000000000000000000000000000000000"
$STR90&="0000000000000000000000000000000000000000000000000000004060B04060B05088D05088D05CA8EC5CA8EC88CCFC88CCFCECECECECECEC5CA8EC5CA8EC5088D05088D04060B04060B00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004060B04060B05088D05088D05CA8EC5CA8EC88CCFC88CCFCECECECECECEC5CA8EC5CA8EC5088D05088D04060B04060B0000000000000000000000000000000000000000000000000000000"
$STR90&="00000000000000000000000000000000000000000000000000000000000000000000006000006000009C00009C0000E40000E40000E40000E400009C00009C00006000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000006000009C00009C0000E40000E40000E40000E400009C00009C000060000060000000000000000000000000000000000000000000000000000000000000000000"
$STR90&="00000000000000000000000000000000000000000000000000000000000000000000006000006000009C00009C0000E40000E40000E40000E400009C00009C00006000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000006000009C00009C0000E40000E40000E40000E400009C00009C000060000060000000000000000000000000000000000000000000000000000000000000000000"
; <= End SpriteData

; <= Begin SpriteData 6 digit hex colordata (BGR) Bitmap Dimensions (Width 64 x Height 18)
$STR16 ="B4B4B400000000000000000000000000000000000000EC0000EC0000880000880000009C00009C0000E40000E400009C00009C00880000880000EC0000EC00000000000000000000000000000000000000B4B4B4B4B4B400000000000000000000000000000000000000000000000000000000000000000000000000EC0000EC0000880000880000009C00009C0000E40000E400009C00009C00880000880000EC0000EC00000000000000000000000000000000000000000000000000000000"
$STR16&="B4B4B400000000000000000000000000000000000000EC0000EC0000880000880000009C00009C0000E40000E400009C00009C00880000880000EC0000EC00000000000000000000000000000000000000B4B4B4B4B4B400000000000000000000000000000000000000000000000000000000000000000000000000EC0000EC0000880000880000009C00009C0000E40000E400009C00009C00880000880000EC0000EC00000000000000000000000000000000000000000000000000000000"
$STR16&="7C7C7CB4B4B4B4B4B40000000000000000000000000088000088000000840000840000C00000C00000C00000C00000C00000C0000084000084008800008800000000000000000000000000B4B4B4B4B4B47C7C7C7C7C7C0000000000000000000000000000000000000000000000000000000000000000000000000088000088000000600000600000C00000C00000C00000C00000C00000C0000060000060008800008800000000000000000000000000000000000000000000000000000000"
$STR16&="7C7C7CB4B4B4B4B4B40000000000000000000000000088000088000000840000840000C00000C00000C00000C00000C00000C0000084000084008800008800000000000000000000000000B4B4B4B4B4B47C7C7C7C7C7C0000000000000000000000000000000000000000000000000000000000000000000000000088000088000000600000600000C00000C00000C00000C00000C00000C0000060000060008800008800000000000000000000000000000000000000000000000000000000"
$STR16&="6060607C7C7C7C7C7CB4B4B4B4B4B40000E40000E400009C00009C508CD4508CD45CA8EC5CA8EC88CCFC88CCFC5CA8EC5CA8EC508CD4508CD400009C00009C0000E40000E4B4B4B4B4B4B47C7C7C7C7C7C6060606060600000000000000000000000000000000000000000000000000000000000000000E40000E4000084000084508CD4508CD45CA8EC5CA8EC88CCFC88CCFC5CA8EC5CA8EC508CD4508CD400009C00009C000084000084000000000000000000000000000000000000000000"
$STR16&="6060607C7C7C7C7C7CB4B4B4B4B4B40000E40000E400009C00009C508CD4508CD45CA8EC5CA8EC88CCFC88CCFC5CA8EC5CA8EC508CD4508CD400009C00009C0000E40000E4B4B4B4B4B4B47C7C7C7C7C7C6060606060600000000000000000000000000000000000000000000000000000000000000000E40000E4000084000084508CD4508CD45CA8EC5CA8EC88CCFC88CCFC5CA8EC5CA8EC508CD4508CD400009C00009C000084000084000000000000000000000000000000000000000000"
$STR16&="4444446060606060607C7C7C7C7C7C00009C00009C5CA8EC5CA8EC000060000060ECECECECECEC000060000060ECECECECECEC0000600000605CA8EC5CA8EC00009C00009C7C7C7C7C7C7C6060606060604444444444440000000000000000000000007C7C7C7C7C7CB4B4B4B4B4B4B4B4B4B4B4B400009C00009C5CA8EC5CA8EC000060000060ECECECECECEC000060000060ECECECECECEC0000600000605CA8EC5CA8EC00009C00009CB4B4B4B4B4B4B4B4B4B4B4B47C7C7C7C7C7C000000"
$STR16&="4444446060606060607C7C7C7C7C7C00009C00009C5CA8EC5CA8EC000060000060ECECECECECEC000060000060ECECECECECEC0000600000605CA8EC5CA8EC00009C00009C7C7C7C7C7C7C6060606060604444444444440000000000000000000000007C7C7C7C7C7CB4B4B4B4B4B4B4B4B4B4B4B400009C00009C5CA8EC5CA8EC000060000060ECECECECECEC000060000060ECECECECECEC0000600000605CA8EC5CA8EC00009C00009CB4B4B4B4B4B4B4B4B4B4B4B47C7C7C7C7C7C000000"
$STR16&="00000044444444444460606060606000009C00009C000084000084508CD4508CD45CA8EC5CA8EC88CCFC88CCFC5CA8EC5CA8EC508CD4508CD400008400008400009C00009C60606060606044444444444400000000000000000000000000000000000000000000000044444444444444444444444400009C00009C5CA8EC5CA8EC0000600000600000600000600000600000600000600000600000600000605CA8EC5CA8EC00009C00009C444444444444444444444444000000000000000000"
$STR16&="00000044444444444460606060606000009C00009C000084000084508CD4508CD45CA8EC5CA8EC88CCFC88CCFC5CA8EC5CA8EC508CD4508CD400008400008400009C00009C60606060606044444444444400000000000000000000000000000000000000000000000044444444444444444444444400009C00009C5CA8EC5CA8EC0000600000600000600000600000600000600000600000600000600000605CA8EC5CA8EC00009C00009C444444444444444444444444000000000000000000"
$STR16&="00000000000000000000000000000000009C00009C0000E40000E40000C00000C00000C00000C00000C00000C00000C00000C00000C00000C00000E40000E400009C00009C00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009C00009C0000E40000E4508CD4508CD45CA8EC5CA8EC88CCFC88CCFC5CA8EC5CA8EC508CD4508CD40000E40000E400009C00009C000000000000000000000000000000000000000000"
$STR16&="00000000000000000000000000000000009C00009C0000E40000E40000C00000C00000C00000C00000C00000C00000C00000C00000C00000C00000E40000E400009C00009C00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009C00009C0000E40000E4508CD4508CD45CA8EC5CA8EC88CCFC88CCFC5CA8EC5CA8EC508CD4508CD40000E40000E400009C00009C000000000000000000000000000000000000000000"
$STR16&="00000000000000000000000000000000000000000000009C00009C0000E40000E40000FC0000FC0000FC0000FC0000FC0000FC0000E40000E400009C00009C0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005CA8EC5CA8EC00009C00009C0000E40000E40000FC0000FC0000FC0000FC0000FC0000FC0000E40000E400009C00009C5CA8EC5CA8EC000000000000000000000000000000000000000000"
$STR16&="00000000000000000000000000000000000000000000009C00009C0000E40000E40000FC0000FC0000FC0000FC0000FC0000FC0000E40000E400009C00009C0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005CA8EC5CA8EC00009C00009C0000E40000E40000FC0000FC0000FC0000FC0000FC0000FC0000E40000E400009C00009C5CA8EC5CA8EC000000000000000000000000000000000000000000"
$STR16&="0000000000000000005CA8EC5CA8EC5088D05088D000000000000000009C00009C0000E40000E40000FC0000FC0000E40000E400009C00009C0000000000005088D05088D05CA8EC5CA8EC0000000000000000000000000000000000000000000000000000000000000000000000005CA8EC5CA8EC0000000000005CA8EC5CA8EC00009C00009C0000E40000E40000FC0000FC0000E40000E400009C00009C5CA8EC5CA8EC0000000000005CA8EC5CA8EC000000000000000000000000000000"
$STR16&="0000000000000000005CA8EC5CA8EC5088D05088D000000000000000009C00009C0000E40000E40000FC0000FC0000E40000E400009C00009C0000000000005088D05088D05CA8EC5CA8EC0000000000000000000000000000000000000000000000000000000000000000000000005CA8EC5CA8EC0000000000005CA8EC5CA8EC00009C00009C0000E40000E40000FC0000FC0000E40000E400009C00009C5CA8EC5CA8EC0000000000005CA8EC5CA8EC000000000000000000000000000000"
$STR16&="0000005CA8EC5CA8EC0000000000005CA8EC5CA8EC0000000000000000000000000000000000000000000000000000000000000000000000000000000000005CA8EC5CA8EC0000000000005CA8EC5CA8EC000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
$STR16&="0000005CA8EC5CA8EC0000000000005CA8EC5CA8EC0000000000000000000000000000000000000000000000000000000000000000000000000000000000005CA8EC5CA8EC0000000000005CA8EC5CA8EC000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
; <= End SpriteData

$bitmap1 = DrawSprite(1, $STR90, 68, 19)
$bitmap2 = DrawSprite(2, $STR16, 64, 18)

$sprite1 = Sprite($bitmap1 ,0 ,0 ,34 ,19 ,2 ,1 ,8 ,350 ,100)
$sprite2 = Sprite($bitmap2 ,0 ,0 ,32 ,18 ,2 ,1 ,8 ,400 ,150)

SetSpriteMovingMode($sprite1, 1)
SetSpriteMovingMode($sprite2, 1)

While 1
    movesprite($sprite1, Random(0,600,1), Random(0,400,1))
    movesprite($sprite2, Random(0,600,1), Random(0,400,1))
    Sleep(1000)
WEnd

Func DrawSprite($SP_Num, $SP_String, $SP_Width, $SP_Height)
    Dim $SP_bitmap[10] ; <= dim for 10 sprites
    $SP_bitmap[$SP_Num] = CreateExtBmp($SP_Width, $SP_Height)
    $SP_o = 1
    $SP_copyY = 0
    For $SP_i = 1 To $SP_Height
        For $SP_w = 1 To $SP_Width
            $SP_var = "0x"&StringMid($SP_String, $SP_o, 6)  
            FillExtBmp($SP_bitmap[$SP_Num], $SP_w, $SP_w+1, $SP_copyY, $SP_copyY+1, $SP_var)
            $SP_o +=6
        Next
        $SP_copyY +=1   
    Next
    Return $SP_bitmap[$SP_Num]
EndFunc

Func _exit()
    Exit
EndFunc
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...