Sign in to follow this  
Followers 0
wander

Need help with my autoit script

6 posts in this topic

#1 ·  Posted (edited)

Hello,I am new in AutoIt,so i need help with my script

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

#Region ### START Koda GUI section ### Form=c:\documents and settings\administrator\desktop\characterguide.kxf
$CharacterGuide = GUICreate("CharacterGuide", 633, 447, 200, 112)
GUISetIcon("C:\Documents and Settings\Administrator\Desktop\start.ico")
$Archer = GUICtrlCreateButton("Archer", 0, 288, 122, 26, 0)
GUICtrlSetBkColor(-1, 0xFFFF00)
$Glavier = GUICtrlCreateButton("Glavier", 152, 288, 99, 25, 0)
GUICtrlSetBkColor(-1, 0x0000FF)
$NukerWithSpear = GUICtrlCreateButton("NukerWithSpear", 288, 288, 99, 25, 0)
GUICtrlSetBkColor(-1, 0x008000)
$NukerWithSwordAndShield = GUICtrlCreateButton("NukerWithSwordAndShield", 448, 288, 139, 25, 0)
GUICtrlSetBkColor(-1, 0xFF0000)
GUICtrlCreateLabel("", 0, 0, 4, 4)
$Pic3 = GUICtrlCreatePic("D:\Silkroad Online Character Guide\Data\Picture\Spear.jpg", 288, 328, 100, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Pic4 = GUICtrlCreatePic("D:\Silkroad Online Character Guide\Data\Picture\Glavie.jpg", 152, 328, 100, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Pic5 = GUICtrlCreatePic("D:\Silkroad Online Character Guide\Data\Picture\Sword.jpg", 432, 320, 68, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Pic6 = GUICtrlCreatePic("D:\Silkroad Online Character Guide\Data\Picture\Shield.jpg", 496, 320, 84, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Pic2 = GUICtrlCreatePic("D:\Silkroad Online Character Guide\Data\Picture\Bow.jpg", 8, 328, 100, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS), $WS_EX_CLIENTEDGE)
$Button1 = GUICtrlCreateButton("Button1", 176, 384, 9, 1, 0)
$Pic1 = GUICtrlCreatePic("D:\Silkroad Online Character Guide\Data\Picture\Main Picture.jpg", 0, 0, 628, 284, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Select
        Case $GUI_EVENT_CLOSE
        
    EndSelect
WEnd

My first question is how can i make my button- Archer to lead to other window

and my second question is how i can make the picture vissible for all people,either when they don't have the picture

Edited by wander

Share this post


Link to post
Share on other sites



While 1
    $nMsg = GUIGetMsg()
    Select
        Case $GUI_EVENT_CLOSE
Exit
        Case $Archer
;Do something
    
    EndSelect
WEnd

and FileInstall for the pictures should work just fine :)

Share this post


Link to post
Share on other sites

While 1
    $nMsg = GUIGetMsg()
    Select
        Case $GUI_EVENT_CLOSE
Exit
        Case $Archer
;Do something
    
    EndSelect
WEnd

and FileInstall for the pictures should work just fine :)

I tried
While 1
    $nMsg = GUIGetMsg()
    Select
        Case $GUI_EVENT_CLOSE
Exit
        Case $Archer
;GUICreate("Archer Guide", 400, 400, 200, 112)
    
    EndSelect
WEnd

And run it it automaticly closes

Share this post


Link to post
Share on other sites

Here you got

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

#Region ### START Koda GUI section ### Form=c:\documents and settings\administrator\desktop\characterguide.kxf
$CharacterGuide = GUICreate("CharacterGuide", 633, 447, 200, 112)
GUISetIcon("C:\Documents and Settings\Administrator\Desktop\start.ico")
$Archer = GUICtrlCreateButton("Archer", 0, 288, 122, 26, 0)
GUICtrlSetBkColor(-1, 0xFFFF00)
$Glavier = GUICtrlCreateButton("Glavier", 152, 288, 99, 25, 0)
GUICtrlSetBkColor(-1, 0x0000FF)
$NukerWithSpear = GUICtrlCreateButton("NukerWithSpear", 288, 288, 99, 25, 0)
GUICtrlSetBkColor(-1, 0x008000)
$NukerWithSwordAndShield = GUICtrlCreateButton("NukerWithSwordAndShield", 448, 288, 139, 25, 0)
GUICtrlSetBkColor(-1, 0xFF0000)
GUICtrlCreateLabel("", 0, 0, 4, 4)
$Pic3 = GUICtrlCreatePic("D:\Silkroad Online Character Guide\Data\Picture\Spear.jpg", 288, 328, 100, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Pic4 = GUICtrlCreatePic("D:\Silkroad Online Character Guide\Data\Picture\Glavie.jpg", 152, 328, 100, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Pic5 = GUICtrlCreatePic("D:\Silkroad Online Character Guide\Data\Picture\Sword.jpg", 432, 320, 68, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Pic6 = GUICtrlCreatePic("D:\Silkroad Online Character Guide\Data\Picture\Shield.jpg", 496, 320, 84, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Pic2 = GUICtrlCreatePic("D:\Silkroad Online Character Guide\Data\Picture\Bow.jpg", 8, 328, 100, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS), $WS_EX_CLIENTEDGE)
$Button1 = GUICtrlCreateButton("Button1", 176, 384, 9, 1, 0)
$Pic1 = GUICtrlCreatePic("D:\Silkroad Online Character Guide\Data\Picture\Main Picture.jpg", 0, 0, 628, 284, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
    $nMsg = GUIGetMsg()
    Select
    Case $nMsg = $GUI_EVENT_CLOSE
        Exit
    Case $nMsg = $Archer 
        MsgBox(0, "", "hello world :) ")
    EndSelect
WEnd

Share this post


Link to post
Share on other sites

Thank You verry much.Now i just need to deal with the picture thing :) so everyone who use it to can see them

Share this post


Link to post
Share on other sites

Try something like this, compile your script and anyone should be able to see the pictures.

FileInstall("D:\Silkroad Online Character Guide\Data\Picture\Spear.jpg", @TempDir & "\Spear.jpg") 
GUICtrlCreatePic(@TempDir & "\Spear.jpg", 288, 328, 100, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))

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