lopolop Posted January 7, 2006 Share Posted January 7, 2006 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 More sharing options...
Moderators SmOke_N Posted January 7, 2006 Moderators Share Posted January 7, 2006 (edited) 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 January 7, 2006 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 More sharing options...
lopolop Posted January 7, 2006 Author Share Posted January 7, 2006 (edited) 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 January 7, 2006 by lopolop Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 7, 2006 Moderators Share Posted January 7, 2006 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 More sharing options...
lopolop Posted January 7, 2006 Author Share Posted January 7, 2006 im making a bot for a game.. i want it to display the health in a tooltip.. i want it to constantly show the health change.... Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 7, 2006 Moderators Share Posted January 7, 2006 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) WEndP.S... Your While $var < 10 (has a then at the end... I know that wasn't intentional ) 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 More sharing options...
Valuater Posted January 7, 2006 Share Posted January 7, 2006 (edited) 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 January 7, 2006 by Valuater Link to comment Share on other sites More sharing options...
lopolop Posted January 7, 2006 Author Share Posted January 7, 2006 (edited) 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 January 7, 2006 by lopolop Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 7, 2006 Moderators Share Posted January 7, 2006 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 . 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 More sharing options...
lopolop Posted January 8, 2006 Author Share Posted January 8, 2006 (edited) 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 January 8, 2006 by lopolop Link to comment Share on other sites More sharing options...
Jotun Posted January 8, 2006 Share Posted January 8, 2006 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 More sharing options...
lopolop Posted January 8, 2006 Author Share Posted January 8, 2006 i think that might work... ill have to test later because i wen on with my program it'll be a pain to et it up so i can test that Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now