Sign in to follow this  
Followers 0
kaotkbliss

Move images from one button to another

14 posts in this topic

#1 ·  Posted (edited)

ok, it's mostly working (images move about 75-85% of the time)

the problem is, GuiCtrlSetImage is not working to change an image once a button has an image on it!

#include <GUIConstantsEx.au3>
#Include <Misc.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GDIPlus.au3>
Global $loota
$dll=DllOpen("user32.dll")

;$parent=GUICreate("")
;GUISetState(@SW_HIDE,$parent)
$inv = GUICreate("Inventory", 262, 496, 50, 50, $WS_BORDER, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_ACCEPTFILES))
$inv1= GUICtrlCreateButton("",1,1,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv2= GUICtrlCreateButton("",52,1,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv3= GUICtrlCreateButton("",104,1,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv4= GUICtrlCreateButton("",156,1,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv5= GUICtrlCreateButton("",208,1,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv6= GUICtrlCreateButton("",1,52,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv7= GUICtrlCreateButton("",52,52,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv8= GUICtrlCreateButton("",104,52,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv9= GUICtrlCreateButton("",156,52,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv10= GUICtrlCreateButton("",208,52,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv11= GUICtrlCreateButton("",1,104,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv12= GUICtrlCreateButton("",52,104,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv13= GUICtrlCreateButton("",104,104,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv14= GUICtrlCreateButton("",156,104,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv15= GUICtrlCreateButton("",208,104,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv16= GUICtrlCreateButton("",1,156,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv17= GUICtrlCreateButton("",52,156,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv18= GUICtrlCreateButton("",104,156,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv19= GUICtrlCreateButton("",156,156,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv20= GUICtrlCreateButton("",208,156,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv21= GUICtrlCreateButton("",1,208,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv22= GUICtrlCreateButton("",52,208,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv23= GUICtrlCreateButton("",104,208,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv24= GUICtrlCreateButton("",156,208,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv25= GUICtrlCreateButton("",208,208,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv26= GUICtrlCreateButton("",1,260,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv27= GUICtrlCreateButton("",52,260,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv28= GUICtrlCreateButton("",104,260,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv29= GUICtrlCreateButton("",156,260,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv30= GUICtrlCreateButton("",208,260,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv31= GUICtrlCreateButton("",1,312,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv32= GUICtrlCreateButton("",52,312,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv33= GUICtrlCreateButton("",104,312,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv34= GUICtrlCreateButton("",156,312,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv35= GUICtrlCreateButton("",208,312,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv36= GUICtrlCreateButton("",1,364,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv37= GUICtrlCreateButton("",52,364,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv38= GUICtrlCreateButton("",104,364,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv39= GUICtrlCreateButton("",156,364,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv40= GUICtrlCreateButton("",208,364,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv41= GUICtrlCreateButton("",1,418,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv42= GUICtrlCreateButton("",52,418,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv43= GUICtrlCreateButton("",104,418,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv44= GUICtrlCreateButton("",156,418,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$inv45= GUICtrlCreateButton("",208,418,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)

GUISetBkColor(0x2A3FAA, $inv)
GUISetState(@SW_HIDE,$inv)

$equip = GUICreate("Equiped Items", 368, 498, 50, 50, $WS_BORDER, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_ACCEPTFILES))
$equip1= GUICtrlCreateButton("",312,1,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$equip2= GUICtrlCreateButton("",312,52,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$equip3= GUICtrlCreateButton("",260,1,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$equip4= GUICtrlCreateButton("",260,52,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$equip5= GUICtrlCreateButton("",260,104,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$equip6= GUICtrlCreateButton("",260,156,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$equip7= GUICtrlCreateButton("",260,208,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$equip8= GUICtrlCreateButton("",260,260,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$equip9= GUICtrlCreateButton("",260,312,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$equip10= GUICtrlCreateButton("",260,364,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$equip11= GUICtrlCreateButton("",1,52,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$equip12= GUICtrlCreateButton("",1,208,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$equip13= GUICtrlCreateButton("",52,1,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$equip14= GUICtrlCreateButton("",52,52,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$equip15= GUICtrlCreateButton("",52,104,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$equip16= GUICtrlCreateButton("",52,156,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$equip17= GUICtrlCreateButton("",52,208,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$equip18= GUICtrlCreateButton("",52,260,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$equip19= GUICtrlCreateButton("",52,312,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$equip20= GUICtrlCreateButton("",52,416,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$equip21= GUICtrlCreateButton("",156,416,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)

GUISetBkColor(0x2A3FAA, $equip)
GUISetState(@SW_HIDE,$equip)

$loot = GUICreate("Loot", 260, 72, 50, 50, $WS_BORDER, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_ACCEPTFILES))
$loot1= GUICtrlCreateButton("",1,1,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$loot2= GUICtrlCreateButton("",52,1,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$loot3= GUICtrlCreateButton("",104,1,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$loot4= GUICtrlCreateButton("",156,1,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$loot5= GUICtrlCreateButton("",208,1,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)

GUISetBkColor(0x2A3FAA, $loot)
GUISetState(@SW_HIDE,$loot)

$loota=""

While 1
    $msg=GUIGetMsg()

If $msg=$loot1 Then
    Select
    Case $loota=""
    $loota=GUICtrlRead($loot1)
    Sleep(100)
    $getitem=IniRead("E:\Shawns_Stuff\Terisi_PF\data\ltable.ini","loot",6,"")
    Sleep(100)
    GUICtrlSetData($loot1,$getitem)
    Sleep(100)
    GUICtrlSetImage($loot1,"E:\Shawns_Stuff\Terisi_PF"&$getitem)
    Sleep(100)
EndSelect
EndIf
If $msg=$loot2 Then
    Select
    Case $loota=""
        $loota=GUICtrlRead($loot2)
        Sleep(100)
    $getitem=IniRead("E:\Shawns_Stuff\Terisi_PF\data\ltable.ini","loot",6,"")
    Sleep(100)
    GUICtrlSetData($loot2,$getitem)
    Sleep(100)
    GUICtrlSetImage($loot2,"E:\Shawns_Stuff\Terisi_PF"&$getitem)
    Sleep(100)
EndSelect
    EndIf
If $msg=$loot3 Then
    Select
    Case $loota=""
        $loota=GUICtrlRead($loot3)
        Sleep(100)
    $getitem=IniRead("E:\Shawns_Stuff\Terisi_PF\data\ltable.ini","loot",6,"")
    Sleep(100)
    GUICtrlSetData($loot3,$getitem)
    Sleep(100)
    GUICtrlSetImage($loot3,"E:\Shawns_Stuff\Terisi_PF"&$getitem)
    Sleep(100)
EndSelect
    EndIf
If $msg=$loot4 Then
    Select
    Case $loota=""
        $loota=GUICtrlRead($loot4)
        Sleep(100)
    $getitem=IniRead("E:\Shawns_Stuff\Terisi_PF\data\ltable.ini","loot",6,"")
    Sleep(100)
    GUICtrlSetData(72,$getitem)
    Sleep(100)
    GUICtrlSetImage(72,"E:\Shawns_Stuff\Terisi_PF"&$getitem)
    Sleep(100)
EndSelect
    EndIf
If $msg=$loot5 Then
    Select
    Case $loota=""
        $loota=GUICtrlRead($loot5)
        Sleep(100)
    $getitem=IniRead("E:\Shawns_Stuff\Terisi_PF\data\ltable.ini","loot",6,"")
    Sleep(100)
    GUICtrlSetData(72,$getitem)
    Sleep(100)
    GUICtrlSetImage(72,"E:\Shawns_Stuff\Terisi_PF"&$getitem)
    Sleep(100)
EndSelect
    EndIf

If $msg=$equip1 Then
    Select
    Case $loota=""
        $loota=GUICtrlRead($equip1)
        Sleep(100)
        GUICtrlSetData($equip1,"")
        Sleep(100)
        GUICtrlSetImage($equip1,"")
        Sleep(100)
    Case $loota<>""
        GUICtrlSetData($equip1,$loota)
        Sleep(100)
        GUICtrlSetImage($equip1,"E:\Shawns_Stuff\Terisi_PF"&$loota)
        Sleep(100)
        $loota=""
        Sleep(100)
    EndSelect
    EndIf
If $msg=$equip2 Then
    Select
    Case $loota=""
        $loota=GUICtrlRead($equip2)
        Sleep(100)
        GUICtrlSetData($equip2,"")
        Sleep(100)
        GUICtrlSetImage($equip2,"")
        Sleep(100)
    Case $loota<>""
    GUICtrlSetData($equip2,$loota)
    Sleep(100)
    GUICtrlSetImage($equip2,"E:\Shawns_Stuff\Terisi_PF"&$loota)
    Sleep(100)
    $loota=""
    Sleep(100)
EndSelect
    EndIf
If $msg=$equip3 Then
    Select
    Case $loota=""
        $loota=GUICtrlRead($equip3)
        Sleep(100)
        GUICtrlSetData($equip3,"")
        Sleep(100)
        GUICtrlSetImage($equip3,"")
        Sleep(100)
    Case $loota<>""
    GUICtrlSetData($equip3,$loota)
    Sleep(100)
    GUICtrlSetImage($equip3,"E:\Shawns_Stuff\Terisi_PF"&$loota)
    Sleep(100)
    $loota=""
    Sleep(100)
EndSelect
    EndIf
If $msg=$equip4 Then
    Select
    Case $loota=""
        $loota=GUICtrlRead($equip4)
        Sleep(100)
        GUICtrlSetData($equip4,"")
        Sleep(100)
        GUICtrlSetImage($equip4,"")
        Sleep(100)
    Case $loota<>""
    GUICtrlSetData($equip4,$loota)
    Sleep(100)
    GUICtrlSetImage($equip4,"E:\Shawns_Stuff\Terisi_PF"&$loota)
    Sleep(100)
    $loota=""
    Sleep(100)
EndSelect
    EndIf
If $msg=$equip5 Then
    Select
        Case $loota=""
        $loota=GUICtrlRead($equip5)
        Sleep(100)
        GUICtrlSetData($equip5,"")
        Sleep(100)
        GUICtrlSetImage($equip5,"")
        Sleep(100)
    Case $loota<>""
    GUICtrlSetData($equip5,$loota)
    Sleep(100)
    GUICtrlSetImage($equip5,"E:\Shawns_Stuff\Terisi_PF"&$loota)
    Sleep(100)
    $loota=""
EndSelect
    EndIf
If $msg=$equip6 Then
    Select
    Case $loota=""
        $loota=GUICtrlRead($equip6)
        Sleep(100)
        GUICtrlSetData($equip6,"")
        Sleep(100)
        GUICtrlSetImage($equip6,"")
        Sleep(100)
    Case $loota<>""
    GUICtrlSetData($equip6,$loota)
    Sleep(100)
    GUICtrlSetImage($equip6,"E:\Shawns_Stuff\Terisi_PF"&$loota)
    Sleep(100)
    $loota=""
    Sleep(100)
EndSelect
    EndIf
If $msg=$equip7 Then
    Select
    Case $loota=""
        $loota=GUICtrlRead($equip7)
        Sleep(100)
        GUICtrlSetData($equip7,"")
        Sleep(100)
        GUICtrlSetImage($equip7,"")
        Sleep(100)
    Case $loota<>""
    GUICtrlSetData($equip7,$loota)
    Sleep(100)
    GUICtrlSetImage($equip7,"E:\Shawns_Stuff\Terisi_PF"&$loota)
    Sleep(100)
    $loota=""
    Sleep(100)
EndSelect
    EndIf
If $msg=$equip8 Then
    Select
    Case $loota=""
        $loota=GUICtrlRead($equip8)
        Sleep(100)
        GUICtrlSetData($equip8,"")
        Sleep(100)
        GUICtrlSetImage($equip8,"")
    Case $loota<>""
    GUICtrlSetData($equip8,$loota)
    Sleep(100)
    GUICtrlSetImage($equip8,"E:\Shawns_Stuff\Terisi_PF"&$loota)
    Sleep(100)
    $loota=""
    Sleep(100)
EndSelect
    EndIf
If $msg=$equip9 Then
    Select
    Case $loota=""
        $loota=GUICtrlRead($equip9)
        Sleep(100)
        GUICtrlSetData($equip9,"")
        Sleep(100)
        GUICtrlSetImage($equip9,"")
    Case $loota<>""
    GUICtrlSetData($equip9,$loota)
    Sleep(100)
    GUICtrlSetImage($equip9,"E:\Shawns_Stuff\Terisi_PF"&$loota)
    Sleep(100)
    $loota=""
    Sleep(100)
EndSelect
    EndIf
If $msg=$equip10 Then
    Select
    Case $loota=""
        $loota=GUICtrlRead($equip10)
        Sleep(100)
        GUICtrlSetData($equip10,"")
        Sleep(100)
        GUICtrlSetImage($equip10,"")
    Case $loota<>""
    GUICtrlSetData($equip10,$loota)
    Sleep(100)
    GUICtrlSetImage($equip10,"E:\Shawns_Stuff\Terisi_PF"&$loota)
    Sleep(100)
    $loota=""
    Sleep(100)
EndSelect
    EndIf
If $msg=$equip11 Then
    Select
    Case $loota=""
        $loota=GUICtrlRead($equip11)
        Sleep(100)
        GUICtrlSetData($equip11,"")
        Sleep(100)
        GUICtrlSetImage($equip11,"")
    Case $loota<>""
    GUICtrlSetData($equip11,$loota)
    Sleep(100)
    GUICtrlSetImage($equip11,"E:\Shawns_Stuff\Terisi_PF"&$loota)
    Sleep(100)
    $loota=""
    Sleep(100)
EndSelect
    EndIf
If $msg=$equip12 Then
    Select
    Case $loota=""
        $loota=GUICtrlRead($equip12)
        Sleep(100)
        GUICtrlSetData($equip12,"")
        Sleep(100)
        GUICtrlSetImage($equip12,"")
    Case $loota<>""
    GUICtrlSetData($equip12,$loota)
    Sleep(100)
    GUICtrlSetImage($equip12,"E:\Shawns_Stuff\Terisi_PF"&$loota)
    Sleep(100)
    $loota=""
    Sleep(100)
EndSelect
    EndIf
If $msg=$equip13 Then
    Select
    Case $loota=""
        $loota=GUICtrlRead($equip13)
        Sleep(100)
        GUICtrlSetData($equip13,"")
        Sleep(100)
        GUICtrlSetImage($equip13,"")
    Case $loota<>""
    GUICtrlSetData($equip13,$loota)
    Sleep(100)
    GUICtrlSetImage($equip13,"E:\Shawns_Stuff\Terisi_PF"&$loota)
    Sleep(100)
    $loota=""
    Sleep(100)
EndSelect
    EndIf
If $msg=$equip14 Then
    Select
    Case $loota=""
        $loota=GUICtrlRead($equip14)
        Sleep(100)
        GUICtrlSetData($equip14,"")
        Sleep(100)
        GUICtrlSetImage($equip14,"")
    Case $loota<>""
    GUICtrlSetData($equip14,$loota)
    Sleep(100)
    GUICtrlSetImage($equip14,"E:\Shawns_Stuff\Terisi_PF"&$loota)
    Sleep(100)
    $loota=""
    Sleep(100)
EndSelect
    EndIf
If $msg=$equip15 Then
    Select
    Case $loota=""
        $loota=GUICtrlRead($equip15)
        Sleep(100)
        GUICtrlSetData($equip15,"")
        Sleep(100)
        GUICtrlSetImage($equip15,"")
    Case $loota<>""
    GUICtrlSetData($equip15,$loota)
    Sleep(100)
    GUICtrlSetImage($equip15,"E:\Shawns_Stuff\Terisi_PF"&$loota)
    Sleep(100)
    $loota=""
    Sleep(100)
EndSelect
    EndIf
If $msg=$equip16 Then
    Select
    Case $loota=""
        $loota=GUICtrlRead($equip16)
        Sleep(100)
        GUICtrlSetData($equip16,"")
        Sleep(100)
        GUICtrlSetImage($equip16,"")
    Case $loota<>""
    GUICtrlSetData($equip16,$loota)
    Sleep(100)
    GUICtrlSetImage($equip16,"E:\Shawns_Stuff\Terisi_PF"&$loota)
    Sleep(100)
    $loota=""
    Sleep(100)
EndSelect
    EndIf
If $msg=$equip17 Then
    Select
    Case $loota=""
        $loota=GUICtrlRead($equip17)
        Sleep(100)
        GUICtrlSetData($equip17,"")
        Sleep(100)
        GUICtrlSetImage($equip17,"")
        Sleep(100)
    Case $loota<>""
    GUICtrlSetData($equip17,$loota)
    Sleep(100)
    GUICtrlSetImage($equip17,"E:\Shawns_Stuff\Terisi_PF"&$loota)
    Sleep(100)
    $loota=""
    Sleep(100)
EndSelect
    EndIf
If $msg=$equip18 Then
    Select
    Case $loota=""
        $loota=GUICtrlRead($equip18)
        Sleep(100)
        GUICtrlSetData($equip18,"")
        Sleep(100)
        GUICtrlSetImage($equip18,"")
        Sleep(100)
    Case $loota<>""
    GUICtrlSetData($equip18,$loota)
    Sleep(100)
    GUICtrlSetImage($equip18,"E:\Shawns_Stuff\Terisi_PF"&$loota)
    Sleep(100)
    $loota=""
    Sleep(100)
EndSelect
    EndIf
If $msg=$equip19 Then
    Select
    Case $loota=""
        $loota=GUICtrlRead($equip19)
        Sleep(100)
        GUICtrlSetData($equip19,"")
        Sleep(100)
        GUICtrlSetImage($equip19,"")
        Sleep(100)
    Case $loota<>""
    GUICtrlSetData($equip19,$loota)
    Sleep(100)
    GUICtrlSetImage($equip19,"E:\Shawns_Stuff\Terisi_PF"&$loota)
    Sleep(100)
    $loota=""
    Sleep(100)
EndSelect
    EndIf
If $msg=$equip20 Then
    Select
    Case $loota=""
        $loota=GUICtrlRead($equip20)
        Sleep(100)
        GUICtrlSetData($equip20,"")
        Sleep(100)
        GUICtrlSetImage($equip20,"")
        Sleep(100)
    Case $loota<>""
    GUICtrlSetData($equip20,$loota)
    Sleep(100)
    GUICtrlSetImage($equip20,"E:\Shawns_Stuff\Terisi_PF"&$loota)
    Sleep(100)
    $loota=""
EndSelect
    EndIf
If $msg=$equip21 Then
    Select
    Case $loota=""
        $loota=GUICtrlRead($equip21)
        Sleep(100)
        GUICtrlSetData($equip21,"")
        Sleep(100)
        GUICtrlSetImage($equip21,"")
        Sleep(100)
    Case $loota<>""
    GUICtrlSetData($equip21,$loota)
    Sleep(100)
    GUICtrlSetImage($equip21,"E:\Shawns_Stuff\Terisi_PF"&$loota)
    Sleep(100)
    $loota=""
    Sleep(100)
EndSelect
    EndIf

If _IsPressed("49",$dll) Then ;i for inventory
    $duh=WinGetState($inv)
    Sleep(100)
    Select
    Case $duh=5
    GUISetState(@SW_SHOW,$inv)
    Case $duh=15 Or $duh=7
    GUISetState(@SW_HIDE,$inv)
    EndSelect
EndIf

If _IsPressed("45",$dll) Then ;e for equipment
    $duh=WinGetState($equip)
    Sleep(100)
    Select
    Case $duh=5
    GUISetState(@SW_SHOW,$equip)
    Case $duh=15 Or $duh=7
    GUISetState(@SW_HIDE,$equip)
    EndSelect
EndIf
If _IsPressed("1B",$dll) Then
    DllClose($dll)
    exit(1)
EndIf
If _IsPressed("4C",$dll) Then ;l for loot
    $duh=WinGetState($loot)
    Sleep(100)
    Select
    Case $duh=5
        GUISetState(@SW_SHOW,$loot)
        $lootitem=68
        While $lootitem<74
        $lootitem+=1
        $item=Random ( 1, 6, 1 )
        $getitem=IniRead("E:\Shawns_Stuff\Terisi_PF\data\ltable.ini","loot",$item,"")
        GUICtrlSetData($lootitem,$getitem)
        GUICtrlSetImage($lootitem,"E:\Shawns_Stuff\Terisi_PF"&$getitem)
    WEnd

    Case $duh=15 Or $duh=7
    GUISetState(@SW_HIDE,$loot)
    EndSelect
EndIf
WEnd
Edited by kaotkbliss

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites



Well, I'm about ready to climb into bed and I did have a nice post all written out but I think I hit the wrong button and it got sucked into the void of the interweb.

Basically I wanted to ask if guictrlcreateicon would be an easy solution to this. (I found that while searching the helpfile for what $WS_TABSTOP actually does)

I wouldn't be able to drag an icon or small image from one box to another, but I think I should be able to click on a box that has an icon and click an empty box to have the icon jump from one box to another?

Not exactly what I was looking for, but maybe a possible solution?

Definately not looking for someone to write anything for me, but it would be nice to know if I would be wasting time trying.


010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

Well, I've been messing around with GUICtrlSetImage and I have gotten a 3rd popup box to display a set of 5 random bmps.

For the next step I need to figure out how to tell which image is on which button so when I click on 1, it can grab the image and place it on the next button I click.

#include <GUIConstantsEx.au3>
#Include <Misc.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>

$dll=DllOpen("user32.dll")

;$parent=GUICreate("")
;GUISetState(@SW_HIDE,$parent)
$inv = GUICreate("Inventory", 262, 496, 50, 50, $WS_BORDER, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_ACCEPTFILES))
$inv1= GUICtrlCreateButton("",1,1,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv2= GUICtrlCreateButton("",52,1,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv3= GUICtrlCreateButton("",104,1,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv4= GUICtrlCreateButton("",156,1,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv5= GUICtrlCreateButton("",208,1,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv6= GUICtrlCreateButton("",1,52,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv7= GUICtrlCreateButton("",52,52,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv8= GUICtrlCreateButton("",104,52,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv9= GUICtrlCreateButton("",156,52,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv10= GUICtrlCreateButton("",208,52,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv11= GUICtrlCreateButton("",1,104,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv12= GUICtrlCreateButton("",52,104,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv13= GUICtrlCreateButton("",104,104,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv14= GUICtrlCreateButton("",156,104,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv15= GUICtrlCreateButton("",208,104,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv16= GUICtrlCreateButton("",1,156,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv17= GUICtrlCreateButton("",52,156,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv18= GUICtrlCreateButton("",104,156,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv19= GUICtrlCreateButton("",156,156,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv20= GUICtrlCreateButton("",208,156,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv21= GUICtrlCreateButton("",1,208,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv22= GUICtrlCreateButton("",52,208,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv23= GUICtrlCreateButton("",104,208,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv24= GUICtrlCreateButton("",156,208,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv25= GUICtrlCreateButton("",208,208,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv26= GUICtrlCreateButton("",1,260,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv27= GUICtrlCreateButton("",52,260,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv28= GUICtrlCreateButton("",104,260,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv29= GUICtrlCreateButton("",156,260,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv30= GUICtrlCreateButton("",208,260,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv31= GUICtrlCreateButton("",1,312,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv32= GUICtrlCreateButton("",52,312,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv33= GUICtrlCreateButton("",104,312,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv34= GUICtrlCreateButton("",156,312,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv35= GUICtrlCreateButton("",208,312,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv36= GUICtrlCreateButton("",1,364,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv37= GUICtrlCreateButton("",52,364,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv38= GUICtrlCreateButton("",104,364,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv39= GUICtrlCreateButton("",156,364,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv40= GUICtrlCreateButton("",208,364,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv41= GUICtrlCreateButton("",1,418,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv42= GUICtrlCreateButton("",52,418,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv43= GUICtrlCreateButton("",104,418,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv44= GUICtrlCreateButton("",156,418,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv45= GUICtrlCreateButton("",208,418,50,50,$BS_ICON,$GUI_DROPACCEPTED)
GUISetBkColor(0x2A3FAA, $inv)
GUISetState(@SW_HIDE,$inv)

$equip = GUICreate("Equiped Items", 368, 498, 50, 50, $WS_BORDER, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_ACCEPTFILES))
$equip1= GUICtrlCreateButton("",312,1,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip2= GUICtrlCreateButton("",312,52,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip3= GUICtrlCreateButton("",260,1,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip4= GUICtrlCreateButton("",260,52,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip5= GUICtrlCreateButton("",260,104,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip6= GUICtrlCreateButton("",260,156,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip7= GUICtrlCreateButton("",260,208,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip8= GUICtrlCreateButton("",260,260,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip9= GUICtrlCreateButton("",260,312,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip10= GUICtrlCreateButton("",260,364,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip11= GUICtrlCreateButton("",1,52,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip12= GUICtrlCreateButton("",1,208,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip13= GUICtrlCreateButton("",52,1,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip14= GUICtrlCreateButton("",52,52,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip15= GUICtrlCreateButton("",52,104,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip16= GUICtrlCreateButton("",52,156,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip17= GUICtrlCreateButton("",52,208,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip18= GUICtrlCreateButton("",52,260,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip19= GUICtrlCreateButton("",52,312,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip20= GUICtrlCreateButton("",52,416,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip21= GUICtrlCreateButton("",156,416,50,50,$BS_ICON,$GUI_DROPACCEPTED)
GUISetBkColor(0x2A3FAA, $equip)
GUISetState(@SW_HIDE,$equip)

$loot = GUICreate("Loot", 260, 72, 50, 50, $WS_BORDER, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_ACCEPTFILES))
$loot1= GUICtrlCreateButton("",1,1,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$loot2= GUICtrlCreateButton("",52,1,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$loot3= GUICtrlCreateButton("",104,1,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$loot4= GUICtrlCreateButton("",156,1,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$loot5= GUICtrlCreateButton("",208,1,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
GUISetBkColor(0x2A3FAA, $loot)
GUISetState(@SW_HIDE,$loot)

While 1
If _IsPressed("49",$dll) Then ;i for inventory
    $duh=WinGetState($inv)
    Sleep(100)
    If $duh=5 Then
    GUISetState(@SW_SHOW,$inv)
    ElseIf $duh=15 Or $duh=7 Then
    GUISetState(@SW_HIDE,$inv)
    EndIf
EndIf

If _IsPressed("45",$dll) Then ;e for equipment
    $duh=WinGetState($equip)
    Sleep(100)
    If $duh=5 Then
    GUISetState(@SW_SHOW,$equip)
    ElseIf $duh=15 Or $duh=7 Then
    GUISetState(@SW_HIDE,$equip)
    EndIf
EndIf
If _IsPressed("1B",$dll) Then
    DllClose($dll)
    exit(1)
EndIf
If _IsPressed("4C",$dll) Then ;l for loot
    $duh=WinGetState($loot)
    Sleep(100)
    If $duh=5 Then
        GUISetState(@SW_SHOW,$loot)
        ;MsgBox(0,"loot1",$loot1)
        ;MsgBox(0,"loot2",$loot2)
        ;MsgBox(0,"loot3",$loot3)
        ;MsgBox(0,"loot4",$loot4)
        ;MsgBox(0,"loot5",$loot5)
        $lootitem=68
        While $lootitem<74
        $lootitem+=1
        $item=Random ( 1, 6, 1 )
        ;MsgBox(0,"",$item)
        $getitem=IniRead("C:\Program Files\Terisi\data\ltable.ini","loot",$item,"")
        ;MsgBox(0,"",$getitem)
        ;MsgBox(0,"","$loot"&$lootitem)
        GUICtrlSetImage($lootitem,"C:\Program Files\Terisi"&$getitem)
        ;MsgBox(0,"",$getitem)
    WEnd
        MsgBox(0,"loot1",$loot1)
        MsgBox(0,"loot2",$loot2)
        MsgBox(0,"loot3",$loot3)
        MsgBox(0,"loot4",$loot4)
        MsgBox(0,"loot5",$loot5)

    ElseIf $duh=15 Or $duh=7 Then
    GUISetState(@SW_HIDE,$loot)
    EndIf
EndIf
WEnd

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I started looking into gdi+ as that seemed it might have more flexability. But I can't even get a file loaded :D

#include <GUIConstantsEx.au3>
#Include <Misc.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GDIPlus.au3>

$dll=DllOpen("user32.dll")
_GDIPlus_Startup ()
;$parent=GUICreate("")
;GUISetState(@SW_HIDE,$parent)
$inv = GUICreate("Inventory", 262, 496, 50, 50, $WS_BORDER, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_ACCEPTFILES))

GUISetBkColor(0x2A3FAA, $inv)
GUISetState(@SW_HIDE,$inv)

$equip = GUICreate("Equiped Items", 368, 498, 50, 50, $WS_BORDER, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_ACCEPTFILES))

GUISetBkColor(0x2A3FAA, $equip)
GUISetState(@SW_HIDE,$equip)

$loot = GUICreate("Loot", 260, 72, 50, 50, $WS_BORDER, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_ACCEPTFILES))

GUISetBkColor(0x2A3FAA, $loot)
GUISetState(@SW_HIDE,$loot)

While 1
If _IsPressed("49",$dll) Then ;i for inventory
    $duh=WinGetState($inv)
    Sleep(100)
    If $duh=5 Then
    GUISetState(@SW_SHOW,$inv)
    ElseIf $duh=15 Or $duh=7 Then
    GUISetState(@SW_HIDE,$inv)
    EndIf
EndIf

If _IsPressed("45",$dll) Then ;e for equipment
    $duh=WinGetState($equip)
    Sleep(100)
    If $duh=5 Then
    GUISetState(@SW_SHOW,$equip)
    ElseIf $duh=15 Or $duh=7 Then
    GUISetState(@SW_HIDE,$equip)
    EndIf
EndIf
If _IsPressed("1B",$dll) Then
    DllClose($dll)
    exit(1)
EndIf
If _IsPressed("4C",$dll) Then ;l for loot
    $duh=WinGetState($loot)
    Sleep(100)
    If $duh=5 Then
        GUISetState(@SW_SHOW,$loot)
        $lootitem=0
        $spot=1
        While $lootitem<6
        $lootitem+=1
        $item=Random ( 1, 6, 1 )
        $getitem=IniRead("C:\Program Files\Terisi\data\ltable.ini","loot",$item,"")
        $litem=_GDIPlus_ImageLoadFromFile("C:\Program Files\Terisi"&$getitem)
        _GDIPlus_GraphicsDrawImage ($loot,$litem, $spot, 1)
        MsgBox(0,"",$litem)
        $spot+=50
    WEnd

    ElseIf $duh=15 Or $duh=7 Then
    GUISetState(@SW_HIDE,$loot)
    EndIf
EndIf
WEnd

the ini is set up as follows:

[loot]
1=\data\icon1.bmp
2=\data\icon2.bmp
3=\data\icon3.bmp
4=\data\icon4.bmp
5=\data\icon5.bmp
6=\data\icon1.bmp

I guess what is happening is gdi+ is loading the image to ram, then how am I supposed to get it to the gui if all that is returned is a hex value and not a path as I was expecting?

and the helpfile stinks with it's remarks on the drawimage command

Remarks

None.

and there is no explanation to what the values are for in ()...

_GDIPlus_GraphicsDrawImage($hGraphics, $hImage, $iX, $iY)

Parameters

$hGraphics Handle to a Graphics object

$hImage Handle to an Image object

to me image and graphic are the same thing. and in the example they create 2 images and write one on top the other. I don't want to do that.

**edit**

I found something on the forums that fixed that problem with images not being drawn.

I made this change in my loop:

$loot1=_GDIPlus_GraphicsCreateFromHWND($loot)
        _GDIPlus_GraphicsDrawImage ($loot1,$litem, $spot, 1)

and now the images draw.

Now I am assuming that the program will hold the handles of all the images drawn in memory until dumped? or do they get dumped right away?

if they hold in memory, then I could probably create an array of image handles... I wonder if gdi+ can draw on a button then I can know exactly which handle is in which position...

Edited by kaotkbliss

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

Hi there.

You've got lots of questions, I'm not sure where to start.

If you draw something with GDI it exists until disposed of. So will have a memory leak if you keep drawing things and never disposing of them. Why don't you take a look at my custom buttons example in my signature. There are lots of examples there.

Picea

Share this post


Link to post
Share on other sites

I don't really want to use buttons, I want to be able to drag icons from one gui to another with each icon having some sort of identifier with it so every time the program is run and icons change, the same effect happens with specific icons.

This is obviously for a game I have been working on (with a lot of help from bogQ :D )

I am really new to autoit and don't know many of the functions and commands yet so I try to use what I have learned and I know there are better and easier ways to do things. I just don't know where to start with them so I hope to find some dirrection.


010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

example 1

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /prod /AU3Check /in "C:\Documents and Settings\Shawn\Desktop\buttons.au3"
+>21:16:00 Starting AutoIt3Wrapper v.2.0.0.3    Environment(Language:0409  Keyboard:00000409  OS:WIN_XP/Service Pack 3  CPU:X64 OS:X86)
>Running AU3Check (1.54.19.0)  from:C:\Program Files\AutoIt3
C:\Program Files\AutoIt3\Include\GUICtrlSetOnHover_UDF.au3(15,107) : ERROR: Opt() called with illegal argument 1: "OnExitFunc"
Global $__GUICtrl_SetOnHover_sOriginal_OnExitFunc   = Opt("OnExitFunc", "__GUICtrl_SetOnHover_OnAutoItExit")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Program Files\AutoIt3\Include\shapedcontrols_udf.au3(21,67) : WARNING: $avgcol: possibly used before declaration.
        If $hstate = 0 Then $fontcol = _InvertColor("0x" & $avgcol)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Shawn\Desktop\buttons.au3 - 1 error(s), 1 warning(s)
!>21:16:00 AU3Check ended.rc:2
+>21:16:00 AutoIt3Wrapper Finished
>Exit code: 0    Time: 0.434

:D

example 2

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /prod /AU3Check /in "C:\Documents and Settings\Shawn\Desktop\buttons2.au3"
+>21:16:38 Starting AutoIt3Wrapper v.2.0.0.3    Environment(Language:0409  Keyboard:00000409  OS:WIN_XP/Service Pack 3  CPU:X64 OS:X86)
>Running AU3Check (1.54.19.0)  from:C:\Program Files\AutoIt3
C:\Program Files\AutoIt3\Include\GUICtrlSetOnHover_UDF.au3(15,107) : ERROR: Opt() called with illegal argument 1: "OnExitFunc"
Global $__GUICtrl_SetOnHover_sOriginal_OnExitFunc   = Opt("OnExitFunc", "__GUICtrl_SetOnHover_OnAutoItExit")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Program Files\AutoIt3\Include\shapedcontrols_udf.au3(21,67) : WARNING: $avgcol: possibly used before declaration.
        If $hstate = 0 Then $fontcol = _InvertColor("0x" & $avgcol)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Shawn\Desktop\buttons2.au3 - 1 error(s), 1 warning(s)
!>21:16:38 AU3Check ended.rc:2
+>21:16:38 AutoIt3Wrapper Finished
>Exit code: 0    Time: 0.546
Edited by kaotkbliss

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

Ok, let's start with the first step,

what would be the best image format for what I want to do icon or bitmap?

and what would be the best method of simulating this,

images on buttons in a gui, or straight images in a gui?


010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

I know this thread has gotten a bit muddled and confusing, so if we could just start with the post right above this, that would be great. Any help?


010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

Ok, back to bmp's on buttons...

after doing this:

If _IsPressed("4C",$dll) Then ;l for loot
    $duh=WinGetState($loot)
    Sleep(100)
    If $duh=5 Then
        GUISetState(@SW_SHOW,$loot)
        $lootitem=68
        While $lootitem<74
        $lootitem+=1
        $item=Random ( 1, 6, 1 )
        $getitem=IniRead("E:\Shawns Stuff\Terisi_PF\data\ltable.ini","loot",$item,"")
        GUICtrlSetImage($lootitem,"E:\Shawns Stuff\Terisi_PF"&$getitem)
    WEnd

5 random images pathed from a table in .ini file are skinned over the 5 buttons.

how would I get what image is displayed on specific buttons when clicked?

I tried:

$msg=GUIGetMsg()

If $msg=$loot1 Then
    $loota=GUICtrlRead($loot1)
    MsgBox(0,"",$loota)
    EndIf
If $msg=$loot2 Then
        $lootb=GUICtrlRead($loot2)
    MsgBox(0,"",$lootb)
    EndIf
If $msg=$loot3 Then
        $lootc=GUICtrlRead($loot3)
    MsgBox(0,"",$lootc)
    EndIf
If $msg=$loot4 Then
        $lootd=GUICtrlRead($loot4)
    MsgBox(0,"",$lootd)
    EndIf
If $msg=$loot5 Then
        $loote=GUICtrlRead($loot5)
    MsgBox(0,"",$loote)
    EndIf

($loot1 to $loot5 are my button names) and all the msgboxes just return empty result.


010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

judging by the overwhelming responses I don't know if I will get any help on this. The latest update is, I think I should have code that works, but it doesn't.

the random images at start work, but when clicking another button on the equipment window, the image does not get set to the button. Also the images on the loot buttons do not get updated when they are clicked either.

(I know the data is being transfered because I first only used the setdata and ctrlread before adding the setimage command)

#include <GUIConstantsEx.au3>
#Include <Misc.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GDIPlus.au3>
$loota=""
$dll=DllOpen("user32.dll")
_GDIPlus_Startup ()
;$parent=GUICreate("")
;GUISetState(@SW_HIDE,$parent)
$inv = GUICreate("Inventory", 262, 496, 50, 50, $WS_BORDER, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_ACCEPTFILES))
$inv1= GUICtrlCreateButton("",1,1,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv2= GUICtrlCreateButton("",52,1,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv3= GUICtrlCreateButton("",104,1,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv4= GUICtrlCreateButton("",156,1,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv5= GUICtrlCreateButton("",208,1,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv6= GUICtrlCreateButton("",1,52,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv7= GUICtrlCreateButton("",52,52,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv8= GUICtrlCreateButton("",104,52,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv9= GUICtrlCreateButton("",156,52,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv10= GUICtrlCreateButton("",208,52,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv11= GUICtrlCreateButton("",1,104,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv12= GUICtrlCreateButton("",52,104,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv13= GUICtrlCreateButton("",104,104,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv14= GUICtrlCreateButton("",156,104,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv15= GUICtrlCreateButton("",208,104,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv16= GUICtrlCreateButton("",1,156,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv17= GUICtrlCreateButton("",52,156,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv18= GUICtrlCreateButton("",104,156,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv19= GUICtrlCreateButton("",156,156,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv20= GUICtrlCreateButton("",208,156,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv21= GUICtrlCreateButton("",1,208,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv22= GUICtrlCreateButton("",52,208,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv23= GUICtrlCreateButton("",104,208,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv24= GUICtrlCreateButton("",156,208,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv25= GUICtrlCreateButton("",208,208,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv26= GUICtrlCreateButton("",1,260,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv27= GUICtrlCreateButton("",52,260,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv28= GUICtrlCreateButton("",104,260,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv29= GUICtrlCreateButton("",156,260,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv30= GUICtrlCreateButton("",208,260,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv31= GUICtrlCreateButton("",1,312,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv32= GUICtrlCreateButton("",52,312,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv33= GUICtrlCreateButton("",104,312,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv34= GUICtrlCreateButton("",156,312,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv35= GUICtrlCreateButton("",208,312,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv36= GUICtrlCreateButton("",1,364,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv37= GUICtrlCreateButton("",52,364,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv38= GUICtrlCreateButton("",104,364,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv39= GUICtrlCreateButton("",156,364,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv40= GUICtrlCreateButton("",208,364,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv41= GUICtrlCreateButton("",1,418,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv42= GUICtrlCreateButton("",52,418,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv43= GUICtrlCreateButton("",104,418,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv44= GUICtrlCreateButton("",156,418,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$inv45= GUICtrlCreateButton("",208,418,50,50,$BS_ICON,$GUI_DROPACCEPTED)

GUISetBkColor(0x2A3FAA, $inv)
GUISetState(@SW_HIDE,$inv)

$equip = GUICreate("Equiped Items", 368, 498, 50, 50, $WS_BORDER, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_ACCEPTFILES))
$equip1= GUICtrlCreateButton("",312,1,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip2= GUICtrlCreateButton("",312,52,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip3= GUICtrlCreateButton("",260,1,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip4= GUICtrlCreateButton("",260,52,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip5= GUICtrlCreateButton("",260,104,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip6= GUICtrlCreateButton("",260,156,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip7= GUICtrlCreateButton("",260,208,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip8= GUICtrlCreateButton("",260,260,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip9= GUICtrlCreateButton("",260,312,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip10= GUICtrlCreateButton("",260,364,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip11= GUICtrlCreateButton("",1,52,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip12= GUICtrlCreateButton("",1,208,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip13= GUICtrlCreateButton("",52,1,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip14= GUICtrlCreateButton("",52,52,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip15= GUICtrlCreateButton("",52,104,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip16= GUICtrlCreateButton("",52,156,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip17= GUICtrlCreateButton("",52,208,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip18= GUICtrlCreateButton("",52,260,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip19= GUICtrlCreateButton("",52,312,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip20= GUICtrlCreateButton("",52,416,50,50,$BS_ICON,$GUI_DROPACCEPTED)
$equip21= GUICtrlCreateButton("",156,416,50,50,$BS_ICON,$GUI_DROPACCEPTED)

GUISetBkColor(0x2A3FAA, $equip)
GUISetState(@SW_HIDE,$equip)

$loot = GUICreate("Loot", 260, 72, 50, 50, $WS_BORDER, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_ACCEPTFILES))
$loot1= GUICtrlCreateButton("",1,1,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$loot2= GUICtrlCreateButton("",52,1,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$loot3= GUICtrlCreateButton("",104,1,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$loot4= GUICtrlCreateButton("",156,1,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)
$loot5= GUICtrlCreateButton("",208,1,50,50,$BS_BITMAP,$GUI_DROPACCEPTED)

GUISetBkColor(0x2A3FAA, $loot)
GUISetState(@SW_HIDE,$loot)

While 1
    $msg=GUIGetMsg()

If $msg=$loot1 Then
    Switch $loota
    Case $loota=""
    $loota=GUICtrlRead($loot1)
    GUICtrlSetData($loot1,"")
    GUICtrlSetImage($loot1,"")
EndSwitch
EndIf
If $msg=$loot2 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($loot2)
        GUICtrlSetData($loot2,"")
    GUICtrlSetImage($loot2,"")
EndSwitch
    EndIf
If $msg=$loot3 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($loot3)
        GUICtrlSetData($loot3,"")
    GUICtrlSetImage($loot3,"")
EndSwitch
    EndIf
If $msg=$loot4 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($loot4)
        GUICtrlSetData($loot4,"")
    GUICtrlSetImage($loot4,"")
EndSwitch
    EndIf
If $msg=$loot5 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($loot5)
        GUICtrlSetData($loot5,"")
    GUICtrlSetImage($loot5,"")
EndSwitch
    EndIf

If $msg=$equip1 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($equip1)
        GUICtrlSetData($equip1,"")
        GUICtrlSetImage($equip1,"")
    Case $loota<>""
        GUICtrlSetData($equip1,$loota)
        GUICtrlSetImage($equip1,"E:\Shawns Stuff\Terisi_PF"&$loota)
        $loota=""
    EndSwitch
    EndIf
If $msg=$equip2 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($equip2)
        GUICtrlSetData($equip2,"")
        GUICtrlSetImage($equip2,"")
    Case $loota<>""
    GUICtrlSetData($equip2,$loota)
    GUICtrlSetImage($equip2,"E:\Shawns Stuff\Terisi_PF"&$loota)
    $loota=""
EndSwitch
    EndIf
If $msg=$equip3 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($equip3)
        GUICtrlSetData($equip3,"")
        GUICtrlSetImage($equip3,"")
    Case $loota<>""
    GUICtrlSetData($equip3,$loota)
    GUICtrlSetImage($equip3,"E:\Shawns Stuff\Terisi_PF"&$loota)
    $loota=""
EndSwitch
    EndIf
If $msg=$equip4 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($equip4)
        GUICtrlSetData($equip4,"")
        GUICtrlSetImage($equip4,"")
    Case $loota<>""
    GUICtrlSetData($equip4,$loota)
    GUICtrlSetImage($equip4,"E:\Shawns Stuff\Terisi_PF"&$loota)
    $loota=""
EndSwitch
    EndIf
If $msg=$equip5 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($equip5)
        GUICtrlSetData($equip5,"")
        GUICtrlSetImage($equip5,"")
    Case $loota<>""
    GUICtrlSetData($equip5,$loota)
    GUICtrlSetImage($equip5,"E:\Shawns Stuff\Terisi_PF"&$loota)
    $loota=""
EndSwitch
    EndIf
If $msg=$equip6 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($equip6)
        GUICtrlSetData($equip6,"")
        GUICtrlSetImage($equip6,"")
    Case $loota<>""
    GUICtrlSetData($equip6,$loota)
    GUICtrlSetImage($equip6,"E:\Shawns Stuff\Terisi_PF"&$loota)
    $loota=""
EndSwitch
    EndIf
If $msg=$equip7 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($equip7)
        GUICtrlSetData($equip7,"")
        GUICtrlSetImage($equip7,"")
    Case $loota<>""
    GUICtrlSetData($equip7,$loota)
    GUICtrlSetImage($equip7,"E:\Shawns Stuff\Terisi_PF"&$loota)
    $loota=""
EndSwitch
    EndIf
If $msg=$equip8 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($equip8)
        GUICtrlSetData($equip8,"")
        GUICtrlSetImage($equip8,"")
    Case $loota<>""
    GUICtrlSetData($equip8,$loota)
    GUICtrlSetImage($equip8,"E:\Shawns Stuff\Terisi_PF"&$loota)
    $loota=""
EndSwitch
    EndIf
If $msg=$equip9 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($equip9)
        GUICtrlSetData($equip9,"")
        GUICtrlSetImage($equip9,"")
    Case $loota<>""
    GUICtrlSetData($equip9,$loota)
    GUICtrlSetImage($equip9,"E:\Shawns Stuff\Terisi_PF"&$loota)
    $loota=""
EndSwitch
    EndIf
If $msg=$equip10 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($equip10)
        GUICtrlSetData($equip10,"")
        GUICtrlSetImage($equip10,"")
    Case $loota<>""
    GUICtrlSetData($equip10,$loota)
    GUICtrlSetImage($equip10,"E:\Shawns Stuff\Terisi_PF"&$loota)
    $loota=""
EndSwitch
    EndIf
If $msg=$equip11 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($equip11)
        GUICtrlSetData($equip11,"")
        GUICtrlSetImage($equip11,"")
    Case $loota<>""
    GUICtrlSetData($equip11,$loota)
    GUICtrlSetImage($equip11,"E:\Shawns Stuff\Terisi_PF"&$loota)
    $loota=""
EndSwitch
    EndIf
If $msg=$equip12 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($equip12)
        GUICtrlSetData($equip12,"")
        GUICtrlSetImage($equip12,"")
    Case $loota<>""
    GUICtrlSetData($equip12,$loota)
    GUICtrlSetImage($equip12,"E:\Shawns Stuff\Terisi_PF"&$loota)
    $loota=""
EndSwitch
    EndIf
If $msg=$equip13 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($equip13)
        GUICtrlSetData($equip13,"")
        GUICtrlSetImage($equip13,"")
    Case $loota<>""
    GUICtrlSetData($equip13,$loota)
    GUICtrlSetImage($equip13,"E:\Shawns Stuff\Terisi_PF"&$loota)
    $loota=""
EndSwitch
    EndIf
If $msg=$equip14 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($equip14)
        GUICtrlSetData($equip14,"")
        GUICtrlSetImage($equip14,"")
    Case $loota<>""
    GUICtrlSetData($equip14,$loota)
    GUICtrlSetImage($equip14,"E:\Shawns Stuff\Terisi_PF"&$loota)
    $loota=""
EndSwitch
    EndIf
If $msg=$equip15 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($equip15)
        GUICtrlSetData($equip15,"")
        GUICtrlSetImage($equip15,"")
    Case $loota<>""
    GUICtrlSetData($equip15,$loota)
    GUICtrlSetImage($equip15,"E:\Shawns Stuff\Terisi_PF"&$loota)
    $loota=""
EndSwitch
    EndIf
If $msg=$equip16 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($equip16)
        GUICtrlSetData($equip16,"")
        GUICtrlSetImage($equip16,"")
    Case $loota<>""
    GUICtrlSetData($equip16,$loota)
    GUICtrlSetImage($equip16,"E:\Shawns Stuff\Terisi_PF"&$loota)
    $loota=""
EndSwitch
    EndIf
If $msg=$equip17 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($equip17)
        GUICtrlSetData($equip17,"")
        GUICtrlSetImage($equip17,"")
    Case $loota<>""
    GUICtrlSetData($equip17,$loota)
    GUICtrlSetImage($equip17,"E:\Shawns Stuff\Terisi_PF"&$loota)
    $loota=""
EndSwitch
    EndIf
If $msg=$equip18 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($equip18)
        GUICtrlSetData($equip18,"")
        GUICtrlSetImage($equip18,"")
    Case $loota<>""
    GUICtrlSetData($equip18,$loota)
    GUICtrlSetImage($equip18,"E:\Shawns Stuff\Terisi_PF"&$loota)
    $loota=""
EndSwitch
    EndIf
If $msg=$equip19 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($equip19)
        GUICtrlSetData($equip19,"")
        GUICtrlSetImage($equip19,"")
    Case $loota<>""
    GUICtrlSetData($equip19,$loota)
    GUICtrlSetImage($equip19,"E:\Shawns Stuff\Terisi_PF"&$loota)
    $loota=""
EndSwitch
    EndIf
If $msg=$equip20 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($equip20)
        GUICtrlSetData($equip20,"")
        GUICtrlSetImage($equip20,"")
    Case $loota<>""
    GUICtrlSetData($equip20,$loota)
    GUICtrlSetImage($equip20,"E:\Shawns Stuff\Terisi_PF"&$loota)
    $loota=""
EndSwitch
    EndIf
If $msg=$equip21 Then
    Switch $loota
    Case $loota=""
        $loota=GUICtrlRead($equip21)
        GUICtrlSetData($equip21,"")
        GUICtrlSetImage($equip21,"")
    Case $loota<>""
    GUICtrlSetData($equip21,$loota)
    GUICtrlSetImage($equip21,"E:\Shawns Stuff\Terisi_PF"&$loota)
    $loota=""
EndSwitch
    EndIf

If _IsPressed("49",$dll) Then ;i for inventory
    $duh=WinGetState($inv)
    Sleep(100)
    If $duh=5 Then
    GUISetState(@SW_SHOW,$inv)
    ElseIf $duh=15 Or $duh=7 Then
    GUISetState(@SW_HIDE,$inv)
    EndIf
EndIf

If _IsPressed("45",$dll) Then ;e for equipment
    $duh=WinGetState($equip)
    Sleep(100)
    If $duh=5 Then
    GUISetState(@SW_SHOW,$equip)
    ElseIf $duh=15 Or $duh=7 Then
    GUISetState(@SW_HIDE,$equip)
    EndIf
EndIf
If _IsPressed("1B",$dll) Then
    DllClose($dll)
    exit(1)
EndIf
If _IsPressed("4C",$dll) Then ;l for loot
    $duh=WinGetState($loot)
    Switch $duh
    Case $duh=5
        GUISetState(@SW_SHOW,$loot)
        $lootitem=68
        While $lootitem<74
        $lootitem+=1
        $item=Random ( 1, 6, 1 )
        $getitem=IniRead("E:\Shawns Stuff\Terisi_PF\data\ltable.ini","loot",$item,"")
        GUICtrlSetData($lootitem,$getitem)
        GUICtrlSetImage($lootitem,"E:\Shawns Stuff\Terisi_PF"&$getitem)
    WEnd

    Case $duh=15 Or $duh=7
    GUISetState(@SW_HIDE,$loot)
    EndSwitch
EndIf
WEnd

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

hey, another update on my progress...

I changed all the switches to selects

and changed this:

If $msg=$loot1 Then
    Switch $loota
    Case $loota=""
    $loota=GUICtrlRead($loot1)
    GUICtrlSetData($loot1,"")
    GUICtrlSetImage($loot1,"")
EndSwitch
EndIf

to this:

If $msg=$loot1 Then
    Select
    Case $loota=""
    $loota=GUICtrlRead($loot1)
    $getitem=IniRead("H:\Shawns_Stuff\Terisi_PF\data\ltable.ini","loot",6,"")
    GUICtrlSetData(69,$getitem)
    GUICtrlSetImage(69,"H:\Shawns_Stuff\Terisi_PF"&$getitem)
EndSelect
EndIf

(6 is a blank entry in the ini)

now what happens is sometimes (if I click slowly enough from loot window to equipment window) the image will be added to the button in the equipment window. But only if I click real slow and wait a few seconds between clicks.

what doesn't happen is the image is not erased from the original button and if I click from 1 to another fast it doesn't move the image.


010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

ok, so apparently the only way to remove an image set on a Gui control is to use a "blank" image... maybe in the future a GuiCtrlRemoveImage?


010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

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