 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
[¤GoO¤]
Joined: 22 Feb 2005 Posts: 60 Location: Sweden
|
Posted: Sat Apr 16, 2005 3:15 pm Post subject: "Magic" tooltip chasing mouse! |
|
|
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.
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?!
| 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?!!  _________________ "Make everything as simple as possible, but not simpler."
- Albert Einstein (1879-1955) |
|
| Back to top |
|
 |
niwi
Joined: 27 Feb 2005 Posts: 128 Location: Heidelberg, Germany
|
Posted: Sat Apr 16, 2005 3:37 pm Post subject: |
|
|
Hi,
I haven't used this coordmode yet, but your tooltip follows my mouse, too...
NiWi. |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2436
|
Posted: Sat Apr 16, 2005 4:17 pm Post subject: |
|
|
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 |
|
 |
niwi
Joined: 27 Feb 2005 Posts: 128 Location: Heidelberg, Germany
|
Posted: Sat Apr 16, 2005 4:22 pm Post subject: |
|
|
Hi,
I still forgetting the percent sign to cover variables...
NiWi. |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2436
|
Posted: Sun Apr 17, 2005 2:58 pm Post subject: Re: "Magic" tooltip chasing mouse! |
|
|
| [¤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
| 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 |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5390 Location: /b/
|
Posted: Sun Apr 17, 2005 4:37 pm Post subject: |
|
|
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 |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2436
|
Posted: Sun Apr 17, 2005 5:39 pm Post subject: |
|
|
| Titan wrote: | | Here's a different version that's more simpler and gets the job done | That's cool too 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 |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5390 Location: /b/
|
Posted: Sun Apr 17, 2005 7:46 pm Post subject: |
|
|
| 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  _________________
 |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2436
|
Posted: Mon Apr 18, 2005 3:10 am Post subject: |
|
|
slowly getting sleepy, sleeeeepy...
| 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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|