Jump to content

Won't show image


Recommended Posts

Please help! I've been puttering around with this thing for three hours now. Please help me re-write this so that the gif image is compiled with the script and shows on the GUI. The code is below and I've included the image.

Thanks for any assistance.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=wheeled-tractor.ico
#AutoIt3Wrapper_outfile=Farm-Bot\Farm-Bot v1.4.3.exe
#AutoIt3Wrapper_Run_After=ResHacker.exe -add Farm-Bot v1.4.3.exe, Farm-Bot v1.4.3.exe, farm.gif, rcdata, FARM_GIF_1, 0
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****


#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <resources.au3>

dim $a=1

GUI()


Func GUI()
    #Region ### START Koda GUI section ### Form=f:\here there be bots\gui.kxf
    Global $GUI = GUICreate("XXXXXX Farm-Bot v1.4.3", 306, 630, -1, -1)
    GUISetIcon("F:\Here there be bots\Farm-Bot.exe")
    GUISetCursor(3)
    GUISetBkColor(0xFFFFFF)
    Global $Label2 = GUICtrlCreateLabel("Note: Macros are NOT allowed in XXXXXX.  This application", 0, 448, 304, 18, $SS_CENTER)
    GUICtrlSetFont($Label2, 8, 400, 0, "Arial")
    GUICtrlSetColor($Label2, 0xFF0000)
    Global $Label3 = GUICtrlCreateLabel("is provided for entertainment purposes only.   This is not", 0, 464, 304, 18, $SS_CENTER)
    GUICtrlSetFont($Label3, 8, 400, 0, "Arial")
    GUICtrlSetColor($Label3, 0xFF0000)
    Global $Radio1 = GUICtrlCreateRadio("I need a 10-Hour farm rental", 72, 560, 161, 17)
    Global $Radio2 = GUICtrlCreateRadio("Farm leased through town (unlimited time)", 40, 544, 217, 17)
    GUICtrlSetState($Radio2, $GUI_CHECKED)
    Global $Crop = GUICtrlCreateCombo("Select a crop...", 101, 577, 137, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
    GUICtrlSetData($Crop, "Rice|Radish|Parsley|Shitake Mushroom|Mung Bean|Potato|Sweet Potato|Onion|Cucumber|Carrot|Garlic|Bean|Sesame Seed|Wheat")
    Global $Label4 = GUICtrlCreateLabel("Crop?", 64, 580, 32, 17)
    Global $Button1 = GUICtrlCreateButton("Start Farming", 117, 600, 89, 25, $WS_GROUP)
    GUICtrlSetFont($Button1, 8, 800, 0, "MS Sans Serif")
    GUICtrlSetBkColor($Button1, 0x008000)
    Global $Label1 = GUICtrlCreateLabel("intended for in game use under any circumstances!", 0, 480, 304, 18, $SS_CENTER)
    GUICtrlSetFont($Label1, 8, 400, 0, "Arial")
    GUICtrlSetColor($Label1, 0xFF0000)
    Global $Label5 = GUICtrlCreateLabel("For XXXXXX Farm-Bot to work you must ensure the following:", 8, 280, 289, 17)
    Global $Label7 = GUICtrlCreateLabel("1. You have food in the F2 slot of your inventory that heals", 8, 304, 279, 17)
    Global $Label8 = GUICtrlCreateLabel("your nervous system (Shabu Shabu +5, Crucian Carp Spicy", 8, 320, 282, 17)
    Global $Label9 = GUICtrlCreateLabel("Soup +20, Pancake +30).", 8, 336, 126, 17)
    Global $Label13 = GUICtrlCreateLabel("2. You have already equipped a sickle and you are standing", 8, 352, 287, 17)
    Global $Label14 = GUICtrlCreateLabel("on the farm. In other words, you are ready to farm now.", 8, 368, 261, 17)
    Global $Label16 = GUICtrlCreateLabel("XXXXXX Farm-Bot will automatically exit you ", 0, 496, 304, 18, $SS_CENTER)
    GUICtrlSetFont($Label16, 8, 400, 0, "Arial")
    GUICtrlSetColor($Label16, 0x008080)
    Global $Label17 = GUICtrlCreateLabel("from the game if you run out of food, your rental ", 0, 512, 304, 18, $SS_CENTER)
    GUICtrlSetFont($Label17, 8, 400, 0, "Arial")
    GUICtrlSetColor($Label17, 0x008080)
    Global $Label18 = GUICtrlCreateLabel("expires, or you are attacked.", 0, 528, 304, 18, $SS_CENTER)
    GUICtrlSetFont($Label18, 8, 400, 0, "Arial")
    GUICtrlSetColor($Label18, 0x008080)
    Global $Pic2 = GUICtrlCreatePic("", 24, 24, 256, 256, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
    _ResourceSetImageToCtrl($Pic2, "FARM_GIF_1")
    GUICtrlSetState ($Pic2, $GUI_DISABLE)
    Global $Label6 = GUICtrlCreateLabel("XXXXXX", 24, 0, 109, 41)
    GUICtrlSetFont($Label6, 24, 400, 2, "Times New Roman")
    Global $Label19 = GUICtrlCreateLabel("Farm-Bot", 150, 0, 130, 41)
    GUICtrlSetFont($Label19, 24, 400, 2, "Times New Roman")
    Global $Label20 = GUICtrlCreateLabel("Ctrl+Alt+x to exit anytime", 0, 600, 118, 17)
    Global $Label21 = GUICtrlCreateLabel("by GoonZu Mafia", 216, 600, 86, 17)
    Global $Label10 = GUICtrlCreateLabel("Farm-Bot will start a 10-hour lease for you if required!", 0, 392, 304, 18, $SS_CENTER)
    GUICtrlSetFont($Label10, 8, 800, 0, "Arial")
    GUICtrlSetColor($Label10, 0x800080)
    Global $Label11 = GUICtrlCreateLabel("Do NOT minimize XXXXXX!   XXXXXX in full screen!", 0, 408, 304, 18, $SS_CENTER)
    GUICtrlSetFont($Label11, 8, 800, 0, "Arial")
    GUICtrlSetColor($Label11, 0x008000)
    Global $Label12 = GUICtrlCreateLabel("Do NOT use if you can not one hit mobs near farm!", 0, 424, 304, 18, $SS_CENTER)
    GUICtrlSetFont($Label12, 8, 800, 0, "Arial")
    GUICtrlSetColor($Label12, 0x808000)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###


    While $a = 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                Exit
            Case $Button1
                $a = $a - 1
        EndSwitch
    WEnd
EndFunc   ;==>GUI

post-52778-12544475425077_thumb.gif

Link to comment
Share on other sites

  • Moderators

Slvrngrn,

Try adding this line before the #AutoIt3Wrapper_Run_After=ResHacker.exe directive (Reshacker will not work on upx'ed files):

#AutoIt3Wrapper_UseUpx=n

You might also want to change the Reshacker line to read:

#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, farm.gif, rcdata, FARM_GIF_1, 0

I have always found %out% a better bet than using the actual filename. :)

Once I changed these 2 lines, the picture appeared for me without problem.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Melba, thanks so much for the reply. I had already tried those early on in my efforts without success, and unfortunately it is still not working. I do appreciate the help though.

So I have made the changes Melba recommended and I am continuing my quest...

The only thing I can think of is perhaps I have the source file (farm.gif) in an inappropriate location. I have tried putting the full link without success. Do I need to have the image in a particular location for this to work? Also, is there a difference between compile and build?

Thanks again for any and all help, and I apologize to those sticklers out there... I really thought I posted this in the GUI section :)

Edited by Slvrngrn
Link to comment
Share on other sites

  • Moderators

Slvrngrn,

Paths are very important here. Both the image and ResHacker need full paths if they are not in the same folder as the script. Personally I always use full paths regardless.

Compile your script using full paths and if it does not work, post the output from the SciTE console.

Trust me, it will work - but it needs a bit of patience the first time - like many other things I can think of! :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

M23,

I can't tell you how much i appreciate your help. It did not work again. I see everything except the gif. Time to show my true colors and ask some n00b questions...

First, where would you recommend I get my ResHacker from? I have version 3.4.0, but it seems sort of old (2002).

Second, is this what you wanted to see when you said "post the output from the SciTE console"?

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=wheeled-tractor.ico
#AutoIt3Wrapper_outfile=Farm-Bot 1.4.2\Farm-Bot v1.4.3.exe
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Add_Constants=n
#AutoIt3Wrapper_Run_After=C:\Program Files\AutoIt3\ResHacker\ResHacker.exe -add %out%, %out%, F:\Here there be bots\farm.gif, rcdata, FARM_GIF_1, 0
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

If not, let me know.

Thanks for your patience. I'm learning here and folks like you make it a lot easier.

Slvr

Link to comment
Share on other sites

Posted Image

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****

#AutoIt3Wrapper_icon=wheeled-tractor.ico

#AutoIt3Wrapper_outfile=Farm-Bot\Farm-Bot v1.4.3.exe

#AutoIt3Wrapper_Run_After=ResHacker.exe -add Farm-Bot v1.4.3.exe, Farm-Bot v1.4.3.exe, farm.gif, rcdata, FARM_GIF_1, 0

#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <ButtonConstants.au3>

#include <ComboConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

;#include <resources.au3>

fileinstall ("farm.gif", @TempDir & "\farm.gif", 1)

dim $a=1

GUI()

Func GUI()

#Region ### START Koda GUI section ### Form=f:\here there be bots\gui.kxf

Global $GUI = GUICreate("XXXXXX Farm-Bot v1.4.3", 306, 630, -1, -1)

GUISetIcon("F:\Here there be bots\Farm-Bot.exe")

GUISetCursor(3)

GUISetBkColor(0xFFFFFF)

Global $Label2 = GUICtrlCreateLabel("Note: Macros are NOT allowed in XXXXXX. This application", 0, 448, 304, 18, $SS_CENTER)

GUICtrlSetFont($Label2, 8, 400, 0, "Arial")

GUICtrlSetColor($Label2, 0xFF0000)

Global $Label3 = GUICtrlCreateLabel("is provided for entertainment purposes only. This is not", 0, 464, 304, 18, $SS_CENTER)

GUICtrlSetFont($Label3, 8, 400, 0, "Arial")

GUICtrlSetColor($Label3, 0xFF0000)

Global $Radio1 = GUICtrlCreateRadio("I need a 10-Hour farm rental", 72, 560, 161, 17)

Global $Radio2 = GUICtrlCreateRadio("Farm leased through town (unlimited time)", 40, 544, 217, 17)

GUICtrlSetState($Radio2, $GUI_CHECKED)

Global $Crop = GUICtrlCreateCombo("Select a crop...", 101, 577, 137, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))

GUICtrlSetData($Crop, "Rice|Radish|Parsley|Shitake Mushroom|Mung Bean|Potato|Sweet Potato|Onion|Cucumber|Carrot|Garlic|Bean|Sesame Seed|Wheat")

Global $Label4 = GUICtrlCreateLabel("Crop?", 64, 580, 32, 17)

Global $Button1 = GUICtrlCreateButton("Start Farming", 117, 600, 89, 25, $WS_GROUP)

GUICtrlSetFont($Button1, 8, 800, 0, "MS Sans Serif")

GUICtrlSetBkColor($Button1, 0x008000)

Global $Label1 = GUICtrlCreateLabel("intended for in game use under any circumstances!", 0, 480, 304, 18, $SS_CENTER)

GUICtrlSetFont($Label1, 8, 400, 0, "Arial")

GUICtrlSetColor($Label1, 0xFF0000)

Global $Label5 = GUICtrlCreateLabel("For XXXXXX Farm-Bot to work you must ensure the following:", 8, 280, 289, 17)

Global $Label7 = GUICtrlCreateLabel("1. You have food in the F2 slot of your inventory that heals", 8, 304, 279, 17)

Global $Label8 = GUICtrlCreateLabel("your nervous system (Shabu Shabu +5, Crucian Carp Spicy", 8, 320, 282, 17)

Global $Label9 = GUICtrlCreateLabel("Soup +20, Pancake +30).", 8, 336, 126, 17)

Global $Label13 = GUICtrlCreateLabel("2. You have already equipped a sickle and you are standing", 8, 352, 287, 17)

Global $Label14 = GUICtrlCreateLabel("on the farm. In other words, you are ready to farm now.", 8, 368, 261, 17)

Global $Label16 = GUICtrlCreateLabel("XXXXXX Farm-Bot will automatically exit you ", 0, 496, 304, 18, $SS_CENTER)

GUICtrlSetFont($Label16, 8, 400, 0, "Arial")

GUICtrlSetColor($Label16, 0x008080)

Global $Label17 = GUICtrlCreateLabel("from the game if you run out of food, your rental ", 0, 512, 304, 18, $SS_CENTER)

GUICtrlSetFont($Label17, 8, 400, 0, "Arial")

GUICtrlSetColor($Label17, 0x008080)

Global $Label18 = GUICtrlCreateLabel("expires, or you are attacked.", 0, 528, 304, 18, $SS_CENTER)

GUICtrlSetFont($Label18, 8, 400, 0, "Arial")

GUICtrlSetColor($Label18, 0x008080)

Global $Pic2 = GUICtrlCreatePic(@TempDir & "\farm.gif", 24, 24, 256, 256, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))

;_ResourceSetImageToCtrl($Pic2, "FARM_GIF_1")

GUICtrlSetState ($Pic2, $GUI_DISABLE)

Global $Label6 = GUICtrlCreateLabel("XXXXXX", 24, 0, 109, 41)

GUICtrlSetFont($Label6, 24, 400, 2, "Times New Roman")

Global $Label19 = GUICtrlCreateLabel("Farm-Bot", 150, 0, 130, 41)

GUICtrlSetFont($Label19, 24, 400, 2, "Times New Roman")

Global $Label20 = GUICtrlCreateLabel("Ctrl+Alt+x to exit anytime", 0, 600, 118, 17)

Global $Label21 = GUICtrlCreateLabel("by GoonZu Mafia", 216, 600, 86, 17)

Global $Label10 = GUICtrlCreateLabel("Farm-Bot will start a 10-hour lease for you if required!", 0, 392, 304, 18, $SS_CENTER)

GUICtrlSetFont($Label10, 8, 800, 0, "Arial")

GUICtrlSetColor($Label10, 0x800080)

Global $Label11 = GUICtrlCreateLabel("Do NOT minimize XXXXXX! XXXXXX in full screen!", 0, 408, 304, 18, $SS_CENTER)

GUICtrlSetFont($Label11, 8, 800, 0, "Arial")

GUICtrlSetColor($Label11, 0x008000)

Global $Label12 = GUICtrlCreateLabel("Do NOT use if you can not one hit mobs near farm!", 0, 424, 304, 18, $SS_CENTER)

GUICtrlSetFont($Label12, 8, 800, 0, "Arial")

GUICtrlSetColor($Label12, 0x808000)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While $a = 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case $Button1

$a = $a - 1

EndSwitch

WEnd

EndFunc ;==>GUI

Edited by andygo
Link to comment
Share on other sites

  • Moderators

Slvrngrn,

Do you want to keep going to try and get the Resources code to work or are you happy with the FileInstall version?

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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