focksie Posted July 30, 2010 Share Posted July 30, 2010 I'm trying to get a tooltip to scroll up and down the screen for an infinite amount of time this is what I have so far: $var_1 = 0+1 Do ToolTip( "Testy Text", 1200, $var_1, "Testy Text") Sleep( 200 ) Until GUIGetMsg () (This example shows only the descending motion of the tooltip window since the "Until" statement makes it descend forever.) I'm sure that I don't have a high enough understanding of the declaration of variables to get what I want to happen. Does anyone else have a better idea? Link to comment Share on other sites More sharing options...
JohnOne Posted July 30, 2010 Share Posted July 30, 2010 This example does nothing at all, infact it errors out. for better help please provide a runable script. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
DicatoroftheUSA Posted July 30, 2010 Share Posted July 30, 2010 I'm trying to get a tooltip to scroll up and down the screen for an infinite amount of time this is what I have so far: $var_1 = 0+1 Do ToolTip( "Testy Text", 1200, $var_1, "Testy Text") Sleep( 200 ) Until GUIGetMsg () (This example shows only the descending motion of the tooltip window since the "Until" statement makes it descend forever.) I'm sure that I don't have a high enough understanding of the declaration of variables to get what I want to happen. Does anyone else have a better idea? $x=0+1 is always equal to 1 I think what you are looking for is $x+=1 Statism is violence, Taxation is theft. Autoit Wiki Link to comment Share on other sites More sharing options...
taietel Posted July 31, 2010 Share Posted July 31, 2010 (edited) I'm sure that I don't have a high enough understanding of the declaration of variables to get what I want to happen. Does anyone else have a better idea? I wonder why the help file of Autoit is used for? (The answer to this might be THE answer to your questions) And now the answer to your problem: #include <GUIConstantsEx.au3> HotKeySet("{ESC}","_Exit") _Tool() Func _Tool() Local $state = 1;down While 1 Sleep(10) Switch $state Case 1 For $i=1 To @DesktopHeight ToolTip("Here I Go Down...", @DesktopWidth/2, $i,"Tooltip") If $i = @DesktopHeight Then ExitLoop $state = 0;up Next Case 0 For $i = @DesktopHeight To 1 Step -1 ToolTip("Here I Go Up...", @DesktopWidth/2, $i,"Tooltip") If $i = 1 Then ExitLoop $state = 1;up Next EndSwitch Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd EndFunc Func _Exit() Exit EndFunc M.I. Edited July 31, 2010 by taietel Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
smashly Posted July 31, 2010 Share Posted July 31, 2010 Hi, Sorry it's not helpful. Just for kicks...lol#include <Date.au3> HotKeySet("{ESC}", "_Exit") Global $w = @DesktopWidth - 60, $h = @DesktopHeight - 20, $ex, $ey, $bx, $by While 1 Sleep(10) If $bx >= $w Then $bx = $w $ex = "$bx - 3" ElseIf $bx <= 0 Then $bx = 0 $ex = "$bx + 3" EndIf If $by >= $h Then $by = $h $ey = "$by - 3" ElseIf $by <= 0 Then $by = 0 $ey = "$by + 3" EndIf $bx = Execute($ex) $by = Execute($ey) ToolTip(_NowTime(), $bx, $by) WEnd Func _Exit() Exit EndFunc ;==> Link to comment Share on other sites More sharing options...
Spiff59 Posted July 31, 2010 Share Posted July 31, 2010 Version 2 of zSmashly's script... #include <Date.au3> HotKeySet("{ESC}", "_Exit") Global $w = @DesktopWidth - 60, $h = @DesktopHeight - 20, $ex, $ey, $bx, $by, $xdir = 3, $ydir = 3 While 1 Sleep(10) If $bx > $w Or $bx < 0 Then $xdir *= -1 If $by > $h Or $by < 0 Then $ydir *= -1 $bx += $xdir $by += $ydir ToolTip(_NowTime(), $bx, $by) WEnd Func _Exit() Exit EndFunc ;==> Cut half of it out and it would only move along one axis. Link to comment Share on other sites More sharing options...
JohnOne Posted July 31, 2010 Share Posted July 31, 2010 Slower, crapper, more annoying version3 #include <Date.au3> HotKeySet("{ESC}", "_Exit") Global $w = @DesktopWidth - 60, $h = @DesktopHeight - 20, $ex, $ey, $bx = Random(0,@DesktopWidth,1), $by = Random(0,@DesktopHeight,1), $xdir = 3, $ydir = 3 $dll = DllOpen("Kernel32.dll") While 1 Sleep(10) If $bx > $w Or $bx < 0 Then $xdir *= -1 If $by > $h Or $by < 0 Then $ydir *= -1 $bx += $xdir $by += $ydir ToolTip(_NowTime(), $bx, $by) If IsInt($bx/2) Then DllCall($dll,"int","Beep","int",$bx+100,"int",90) EndIf WEnd Func _Exit() DllClose($dll) Exit EndFunc ;==> AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
dmob Posted July 31, 2010 Share Posted July 31, 2010 Slower, crapper, more annoying version3... but more fun!! Link to comment Share on other sites More sharing options...
focksie Posted August 1, 2010 Author Share Posted August 1, 2010 I wonder why the help file of Autoit is used for? (The answer to this might be THE answer to your questions) And now the answer to your problem: #include <GUIConstantsEx.au3> HotKeySet("{ESC}","_Exit") _Tool() Func _Tool() Local $state = 1;down While 1 Sleep(10) Switch $state Case 1 For $i=1 To @DesktopHeight ToolTip("Here I Go Down...", @DesktopWidth/2, $i,"Tooltip") If $i = @DesktopHeight Then ExitLoop $state = 0;up Next Case 0 For $i = @DesktopHeight To 1 Step -1 ToolTip("Here I Go Up...", @DesktopWidth/2, $i,"Tooltip") If $i = 1 Then ExitLoop $state = 1;up Next EndSwitch Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd EndFunc Func _Exit() Exit EndFunc M.I. I always try to read about things before I ask about them here... the problem is that the help file doesn't really speak in sensible terms, where you guys do! 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