Jump to content
Sign in to follow this  
HaxLi

Increase|Decrease the Value & Hotkey

Recommended Posts

HaxLi

Now I have something like this GUI:

;   :::HotKeys:::::
HotKeySet("{UP}", "Increase")
HotKeySet("{DOWN}", "Decrease")

;   :::GUI:::::::::
$r = WinGetClientSize("")       ;How to get a whole Windows Screen size while it only detects the value of directory where Program is held? Maybe someone knows the title of Windows Screen? :]
GuiCreate("AE 09.30", 100, 60, $r[0]-120, 50)       ;It suposed to appear like in upper right corner
GuiCtrlCreateGroup( "By HaxLi", 5, 0, 90, 55)
$c = GUICtrlCreateCombo("",10, 15, 40)      ;Iwant this walue to increase|decrease with {UP}|{DOWN}. maybe I should use GUICtrlCreateList() for this.. anyway I donno how to make a Func..
GUICtrlSetData(-1, "1.0|1.5|2.0|2.5|3.0|3.5", "3.0")        ;Maybe those walues should be set as an $Array?
GUICtrlCreateLabel("Speed", 55, 20, 35)
$l = GUICtrlCreateCheckbox("AutoLoot", 10, 35, 80)      ;I guess you noticed that this is for teh sake of game ;p
GUICtrlSetState($l, $GUI_CHECKED)
GUISetState()

;   :::Funcs:::::::
Func Increase()
    ;;;Something here with $c
EndFunc

Func Decrease()
    ;;;And something here with $c
EndFunc

Well, if someone know how to make this.. Would be nice to see it ^^;

Edited by HaxLi

Share this post


Link to post
Share on other sites
FuryCell

People on this forum are not going to write the script for you. However this should get you started.

;   :::Includes:::::
#Include <GUIConstants.au3>

;   :::HotKeys:::::
HotKeySet("{UP}", "Increase")
HotKeySet("{DOWN}", "Decrease")

;   :::GUI:::::::::
$r = WinGetClientSize("")      ;How to get a whole Windows Screen size while it only detects the value of directory where Program is held? Maybe someone knows the title of Windows Screen? :]
GUICreate("AE 09.30", 100, 60, $r[0] - 120, 50)      ;It suposed to appear like in upper right corner
GUICtrlCreateGroup("By HaxLi", 5, 0, 90, 55)
$c = GUICtrlCreateCombo("", 10, 15, 40)    ;Iwant this walue to increase|decrease with {UP}|{DOWN}. maybe I should use GUICtrlCreateList() for this.. anyway I donno how to make a Func..
GUICtrlSetData(-1, "1.0|1.5|2.0|2.5|3.0|3.5", "3.0")        ;Maybe those walues should be set as an $Array?
GUICtrlCreateLabel("Speed", 55, 20, 35)
$l = GUICtrlCreateCheckbox("AutoLoot", 10, 35, 80)    ;I guess you noticed that this is for teh sake of game ;p
GUICtrlSetState($l, $GUI_CHECKED)
GUISetState()

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case Else
            ;;;;
    EndSwitch
WEnd

Func Increase()
    ;;;Something here with $c
EndFunc   ;==>Increase

Func Decrease()
    ;;;And something here with $c
EndFunc   ;==>Decrease
Edited by SolidSnake

HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

Share this post


Link to post
Share on other sites
HaxLi

Switch $Msg
    Case $GUI_EVENT_CLOSE
        Exit
    Case Else
        ;;;;
EndSwitch
Well I'm trying to make it by my self at the moment, but since I'm not a coder but Designer, I'm not good on those logical thigs. I just want to be sure, that nooe will help me at this.. I need only explanation where and when those arrays are used and what should I start with..

Btw: I'm working with IniRead|Write now.. so just no idea how to start that increasement thing..

Thank you for new code I didn't knew before [switch]. I wonder if it's better than [select]..

Edited by HaxLi

Share this post


Link to post
Share on other sites
PsaltyDS

Now I have something like this GUI:

;   :::HotKeys:::::
HotKeySet("{UP}", "Increase")
HotKeySet("{DOWN}", "Decrease")

;   :::GUI:::::::::
$r = WinGetClientSize("")       ;How to get a whole Windows Screen size while it only detects the value of directory where Program is held? Maybe someone knows the title of Windows Screen? :]
GuiCreate("AE 09.30", 100, 60, $r[0]-120, 50)       ;It suposed to appear like in upper right corner
GuiCtrlCreateGroup( "By HaxLi", 5, 0, 90, 55)
$c = GUICtrlCreateCombo("",10, 15, 40)      ;Iwant this walue to increase|decrease with {UP}|{DOWN}. maybe I should use GUICtrlCreateList() for this.. anyway I donno how to make a Func..
GUICtrlSetData(-1, "1.0|1.5|2.0|2.5|3.0|3.5", "3.0")        ;Maybe those walues should be set as an $Array?
GUICtrlCreateLabel("Speed", 55, 20, 35)
$l = GUICtrlCreateCheckbox("AutoLoot", 10, 35, 80)      ;I guess you noticed that this is for teh sake of game ;p
GUICtrlSetState($l, $GUI_CHECKED)
GUISetState()

;   :::Funcs:::::::
Func Increase()
    ;;;Something here with $c
EndFunc

Func Decrease()
    ;;;And something here with $c
EndFuncoÝ÷ Ùg¥'ì¢g¨é'£hÂÚ&jG­+¢é]méâqëh±ç¢·ú®¢×¢g©®åzk5Ó~P"+'¢×^rV«yÛ¬¹©eÉÚ'y¼¢Énv)àB8ÔÔÒMöMêæv­zȦyصérmçºÇ­êÞÉè)¶z­®éçx7B"²Ú(²f¥ÚÊek&§ÊØb¢{[­ë-iÉví¢y§!¢Ø^¯hÁ¬­¡ìbµ§íz¶v)à)èÚ"uæ°«r¢ìÛhrí®pØT=©ÝåìÚ-)àÇhëh­æj|¨~Ø^rí®]jÖ¢«{ljÜjKhjÙ^jË`÷²¢æP¨¹Æ§ºÇ­¡ìi¨§Â­Ê­ëkÊ)à¶hjëh×6#include <GuiConstants.au3>

;   :::HotKeys:::::
HotKeySet("{UP}", "Increase")
HotKeySet("{DOWN}", "Decrease")

;   :::GUI:::::::::
Global $Speed = 0
GUICreate("AE 09.30", 200, 145, @DesktopWidth - 250, 50)
GUICtrlCreateGroup("By HaxLi", 10, 10, 180, 125)
$Combo = GUICtrlCreateCombo("", 20, 30, 160, 25)
GUICtrlSetData(-1, "1.0|1.5|2.0|2.5|3.0|3.5", "3.0")
$Label = GUICtrlCreateLabel("Speed = " & $Speed, 20, 65, 160, 25)
$ChkBox = GUICtrlCreateCheckbox("AutoLoot", 20, 100, 160, 25)
GUICtrlSetState($ChkBox, $GUI_CHECKED)
GUISetState()

While 1
    If GUIGetMsg() = $GUI_EVENT_CLOSE Then 
        $ComboData = GUICtrlRead($Combo)
        If BitAND($GUI_CHECKED, GUICtrlRead($ChkBox)) Then
            $Check = "Checked"
        Else
            $Check = "Not checked"
        EndIf
        MsgBox(64, "Finished", "On exit..." & @CRLF & _
                @TAB & "Combo data was: " & $ComboData & @CRLF & _
                @TAB & "Speed was: " & $Speed & @CRLF & _
                @TAB & "Checkbox was: " & $Check)
        Exit
    EndIf
    Sleep(20)
WEnd

;   :::Funcs:::::::
Func Increase()
    $Speed += 1
    GUICtrlSetData($Label, "Speed = " & $Speed)
EndFunc   ;==>Increase

Func Decrease()
    $Speed -= 1
    GUICtrlSetData($Label, "Speed = " & $Speed)
EndFunc   ;==>Decrease

Now, what was it you were trying to get your GUI to do? :)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
HaxLi

Thank you alot for wonderful help, You realy helped me. :]

Actualy I posted not full code, bcoz I just wanted to fid a way how to increase that variable. And you showed me the way:

$A += 1   ;actualy I nevere thought that there is such a way to do this O.o
$A -= 1   ;I thought about If's or While's or For's, till I didn't knew this simple +=1 ;poÝ÷ Ø  l¢ØZL¨¹ú+²ì¡×ºÚ"µÍÚÝÜÚYÛXÙKÜÈÚZÝÈHØ[ZÙH^HÛÈ[ÈÚ]È]SÒHÝYÜÈIÌÎNÛ[ÙHÙ]ÛÛYY^KX^XHHH[ÜHÛËÚXÚÛÝ[XZÙHÛÙZ[ÈÜYHÞY

I guess you are not interested about Programs called Boting in games.. And this is for MUonline MMORPG :]

Edited by HaxLi

Share this post


Link to post
Share on other sites
PsaltyDS

Glad it helped. :P

Actualy I posted not full code, bcoz I just wanted to fid a way how to increase that variable.

That's a good thang... when you post to the forum include the smallest code snippet that demonstrates the problem. No need to post the whole script for a problem with one function. Not only that, I've found on several occasions while trying to pull a problem out of a large script and reduce it to a demo script that I can post to whine about it... I have a DOH! moment and see what the problem was. :)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.