Open Side Menu Go to the Top
Register
help writing script to position extended chat window at FTP help writing script to position extended chat window at FTP

02-23-2008 , 04:55 PM
I recently posted this as a suggestion in the FTS thread:

Quote:
Whenever I open a table, I always click the extended chat, move it to the right edge of the table, and drag it so it's the same height as the table. I then click the button to close the extended chat. I use the extended chat when I want to quickly see past action/chat, so I like to have it ready. This is obv a huge hassle while 12-tabling though. If you could add a feature that saved the positioning of the extended chat, that would be amazing.
nanochip responded:

Quote:
I'd feel guilty taking any money for this
Tell you what... start another thread in the software forum saying you looking for help in writing a script to do this. Download and install autohotkey from autohotkey.com. You can use notepad as your editor. Try testing out a couple of the examples in the tutorial in the help section of Autohotkey.

then try this code to get you started (which should move the chat window to pixel location 50,50 on your screen when F1 is pressed). Post or Email me the thread link and I'll help out, and I'm guessing dave will help too. you'll get this running pretty quickly.
nano

F1::
IfWinExist Chat:
{
WinMove, Chat:, ,50,50
}
return
I've read through the AutoHotkey Tutorial (quick start).

The above code from nanochip works (obv). What I need to do now is figure out how to move it to the right edge of each table, rather than to specific coordinates on my screen. I also need to figure out how to make it the same height as the table (my tables are always the same size). I use a table that is 632 pixels wide, I'd like the chat to be about half as wide so 316 pixels should work. I used AutoIt3 Window Spy to find the height which is 464.

I have no idea how to tell it coordinates relative to the individual table.

For setting the height and width, I guess it's something like:

WinMove, Chat:

and then I use "Width, Height" somehow (I'm on the WinMove page in the help)? So 316, 464? Do I do Width= or what?

Any help would be greatly appreciated.
help writing script to position extended chat window at FTP Quote
02-23-2008 , 05:26 PM
Quote:
Originally Posted by a nonymous
I have no idea how to tell it coordinates relative to the individual table.
I'm new to scripting but I thing you should use WinGetPos :-)
help writing script to position extended chat window at FTP Quote
02-23-2008 , 06:20 PM
heres a script that does half of what you want.

--------------------------------------
#Persistent
#SingleInstance Ignore
#NoEnv

HHWindowTitle = Webcam ; identify window substring
interval = 5000 ; period between refreshes
heighth = 310
width = 345

Loop
{
HHIDList()
Sleep %interval%
}


HHIDList()
{
local rlist, this_id, wide,xer,yer
SetTitleMatchMode 2

WinGet, rlist, LIST, %HHWindowTitle%
Loop %rlist%
{
this_id := rlist%a_index%

; WinGetPos [, X, Y, Width, Height, WinTitle, WinText, ExcludeTitle, ExcludeText]
WinGetPos,xer,yer,wide,, ahk_id%this_id%
if (%wide% = width)
{
continue
}
; WinMove, WinTitle, WinText, X, Y , Width, Height
;WinMove, ahk_id%this_id%,, (a_index-1)*width , 0 , width, heighth
WinMove, ahk_id%this_id%,, xer , yer , width, heighth
}
return wide
}
help writing script to position extended chat window at FTP Quote
02-23-2008 , 11:57 PM
F1::
IfWinExist Chat:
{
WinMove, Chat:, ,50,50
}
return

Is it possible to have it do this without the F1 button and without having to manually detach the chat box- ie, you open a table with the script running and the chat box removes itself and moves to certain coordinates?
help writing script to position extended chat window at FTP Quote
02-24-2008 , 04:08 AM
Quote:
Originally Posted by a nonymous

The above code from nanochip works (obv). What I need to do now is figure out how to move it to the right edge of each table, rather than to specific coordinates on my screen. I also need to figure out how to make it the same height as the table (my tables are always the same size). I use a table that is 632 pixels wide, I'd like the chat to be about half as wide so 316 pixels should work. I used AutoIt3 Window Spy to find the height which is 464.

I have no idea how to tell it coordinates relative to the individual table.

For setting the height and width, I guess it's something like:

WinMove, Chat:

and then I use "Width, Height" somehow (I'm on the WinMove page in the help)? So 316, 464? Do I do Width= or what?

Any help would be greatly appreciated.
You can use WinGetPos to get the postion of your Chat window...

WinGetPos, x, y, , ,Chat:

If Full Tilt always brings this chat window to the same position relative to the table, then you can just move it to the right by enough to get it to the edge. Lets say that you need to move it 130 pixels to the right, and you want the width to be 316 and the height to be 350 pixels, then...


x := x + 130 ; calculate the new X value

WinMove, Chat:,, x,y,316,350 ; move chat and change the width and height

Note that if you are not using a parameter, just put don't put anything inbetween the 2 commas.

nanochip
help writing script to position extended chat window at FTP Quote
02-26-2008 , 02:35 AM
Quote:
Originally Posted by PLOlover
heres a script that does half of what you want.

--------------------------------------
#Persistent
#SingleInstance Ignore
#NoEnv

HHWindowTitle = Webcam ; identify window substring
interval = 5000 ; period between refreshes
heighth = 310
width = 345

Loop
{
HHIDList()
Sleep %interval%
}


HHIDList()
{
local rlist, this_id, wide,xer,yer
SetTitleMatchMode 2

WinGet, rlist, LIST, %HHWindowTitle%
Loop %rlist%
{
this_id := rlist%a_index%

; WinGetPos [, X, Y, Width, Height, WinTitle, WinText, ExcludeTitle, ExcludeText]
WinGetPos,xer,yer,wide,, ahk_id%this_id%
if (%wide% = width)
{
continue
}
; WinMove, WinTitle, WinText, X, Y , Width, Height
;WinMove, ahk_id%this_id%,, (a_index-1)*width , 0 , width, heighth
WinMove, ahk_id%this_id%,, xer , yer , width, heighth
}
return wide
}
What exactly does this do?
help writing script to position extended chat window at FTP Quote
02-26-2008 , 02:36 AM
Quote:
Originally Posted by nanochip
You can use WinGetPos to get the postion of your Chat window...

WinGetPos, x, y, , ,Chat:

If Full Tilt always brings this chat window to the same position relative to the table, then you can just move it to the right by enough to get it to the edge. Lets say that you need to move it 130 pixels to the right, and you want the width to be 316 and the height to be 350 pixels, then...


x := x + 130 ; calculate the new X value

WinMove, Chat:,, x,y,316,350 ; move chat and change the width and height

Note that if you are not using a parameter, just put don't put anything inbetween the 2 commas.

nanochip
FTP doesn't always bring the chat window to the same position relative to the table for me.
help writing script to position extended chat window at FTP Quote
02-26-2008 , 03:02 AM
Quote:
Originally Posted by a nonymous
FTP doesn't always bring the chat window to the same position relative to the table for me.

try something like this... here's an outline of a program that will click the chat button on the active table, and move the chat box. You'll need to fill in some of the pieces.

F1::
id := winactive("A") ; get the windows id of the active table
wingetpos, tableX, tableY, tableW, tableH, ahk_id%id% ; get the pos of table
; use window spy to get the position of the + to open chat, fill in ???,???
MouseClick,Left,???,??? ; open the chat box
X := tableX + tableW
Y := tableY
WinMove, Chat:,,X,Y,???,??? ; move chat box, set w and h ???,???
return

nanochip
help writing script to position extended chat window at FTP Quote
02-26-2008 , 03:58 AM
Quote:
Originally Posted by nanochip
try something like this... here's an outline of a program that will click the chat button on the active table, and move the chat box. You'll need to fill in some of the pieces.

F1::
id := winactive("A") ; get the windows id of the active table
wingetpos, tableX, tableY, tableW, tableH, ahk_id%id% ; get the pos of table
; use window spy to get the position of the + to open chat, fill in ???,???
MouseClick,Left,???,??? ; open the chat box
X := tableX + tableW
Y := tableY
WinMove, Chat:,,X,Y,???,??? ; move chat box, set w and h ???,???
return

nanochip
might also need a pause (sleep, 500) or winwaitactive before the WinMove
help writing script to position extended chat window at FTP Quote
02-26-2008 , 04:13 PM
Quote:
Originally Posted by a nonymous
What exactly does this do?
just change the window title for what you want and change the height width and it will resize all the windows to that size. have to move them yourself though.
help writing script to position extended chat window at FTP Quote
02-26-2008 , 04:36 PM
Quote:
Originally Posted by PLOlover
just change the window title for what you want and change the height width and it will resize all the windows to that size. have to move them yourself though.
Cool, ty.
help writing script to position extended chat window at FTP Quote
02-26-2008 , 05:01 PM
Ok, so using nanochip's code, it seems to be working:

;
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
; Author: A.N.Other <myemail@nowhere.com>
;
; Script Function:
; Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
F1::
id := winactive("A") ; get the windows id of the active table
wingetpos, tableX, tableY, tableW, tableH, ahk_id%id% ; get the pos of table
; use window spy to get the position of the + to open chat, fill in ???,???
MouseClick,Left,226,449 ; open the chat box
X := tableX + tableW
Y := tableY
WinMove, Chat:,,X,Y,340,464 ; move chat box, set w and h ???,???
return

This is amazing. I'm going to play my first session with it in an hour, will post if I have trouble.

Thanks, everyone! PLOlover, your script worked perfectly also, but it seems nanochip's does everything I need.
help writing script to position extended chat window at FTP Quote
02-26-2008 , 05:05 PM
I tried to change it to "c" instead of "F1", it wouldn't work. I guess F1 is better since it's not a commonly used key too. When I tried it with c and then typed c in Firefox, it moved my mouse. The reason I wanted to use something other than F1 is that I thought I remembered F1 being one of the keys used to control the avatar's emotions on FTP. I'll make it F12 for now.
help writing script to position extended chat window at FTP Quote
02-27-2008 , 12:30 AM
Played a session with it. Works great. Thanks again everyone, especially nanochip.

nanochip, one last question. You said "might also need a pause (sleep, 500) or winwaitactive before the WinMove" - if it's working, should I worry about this?
help writing script to position extended chat window at FTP Quote
03-04-2008 , 03:17 AM
Quote:
Originally Posted by a nonymous
Played a session with it. Works great. Thanks again everyone, especially nanochip.

nanochip, one last question. You said "might also need a pause (sleep, 500) or winwaitactive before the WinMove" - if it's working, should I worry about this?
yw

should be ok without it... I was just concerned the software might be too fast, and try to move it before the chat window was open.
help writing script to position extended chat window at FTP Quote
03-05-2008 , 05:08 PM
Code:
#Persistent
#NoEnv


F1::
IfWinExist Seat Available
{
    WinMove, 1900,873
}
return
Im trying to move the waitlist dialog at Full Tilt to another monitor and this is what I got so far [I really have no idea what Im doing].

This will move the window when I press F1, but only the first window [all of the waitlist dialogs have the same title "Seat Available"]. Also, I would prefer to have it do this automatically and I played around with the code a bit but could only get it to do it when I first launched the script and not while it was already running.

Basically, my question is this, how can I edit this basic code to automatically [or close to it] move all wait list dialogs to that specific spot on my desktop?

Thanks in advance, and I hope this isnt too much of a hijack
help writing script to position extended chat window at FTP Quote
07-09-2009 , 12:54 AM
the recent FT update broke my script

can anyone help?

Code:
;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:         A.N.Other <myemail@nowhere.com>
;
; Script Function:
;	Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
F11::
id := winactive("A") ; get the windows id of the active table
wingetpos, tableX, tableY, tableW, tableH, ahk_id%id% ; get the pos of table
; use window spy to get the position of the + to open chat, fill in ???,???
MouseClick,Left,260,506 ; open the chat box
X := tableX + tableW
Y := tableY
WinMove, Chat:,,X,Y,340,523 ; move chat box, set w and h ???,???
return
help writing script to position extended chat window at FTP Quote
07-09-2009 , 08:17 PM
nevermind, looks like PlaceMint is going to work for this, will post again if I find out it won't

ty
help writing script to position extended chat window at FTP Quote

      
m