Jump to content
Sign in to follow this  
Gillboss

What wrong?

Recommended Posts

Gillboss

look at this:

#include <GUIConstants.au3>

HotKeySet("{F5}", "startbot")
GUICreate("Combo", 540, 540, 100, 100)   
GUICtrlCreateLabel("Primary Skill", 20, 360, 90, 20)
$PSkill = GUICtrlCreateCombo("", 170, 357, 30, 21)
GUICtrlSetData($PSkill, "1|2|3|4|5|6|7|8|9", "1")
GUICtrlCreateLabel("Secondary Skill", 20, 390, 90, 20)
$SSkill = GUICtrlCreateCombo("", 170, 387, 30, 21)
GUICtrlSetData($SSkill, "1|2|3|4|5|6|7|8|9", "2")
GUISetState() 

While 1
    Sleep(1000)
WEnd

Func startbot() 
    $msg = GUIGetMsg()     
    Sleep(2000)    
    Send("Primary = "&$PSkill)
    Sleep(2000)
    Send("{ENTER}")
    Sleep(2000)
    Send("Secondary = "&$SSkill)
    Sleep(2000)    
EndFunc

why, when i open notepad and press F5 the bot write wrong numbers and not what in the set data?

(try to test yourself.. you will understand)

thanks

Share this post


Link to post
Share on other sites
DexterMorgan

look at this:

#include <GUIConstants.au3>

HotKeySet("{F5}", "startbot")
GUICreate("Combo", 540, 540, 100, 100)   
GUICtrlCreateLabel("Primary Skill", 20, 360, 90, 20)
$PSkill = GUICtrlCreateCombo("", 170, 357, 30, 21)
GUICtrlSetData($PSkill, "1|2|3|4|5|6|7|8|9", "1")
GUICtrlCreateLabel("Secondary Skill", 20, 390, 90, 20)
$SSkill = GUICtrlCreateCombo("", 170, 387, 30, 21)
GUICtrlSetData($SSkill, "1|2|3|4|5|6|7|8|9", "2")
GUISetState() 

While 1
    Sleep(1000)
WEnd

Func startbot() 
    $msg = GUIGetMsg()     
    Sleep(2000)    
    Send("Primary = "&$PSkill)
    Sleep(2000)
    Send("{ENTER}")
    Sleep(2000)
    Send("Secondary = "&$SSkill)
    Sleep(2000)    
EndFunc

why, when i open notepad and press F5 the bot write wrong numbers and not what in the set data?

(try to test yourself.. you will understand)

thanks

I didnt try it yet but i thing you need to do GUIctrlread($pSkill) instead of $PSkill

so it would look like this

Send("Primary = "& guictrlread($PSkill))


code

Share this post


Link to post
Share on other sites
monoceres

look at this:

#include <GUIConstants.au3>

HotKeySet("{F5}", "startbot")
GUICreate("Combo", 540, 540, 100, 100)   
GUICtrlCreateLabel("Primary Skill", 20, 360, 90, 20)
$PSkill = GUICtrlCreateCombo("", 170, 357, 30, 21)
GUICtrlSetData($PSkill, "1|2|3|4|5|6|7|8|9", "1")
GUICtrlCreateLabel("Secondary Skill", 20, 390, 90, 20)
$SSkill = GUICtrlCreateCombo("", 170, 387, 30, 21)
GUICtrlSetData($SSkill, "1|2|3|4|5|6|7|8|9", "2")
GUISetState() 

While 1
    Sleep(1000)
WEnd

Func startbot() 
    $msg = GUIGetMsg()     
    Sleep(2000)    
    Send("Primary = "&$PSkill)
    Sleep(2000)
    Send("{ENTER}")
    Sleep(2000)
    Send("Secondary = "&$SSkill)
    Sleep(2000)    
EndFunc

why, when i open notepad and press F5 the bot write wrong numbers and not what in the set data?

(try to test yourself.. you will understand)

thanks

Why are you using GUIGetMsg in your startbot func?

That should be placed in the main loop.

You need to use GUICtrlRead to get the data from the combo, otherwise it's just a control id.

:)


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites
DexterMorgan

we all said it at like the same time lol

We have SKILL


code

Share this post


Link to post
Share on other sites
Gillboss

Why are you using GUIGetMsg in your startbot func?

That should be placed in the main loop.

You need to use GUICtrlRead to get the data from the combo, otherwise it's just a control id.

:)

but i must it for other things... i have radio in the bot too...

and i have hotkeys of start and pause... i must it.. if the user change data after the pause..?

i must GUIGetMsg.

Edited by Gillboss

Share this post


Link to post
Share on other sites
monoceres

but i must it for other things... i have radio in the bot too...

and i have hotkeys of start and pause... i must it.. if the user change data after the pause..?

i must GUIGetMsg.

Read up on OnEventMode instead, because it will look very messy and buggy otherwise. :)

Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites
Gillboss

where read on it..? i dont find it in Helpfile..

Share this post


Link to post
Share on other sites
monoceres

where read on it..? i dont find it in Helpfile..

GUI Reference --> GUI OnEvent Mode

Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites
DexterMorgan

GUICtrlSetOnEvent($controlID,"Func")


code

Share this post


Link to post
Share on other sites
Gillboss

where..? can u send me the source please..?

edit:

ty kkKrazy.. found..GUICtrlSetOnEvent in help file..

more edit..:

why i need it? where insert it?

Edited by Gillboss

Share this post


Link to post
Share on other sites
monoceres

Please study this example:

#include <GUIConstantsEx.au3>
Opt("GUIOnEventMode",1)
GUICreate("Testing OnEvent")
$button=GUICtrlCreateButton("Click me",10,10,100,50)
GUICtrlSetOnEvent($button,"_Buttonclicked")
GUISetOnEvent($GUI_EVENT_CLOSE,"close")
GUISetState()

while 1
    sleep(100)
WEnd

Func close ()
    Exit
EndFunc
Func _Buttonclicked()
    MsgBox(0,"Click","You clicked me!")
EndFunc

Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites
Gillboss

ok i learn and im know it now..

and why it can help me?

Share this post


Link to post
Share on other sites
DexterMorgan

where..? can u send me the source please..?

edit:

ty kkKrazy.. found..GUICtrlSetOnEvent in help file..

more edit..:

why i need it? where insert it?

Your welcome :) Hope your script comes out good!

as for your second edit im too late:(


code

Share this post


Link to post
Share on other sites
monoceres

ok i learn and im know it now..

and why it can help me?

After defining all events you never have to think about them again, do whatever you want in your other functions and your GUI will still be responsive :)


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites
Gillboss

but my bot work with hotkeys..

Share this post


Link to post
Share on other sites
monoceres

but my bot work with hotkeys..

Then why use GUIGetMsg() :)


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites
Gillboss

because it:

Select

Case $msg = $optEeNormal

Case $msg = $optEePower

Case $msg = $optSinPoint

EndSelect

Share this post


Link to post
Share on other sites
monoceres

because it:

Select

Case $msg = $optEeNormal

Case $msg = $optEePower

Case $msg = $optSinPoint

EndSelect

You are reaaaaaally confusing.


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites
Gillboss

well how can i check if the radio checked?

Share this post


Link to post
Share on other sites
monoceres

well how can i check if the radio checked?

Generate events for the checkboxes with GUICtrlSetOnEvent.

Edited by monoceres

Broken link? PM me and I'll send you the file!

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  

×