Jump to content
Sign in to follow this  
jpam

prospeed

Recommended Posts

try this;

#include <GUIConstants.au3>
#include <Prospeed.au3>

HotKeySet("{Esc}","_exit")
Opt("GUIOnEventMode", 1)

$gui = GUICreate("ProSpeed",800,600,-1,-1,$WS_POPUP)

$X = 0
$Y = 0
$Deg = 180

InetGet ( "http://www.autoitscript.com/autoit3/files/graphics/autoit_builder_wall_800x600.jpg" ,"C:autoit_builder_wall.jpg" )
$Pic = "C:\autoit_builder_wall.jpg"

grey($Pic, $X ,$Y)
sleep(3000)
Rotate($Pic, $X, $Y, $Deg)

While 1
     Sleep(1000)
WEnd

Func _exit()
     exit
EndFunc
Edited by jpam

Share this post


Link to post
Share on other sites

Hello!

Oh! the udf must be great, but it doesnt work by me :P Autoit break.. "autoit.exe has encountered a problem and needs to close" .. I've testet your last post, jpam but it doesnt work again.. knew smb whats the problem?

Mfg Spider

edit: he (autoit^^) breaks e.g by blur here: $S_PIC = DllCall($S_DLL,"long","LoadExtImage","str",$s_File,"long",$hDC)..

Edited by GtaSpider

www.AutoIt.de - Moderator of the German AutoIt Froum

Share this post


Link to post
Share on other sites

i think it has to do with the last autoit beta

i am using autoit-v3.2.1.3-beta

the last beta i get the same error !

i look in to it

Share this post


Link to post
Share on other sites

sorry i was wrong :P

i am using autoit-v3.2.1.2-beta

beta's after v3.2.1.2 crashed when using prospeed

don't no why

iam reading autoit history now

Edited by jpam

Share this post


Link to post
Share on other sites

This is frickin' Awsome! I can't wait for you to release to UDF's (Works with all AutoIt vers). This will make games MUCH easier to make. Hopefully you will have some image read/write functions?

Hallman

Edited by Hallman

Share this post


Link to post
Share on other sites

So I discovered that the Prospeed was not in my System32 folder, instead there was prospeed_bmp2jpg.dll, where did that come from??

Anyway I put the Prospeed.Dll back there, and no script errors now, but Exit code: -1073741819 Time: 4.443 (from Scite Editor)

I guess thats what you mean when you say the script crashes...


2015 - Still no flying cars, instead blankets with sleeves.

Share this post


Link to post
Share on other sites

I found the crash problem. The calls to LoadExtImage are wrong. That function only expects one argument, the file name. It is being called with 2 arguments. This is leading to stack corruption which causes AutoIt to crash. If the code worked in a previous version of AutoIt, it was pure fluke. In the next release of AutoIt, stack corruption like this will be detected and an error thrown showing where AutoIt thinks the problem is (As opposed to a hard crash).

Share this post


Link to post
Share on other sites

I found the crash problem. The calls to LoadExtImage are wrong. That function only expects one argument, the file name. It is being called with 2 arguments. This is leading to stack corruption which causes AutoIt to crash. If the code worked in a previous version of AutoIt, it was pure fluke. In the next release of AutoIt, stack corruption like this will be detected and an error thrown showing where AutoIt thinks the problem is (As opposed to a hard crash).

Interesting. Would be useful any error info about these cases from AutoIt.

[off topic]What tool/method do you use to look how many args. it has some DLL?[/off topic]

Share this post


Link to post
Share on other sites

Thanks Valik for looking at the crash

The function needs indeed 1 argument

butt a combined argument !

The funktion needs the adress of a string.

to put not the string itself, but the adress of the string in memory.

how do i do that in AutoIt ???

Best Recards

jpam

Share this post


Link to post
Share on other sites

Sprites example crashes out again... Exit code: -1073741819 Time: 0.518 :P

Same problem here. Big nasty crashola. Also, I'd recommend adjusting the example code thus:

#include <GUIConstants.au3>
#include <Prospeed.au3>

Opt("GUIOnEventMode", 1)
HotKeySet("{Esc}","_exit")

$gui = GUICreate("Prospeed",800,400,-1,-1,$WS_POPUP)
GUISetState()

;Background(FILE, POSX, POSY) ;loads Background
Background(@ScriptDir & "\Hintergrund.jpg", 0, 0)

;Sprite("Sprite picture", WIDTH, HEIGHT, FRAMES, START_FRAME, FRAME_SPEED, posX, posY) ;loads sprites
sprite(@ScriptDir & "\Sprites.gif", 24, 18, 4, 1, 6, -30, 50)
sprite(@ScriptDir & "\Sprites.gif", 24, 18, 4, 1, 6, -30, 80)
sprite(@ScriptDir & "\Sprites2.gif", 24, 18, 4, 1, 6, -30, 130)
sprite(@ScriptDir & "\Sprites2.gif", 24, 18, 4, 1, 6, -30, 160)
sprite(@ScriptDir & "\Sprites.gif", 24, 18, 4, 1, 6, -30, 50)

;SetmovingRectangle(Sprite nr, LEFT, TOP, RIGHT, BOTTOM) sets cage for sprite
SetmovingRectangle(1, 0, 0, 780, 380)
SetmovingRectangle(2, 0, 0, 780, 380)
SetmovingRectangle(3, 0, 0, 780, 380)
SetmovingRectangle(4, 0, 0, 780, 380)
SetmovingRectangle(5, 0, 0, 780, 380)

;Movesprite(Sprite nr, posx, posy, Speed_x, Speed_y) ;Sets sprites movement
Movesprite(3,810,0,5,1)
Movesprite(4,810,410,6,3)

While 1
    Movesprite(5,Random(5,780,1),Random(5,410,1),6,3)
    Sleep(250)
    Movesprite(1,Random(5,780,1),Random(5,410,1),6,3)
    Sleep(250)
    Movesprite(2,Random(5,780,1),Random(5,410,1),6,3)
    Sleep(250)
WEnd

Func _exit()
    Exit
EndFunc

That way, all the user has to do is put the graphics in the same directory as the script.

-S


(Yet Another) ExcelCOM UDF"A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly...[indent]...specialization is for insects." - R. A. Heinlein[/indent]

Share this post


Link to post
Share on other sites

Ok, silly question time....

Jpam, are you using an old version of Autoit with this?, or the current Autoit/Beta?

The background loader will crash cause it uses the same "LoadExtImage" call as the other functions.

I tried the Sprites on their own, but that did`nt work either...


2015 - Still no flying cars, instead blankets with sleeves.

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  

×
×
  • Create New...