Jump to content

Constant GUI update


Recommended Posts

i am trying to fins something that will constintly update...

meaning like say if i use a tooltip... with variables like Health, Deaths.... when i change the variable in my code it changes in the tooltip...

except tooltip doesnt do that... is there something that does? or some way i can do that?

Link to comment
Share on other sites

  • Moderators

i am trying to fins something that will constintly update...

meaning like say if i use a tooltip... with variables like Health, Deaths.... when i change the variable in my code it changes in the tooltip...

except tooltip doesnt do that... is there something that does? or some way i can do that?

???

Edit:

Thought I would give an example of using multiple Changing variables.

$Count = ''
$Count2 = ''
$Var = ''
While 1
   $Count = $Count + 1
   $Count2 = $Count + $Count2 + 10
   $Var = 4 ^ 2 + $Var
    Sleep(10)
    ToolTip('The number loop you are on: ' & $Count & @CRLF & _ 
    'This is adding 10 to first $Count + last $Count2: ' & $Count2 & @CRLF & _ 
    'This is a Another Var: ' & $Var _ 
    , 0, 0)
    
Wend
Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

but what should i do for this?

Func _tooltip($message)
     ToolTip('The Number: ' & GetNumber() & @CRLF _
     & $message, 0, 0)
EndFunc

Func GetNumber()
$var = 0     
While $var < 10 then
          $var = $var + 1
          Sleep(1000)
     WEnd
Return $Var
EndFunc

_ToolTip("What my script basically does")
While 1
     Sleep(100)
WEnd
Edited by lopolop
Link to comment
Share on other sites

  • Moderators

What are you trying to do exactly?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Ok then you seem real close... did you try sticking the _ToolTip() in the main loop?

Func _tooltip($message)
     ToolTip('The Number: ' & GetNumber() & @CRLF _
     & $message, 0, 0)
EndFunc

Func GetNumber()
$var = 0    
While $var < 10 
          $var = $var + Random(1, 10, 1)
          Sleep(100)
     WEnd
Return $Var
EndFunc


While 1
    _ToolTip("What my script basically does")
     Sleep(100)
WEnd

P.S... Your While $var < 10 (has a then at the end... I know that wasn't intentional :P )

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

maybe this

_tooltip("What my script basically does")



While 1
     Sleep(100)
WEnd


Func _tooltip($message)
    $var = 0
    While $var < 10 
          $var = $var + 1
          ToolTip('The Number: ' & $var & @CRLF & $message, 0, 0)
          Sleep(1000)
    WEnd
    ToolTip("")  
EndFunc

8)

EDIT

Ron Rules... First.............lol

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

yah sorry about the then...

but thats the thing.. i want to change the $message when different tasks are performing... like

Loading...

Attacking

or anything that could inform you..

if its in a loop it will goto what ever the change is and right back...

i guess i dont need the $message though.. because it is a bot...

Edited by lopolop
Link to comment
Share on other sites

  • Moderators

Well you could always give a 'special' variable for the _ToolTip() function, you'll need to change here in there in your script, but if it isn't 10,000+ lines, I'm sure it's not big deal :P.

After every main variable that you would want to pass, you could do something like:

Dim $MyToolTip = ''

If $Character1 = 'Abcd' Then
    $MyToolTip = 'Character One is This Value: ' & $Character1
    _ToolTip($MyToolTip)
ElseIf $Character2 = 'Zyxw' Then
    $MyToolTip = 'Character Two is This Value: ' & $Character2
    _ToolTip($MyToolTip)
Else
    $MyToolTip = 'Nothing Happening'
    _ToolTip($MyToolTip)
EndIf

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

can i have 2 loops running at the same time? y dont i have my main loop for the bot... then a loop that every second creates a tool tip...

ok nevermind.. lol u cant make 2 tooltips can you?

i was gonna say just make a nother tool tip above it with the information that was going on...

Edited by lopolop
Link to comment
Share on other sites

Maybe this is similar to what you want to do:

Global $Message, $Count, $Health, $Deaths

AdlibEnable("ShowTTip", 100)

While 1
    $Message = "Attacking"
    $Health = Random(1, 100, 1)
    $Deaths = $Deaths + 1
    Sleep(500)
    $Message = "Defending"
    Sleep(500)
WEnd

Func ShowTTip()
    ToolTip($Message & @CRLF & _
        "Random numbers: " & GetNumber() & @CRLF & _
        "Health: " & $Health & @CRLF & _
        "Deaths: " & $Deaths, 0, 0)
EndFunc

Func GetNumber()
    $Count = 0
    While $Count < 10
        $Count = $Count + Random(1, 10, 1)
        Sleep(10)
    WEnd
    Return $Count
EndFunc
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...