Jump to content

Help with script


 Share

Recommended Posts

Highlight all your code in your SciTe window, and press CTRL+C. Post a new reply, go like this:

Type:

(Press   CTRL+V, then type)
AutoIt3Wrapper_useupx=n
#AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, P1.jpg, rcdata, TEST_JPG_1, 0
#AutoIt3Wrapper_run_after=upx.exe --best --compress-resources=0 "%out%"

#include "resources.au3"
 
$gui = GUICreate("pic",1600,1200)
$pic1 = GUICtrlCreatePic("",0,0,1600,1200)
_ResourceSetImageToCtrl($pic1, "TEST_JPG_1"); set JPG image to picture control from resource
GUISetState(@SW_SHOW)

While 1
    If GUIGetMsg() = -3 Then Exit
WEnd
Link to comment
Share on other sites

AutoIt3Wrapper_useupx=n
#AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, P1.jpg, rcdata, TEST_JPG_1, 0
#AutoIt3Wrapper_run_after=upx.exe --best --compress-resources=0 "%out%"

#include "resources.au3"
 
$gui = GUICreate("pic",1600,1200)
$pic1 = GUICtrlCreatePic("",0,0,1600,1200)
_ResourceSetImageToCtrl($pic1, "TEST_JPG_1"); set JPG image to picture control from resource
GUISetState(@SW_SHOW)

While 1
    If GUIGetMsg() = -3 Then Exit
WEnd
Good job! The problem is, I've never used Zednas resource UDF, so you'll have to wait until he sees the thread.
Link to comment
Share on other sites

AutoIt3Wrapper_useupx=n
#AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, P1.jpg, rcdata, TEST_JPG_1, 0
#AutoIt3Wrapper_run_after=upx.exe --best --compress-resources=0 "%out%"

#include "resources.au3"
 
$gui = GUICreate("pic",1600,1200)
$pic1 = GUICtrlCreatePic("",0,0,1600,1200)
_ResourceSetImageToCtrl($pic1, "TEST_JPG_1"); set JPG image to picture control from resource
GUISetState(@SW_SHOW)

While 1
    If GUIGetMsg() = -3 Then Exit
WEnd
If I replace P1.jpg with an image of my own, which is in the same folder as the script, and if I have upx.exe in the same folder as the script it compiles ok, and when I run the exe I get the image displayed.

If you still have a problem make sure the messages can be seen in your output pane at the bottom of scite, then after you have compiled the script copy all the text in that output pane and post it here so we can see what goes wrong.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

If I replace P1.jpg with an image of my own, which is in the same folder as the script, and if I have upx.exe in the same folder as the script it compiles ok, and when I run the exe I get the image displayed.

If you still have a problem make sure the messages can be seen in your output pane at the bottom of scite, then after you have compiled the script copy all the text in that output pane and post it here so we can see what goes wrong.

I have resources .au3, P1.jpg, my scrip, upx.exe all in the same folder. My script was compiled using F7 with the latest script editor. I still can't get my jgp image to view. Here is the output after compiling.

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /prod /in "C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\test.au3" /autoit3dir "C:\Program Files\AutoIt3"

+>15:28:51 Starting AutoIt3Wrapper v.1.10.1.14 Environment(Language:0409 Keyboard:00000409 OS:WIN_XP/Service Pack 3 CPU:X86 ANSI)

>Running AU3Check (1.54.13.0) from:C:\Program Files\AutoIt3

+>15:28:51 AU3Check ended.rc:0

>Running:(3.2.12.1):C:\Program Files\AutoIt3\aut2exe\aut2exe.exe /in "C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\test.au3" /out "C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\test.exe" /comp 2 /nopack /Bin C:\DOCUME~1\Tim\LOCALS~1\Temp\AutoItSC.bin

+>15:28:52 Aut2exe.exe ended.rc:0

+>15:28:52 Created program:C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\test.exe

->Warning: This is an Unicode compiled script and will not run on Win9x/ME.

>Running:ResHacker.exe -add C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\test.exe, C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\test.exe, P1.jpg, rcdata, TEST_JPG_1, 0

'ResHacker.exe' is not recognized as an internal or external command,

operable program or batch file.

>ResHacker.exe -add C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\test.exe, C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\test.exe, P1.jpg, rcdata, TEST_JPG_1, 0 Ended rc:1

>Running:upx.exe --best --compress-resources=0 "C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\test.exe"

Ultimate Packer for eXecutables

Copyright © 1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007

UPX 3.01w Markus Oberhumer, Laszlo Molnar & John Reiser Jul 31st 2007

File size Ratio Format Name

-------------------- ------ ----------- -----------

595961 -> 336889 56.53% win32/pe test.exe

Packed 1 file.

>upx.exe --best --compress-resources=0 "C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\test.exe" Ended rc:0

+>15:28:54 AutoIt3Wrapper Finished

>Exit code: 0 Time: 3.800

[\code]

thanks for the help.

Link to comment
Share on other sites

I have resources .au3, P1.jpg, my scrip, upx.exe all in the same folder. My script was compiled using F7 with the latest script editor. I still can't get my jgp image to view. Here is the output after compiling.

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /prod /in "C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\test.au3" /autoit3dir "C:\Program Files\AutoIt3"

+>15:28:51 Starting AutoIt3Wrapper v.1.10.1.14 Environment(Language:0409 Keyboard:00000409 OS:WIN_XP/Service Pack 3 CPU:X86 ANSI)

>Running AU3Check (1.54.13.0) from:C:\Program Files\AutoIt3

+>15:28:51 AU3Check ended.rc:0

>Running:(3.2.12.1):C:\Program Files\AutoIt3\aut2exe\aut2exe.exe /in "C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\test.au3" /out "C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\test.exe" /comp 2 /nopack /Bin C:\DOCUME~1\Tim\LOCALS~1\Temp\AutoItSC.bin

+>15:28:52 Aut2exe.exe ended.rc:0

+>15:28:52 Created program:C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\test.exe

->Warning: This is an Unicode compiled script and will not run on Win9x/ME.

>Running:ResHacker.exe -add C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\test.exe, C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\test.exe, P1.jpg, rcdata, TEST_JPG_1, 0

'ResHacker.exe' is not recognized as an internal or external command,

operable program or batch file.

>ResHacker.exe -add C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\test.exe, C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\test.exe, P1.jpg, rcdata, TEST_JPG_1, 0 Ended rc:1

>Running:upx.exe --best --compress-resources=0 "C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\test.exe"

Ultimate Packer for eXecutables

Copyright © 1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007

UPX 3.01w Markus Oberhumer, Laszlo Molnar & John Reiser Jul 31st 2007

File size Ratio Format Name

-------------------- ------ ----------- -----------

595961 -> 336889 56.53% win32/pe test.exe

Packed 1 file.

>upx.exe --best --compress-resources=0 "C:\PROGRAMING AUTOIT\MYSCREEN SAVER\LANDSCAPE2\test.exe" Ended rc:0

+>15:28:54 AutoIt3Wrapper Finished

>Exit code: 0 Time: 3.800

[\code]

thanks for the help.

There is an error reported in the output.

'ResHacker.exe' is not recognized as an internal or external command, operable program or batch file.

so the pictures are not being added to your exe.

Are you sure you have a copy of ResHacker.exe in the script folder?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

There is an error reported in the output.

so the pictures are not being added to your exe.

Are you sure you have a copy of ResHacker.exe in the script folder?

I was wondering about that line. I also have aut2.exe, aut2exeA, au2exe_64 in the folder, but where do I find Reshacker.exe? I don't have that in the folder. I don't know enough yet to know what I'm doing.

Link to comment
Share on other sites

I was wondering about that line. I also have aut2.exe, aut2exeA, au2exe_64 in the folder, but where do I find Reshacker.exe? I don't have that in the folder. I don't know enough yet to know what I'm doing.

I don't have ResHacker.exe on my computer. Where can I download it from.

Link to comment
Share on other sites

THANK YOU.

It finally works. How do I add additional images to the resources file. Here is the script.

#AutoIt3Wrapper_useupx=n
#AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, P1.jpg, rcdata, TEST_JPG_1, 0
#AutoIt3Wrapper_run_after=upx.exe --best --compress-resources=0 "%out%"

#include "resources.au3"
 
$gui = GUICreate("pic",1600,1200)
$pic1 = GUICtrlCreatePic("",0,0,1600,1200)
_ResourceSetImageToCtrl($pic1, "TEST_JPG_1"); set JPG image to picture control from resource
GUISetState(@SW_SHOW)

While 1
    If GUIGetMsg() = -3 Then Exit
WEnd

Do I add them after the P1.jpg and before the rcdata ? I'm new at this.

Link to comment
Share on other sites

It finally works. How do I add additional images to the resources file. Here is the script.

#AutoIt3Wrapper_useupx=n
#AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, P1.jpg, rcdata, TEST_JPG_1, 0
#AutoIt3Wrapper_run_after=upx.exe --best --compress-resources=0 "%out%"

#include "resources.au3"
 
$gui = GUICreate("pic",1600,1200)
$pic1 = GUICtrlCreatePic("",0,0,1600,1200)
_ResourceSetImageToCtrl($pic1, "TEST_JPG_1"); set JPG image to picture control from resource
GUISetState(@SW_SHOW)

While 1
    If GUIGetMsg() = -3 Then Exit
WEnd

Do I add them after the P1.jpg and before the rcdata ? I'm new at this.

Glad you got it working.

Being new is very little to do with it. Taking the time to look at the information provided is everything. As Zedna has already told you, read his thread and look at the example he gives for testing the udf. The example has lots of images loaded. If you just opened his resourse_test script the answer would be staring at you and you wouldn't need to ask.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Glad you got it working.

Being new is very little to do with it. Taking the time to look at the information provided is everything. As Zedna has already told you, read his thread and look at the example he gives for testing the udf. The example has lots of images loaded. If you just opened his resourse_test script the answer would be staring at you and you wouldn't need to ask.

Thank you , I got that far and I'm working on it.

Link to comment
Share on other sites

Glad you got it working.

Being new is very little to do with it. Taking the time to look at the information provided is everything. As Zedna has already told you, read his thread and look at the example he gives for testing the udf. The example has lots of images loaded. If you just opened his resourse_test script the answer would be staring at you and you wouldn't need to ask.

It's one thing to look at information and understand it, and quite another to look at text and haven' the foggiest at what your looking at. I'm beginning to understand what you've been trying to say. Thanks for the help and I'm sorry I've been a bore.

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...