hixxa321

I have an issue

7 posts in this topic

#1 ·  Posted

Hello, i'm new in AutoIt so i don't know some (most of) things, and i have an issue 

GUICtrlSetData($PotworHP, $PotworHP - 200)
                GUICtrlSetData($MP, $MP - 150)

$PotworHP is a value that is not always same, sometimes it can be 200, sometimes 400 or sometimes other number (from GUICtrlCreateLabel)
$MP = 300 (or sometimes less, but not higher) (from GUICtrlCreateLabel)

It's used when button is clicked

And why $MP becomes -136 and $PotworHP becomes -181? It shouldn't :( 

Sorry for my bad English, English isn't my native language :c

Share this post


Link to post
Share on other sites



#2 ·  Posted

You will have to show the whole script for us to understand why thing could go wrong, but my wild guess is that you assume that $mp contains the value of the control and not its handle. To get the value you need to do GuiCtrlRead($mp).

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

you need to write guictrlread($potworHP) when reading whats in the control

GUICtrlSetData($PotworHP, Guictrlread($PotworHP) - 200)
                GUICtrlSetData($MP, Guictrlread($MP) - 150)

 

Sorry Jos, i didn't read your whole message before posting mine xD

Edited by joboy2k

Share this post


Link to post
Share on other sites

#5 ·  Posted

yeah i noticed after i had posted and edited mine to apologise xD

Share this post


Link to post
Share on other sites

#6 ·  Posted

Thank you @joboy2k and @Jos for answer, now it works, i'm using it to make in my "game" skills, -200 for enemy HP, -150 you mana (MP).

Share this post


Link to post
Share on other sites

#7 ·  Posted

2 minutes ago, hixxa321 said:

 i'm using it to make in my "game" skills, -200 for enemy HP, -150 you mana (MP).

Then you better now first read our forum rules with respect to our stands on game automation.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.