AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

"Magic" tooltip chasing mouse!

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
[¤GoO¤]



Joined: 22 Feb 2005
Posts: 60
Location: Sweden

PostPosted: Sat Apr 16, 2005 3:15 pm    Post subject: "Magic" tooltip chasing mouse! Reply with quote

I just experienced the strangest thing:

When I was creating this script that lets (or is supposed to) a tool "swing" around horizontally on the screen. But the thing is that it started to follow the mouse. Shocked
If I moved the mouse down on the screen, it slided after the mouse, still swinging. I don't know why it does that. I mean, i've inserted the line:
Code:

coordmode, tooltip, Screen

so the tootip should stay in position horizontally no matter what happens...
What have I done?! Shocked

Code:

#Persistent
coordmode, tooltip, Screen
loop
{
B_Index = A_Index
loop, 640
{
gosub WatchTool
sleep 20
}
}
return

WatchTool:
ToolTip, Watch!, (cos(A_Index) *500) + 500, B_Index - 20
return


cos(x)
{
transform, cos, cos, % x / 100
return cos
}

Try and see. Is it doin' it to you too? Or is my computer cursed?!! Smile
_________________
"Make everything as simple as possible, but not simpler."
- Albert Einstein (1879-1955)
Back to top
View user's profile Send private message Visit poster's website
niwi



Joined: 27 Feb 2005
Posts: 128
Location: Heidelberg, Germany

PostPosted: Sat Apr 16, 2005 3:37 pm    Post subject: Reply with quote

Hi,

I haven't used this coordmode yet, but your tooltip follows my mouse, too...

NiWi.
Back to top
View user's profile Send private message
corrupt



Joined: 29 Dec 2004
Posts: 2436

PostPosted: Sat Apr 16, 2005 4:17 pm    Post subject: Reply with quote

Try this:
Code:
#Persistent
coordmode, tooltip, Screen
loop
{
B_Index = A_Index
loop, 640
{
gosub WatchTool
sleep 20
}
}
return

WatchTool:
B_Index -= 20
ToolTip, %B_Index%, ((cos(A_Index) *500) + 500), %B_Index%
return


cos(x)
{
transform, cos, cos, % x / 100
return cos
}
Back to top
View user's profile Send private message Visit poster's website
niwi



Joined: 27 Feb 2005
Posts: 128
Location: Heidelberg, Germany

PostPosted: Sat Apr 16, 2005 4:22 pm    Post subject: Reply with quote

Hi,

I still forgetting the percent sign to cover variables... Sad

NiWi.
Back to top
View user's profile Send private message
corrupt



Joined: 29 Dec 2004
Posts: 2436

PostPosted: Sun Apr 17, 2005 2:58 pm    Post subject: Re: "Magic" tooltip chasing mouse! Reply with quote

[¤GoO¤] wrote:

so the tootip should stay in position horizontally no matter what happens...

After taking a second look... neat pendulum of death type effect Smile
Code:
#Persistent
coordmode, tooltip, Screen
loop
{
B_Index := A_Index
loop, 640
{
gosub WatchTool
sleep 20
}
}
return

WatchTool:
ToolTip, %B_Index%, ((cos(A_Index) *500) + 500), % B_Index - 20
return


cos(x)
{
transform, cos, cos, % x / 100
return cos
}
Back to top
View user's profile Send private message Visit poster's website
Titan



Joined: 11 Aug 2004
Posts: 5390
Location: /b/

PostPosted: Sun Apr 17, 2005 4:37 pm    Post subject: Reply with quote

Here's a different version that's more simpler and gets the job done:
Code:
SetBatchLines -1
#Persistent
coordmode, tooltip, Screen
WatchTool:
Loop, %A_ScreenWidth%
{
   sw++
   ToolTip, Watch!, %sw%, 0
}
Loop, %A_ScreenWidth%
{
   sw--
   ToolTip, Watch!, %sw%, 0
}
Goto, WatchTool
Return
Esc::exitapp

_________________

Back to top
View user's profile Send private message Visit poster's website
corrupt



Joined: 29 Dec 2004
Posts: 2436

PostPosted: Sun Apr 17, 2005 5:39 pm    Post subject: Reply with quote

Titan wrote:
Here's a different version that's more simpler and gets the job done
That's cool too Smile but it doesn't have the swing effect (slow down and speed up and the edges) and also doesn't slowly start moving down the screen after 20 times across.
Back to top
View user's profile Send private message Visit poster's website
Titan



Joined: 11 Aug 2004
Posts: 5390
Location: /b/

PostPosted: Sun Apr 17, 2005 7:46 pm    Post subject: Reply with quote

corrupt wrote:
doesn't slowly start moving down the screen after 20 times across.

Well yeah but I said it was more basic. You can put "y += 5" before each closing loop brace to make it move down. The swing thing was hardly noticeable Confused
_________________

Back to top
View user's profile Send private message Visit poster's website
corrupt



Joined: 29 Dec 2004
Posts: 2436

PostPosted: Mon Apr 18, 2005 3:10 am    Post subject: Reply with quote

slowly getting sleepy, sleeeeepy... Laughing

Code:
#Persistent
coordmode, tooltip, Screen
loop
{
  if A_Index < 20
    B_Index := 0
  else
    B_Index := (A_Index - 20)
  loop, 640
  {
    gosub WatchTool
    sleep 10
  }
}
return
 
WatchTool:
test := (320 - (cos2(A_Index) *320))
ToolTip, O, ((cos(A_Index) *500) + 500), % test + B_Index
return


cos(x)
{
  transform, cos, cos, % x / 100
  return cos
}

cos2(y)
{
  transform, cos2, cos, % y / 50.55
  return cos2
}
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group