AutoHotkey Community

It is currently May 27th, 2012, 1:16 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: April 6th, 2008, 1:56 pm 
what do i do with the code? like where do i save it? and as what type of file?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 5th, 2008, 1:48 am 
the script is what ive been looking for it runs fine in windows
is their anyway it could run in bf2


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 5th, 2008, 2:57 am 
Offline

Joined: July 15th, 2007, 1:43 am
Posts: 1320
It should, but it wouldn't be to reliable due to screen rotation etc..

_________________
Religion is false. >_>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 12th, 2008, 6:54 am 
Offline

Joined: April 4th, 2008, 7:27 pm
Posts: 24
Location: China
I think your script is quite different from the AutoScriptWrite,but it will
be more useful when it can replay the mouse movement as quickly as
people did,I hope you can get it


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 17th, 2008, 9:21 pm 
---------------------------
lol.ahk
---------------------------
Error at line 61.

Line Text: (xpos<>xpos_old OR ypos<>ypos_old OR Wheel_up OR Wheel_down OR lButt<>Lbutt_old OR mButt<>mButt_old ...
Error: Missing ")"

The program will exit.
---------------------------
OK
---------------------------

????????????

i got latest ahk version


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 17th, 2008, 9:33 pm 
Offline

Joined: July 15th, 2007, 1:43 am
Posts: 1320
Easily fixed:

Code:
;***********************************************
;**                                           **
;**  Mouse movement recorder (MoRe) 0.1       **
;**  based on the idea of AHK script writer   **
;**  written by garath                        **
;**                                           **
;***********************************************

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
#Persistent
CoordMode, Mouse, Screen
SetBatchLines, -1


;*************************************+*********
;**                                           **
;**           F1 Start recording              **
;**           F2 Stop  recording              **
;**           F3 Replay                       **
;**                                           **
;***********************************************


~WheelDown::Wheel_down += A_EventInfo
~Wheelup::Wheel_up += A_EventInfo


f1::
  FileDelete, Mausbewegungen.txt
  Mouse_moves =
  Wheel_up =
  Wheel_down =
  Time_old := A_TickCount
  SetTimer, WatchMouse, Off
  SetTimer, WatchMouse, 10
  SetTimer, WatchMouse, on
Return

f2::
  SetTimer, WatchMouse, Off
  ToolTip
Return

f3::Gosub, replay

Return


;******************************************

WatchMouse:
  Time_Index := A_TickCount - Time_old
  MouseGetPos, xpos, ypos, id, Control
  GetKeyState, lButt, LButton
  GetKeyState, mButt, MButton
  GetKeyState, rButt, RButton
  Mouse_Data = %xpos%|%ypos%|%lButt%|%mButt%|%rButt%|%Wheel_up%|%Wheel_down%|%ID%|%Time_Index%`n
  ToolTip, recording
  If (xpos<>xpos_old OR ypos<>ypos_old OR Wheel_up OR Wheel_down OR lButt<>Lbutt_old OR mButt<>mButt_old OR rButt<>rButt_old)
    {
      FileAppend, %Mouse_data%, Mausbewegungen.txt
      xpos_old  := xpos
      ypos_old  := ypos
      lButt_old := lButt
      mButt_old := mButt
      rButt_old := rButt
      Wheel_up =
      Wheel_down =
    }
Return

;*******************************************

replay:
  FileRead,Mouse_moves, Mausbewegungen.txt
  StringReplace, Mouse_data, Mouse_moves, `n, @, All
  StringSplit, Mouse_data_, Mouse_data , @
  Loop, %Mouse_data_0%
      StringSplit, Mouse_data_%A_Index%_, Mouse_data_%A_Index% ,|
  Data_Index = 1
  Data_Index_old := 1
  id := Mouse_data_1_8
  WinActivate, ahk_id %id%
  Time_old := A_TickCount
  SetTimer, Replaytimer, Off
  SetTimer, Replaytimer, 10
  SetTimer, Replaytimer, on
Return

;********************************************

replaytimer:
  Time_Index := A_TickCount - Time_old
  Mouse_data_%Data_Index%_9 += 0

  If (Time_Index > Mouse_data_%Data_Index%_9)
    {
      MouseMove, Mouse_data_%Data_Index%_1, Mouse_data_%Data_Index%_2
      lButt := Mouse_data_%Data_Index%_3
      mButt := Mouse_data_%Data_Index%_4
      rButt := Mouse_data_%Data_Index%_5
      wheel_up := Mouse_data_%Data_Index%_6
      wheel_down := Mouse_data_%Data_Index%_7

      If (Mouse_data_%Data_Index_old%_3 <> Mouse_data_%Data_Index%_3)
          MouseClick , Left ,,,,, %lButt%
      If (Mouse_data_%Data_Index_old%_4 <> Mouse_data_%Data_Index%_4)
          MouseClick , middle ,,,,, %mButt%
      If (Mouse_data_%Data_Index_old%_5 <> Mouse_data_%Data_Index%_5)
          MouseClick , Right ,,,,, %rButt%
      If (Mouse_data_%Data_Index%_6)
          MouseClick, WheelUp, , , %wheel_up%       
      If (Mouse_data_%Data_Index%_7)
          MouseClick, Wheeldown, , , %wheel_down%       

      Data_Index_old := Data_Index
      Data_Index += 1
      If (Data_Index = Mouse_data_0)
        {
          SetTimer Replaytimer, Off
          Data_Index = 0
        }
    }
;  x := Mouse_data_%Data_Index%_9
;  tooltip %Time_Index%_%A_TickCount% - %Time_old% __%x%

Return

_________________
Religion is false. >_>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 17th, 2008, 10:29 pm 
thanks very much :)


Report this post
Top
  
Reply with quote  
PostPosted: May 18th, 2008, 12:10 pm 
Is it possible to get it to continue a loop indefinably?

I can get it to record and play back my mouse actions which is cool but I have no idea how to edit it so it can just continue running... ?


Report this post
Top
  
Reply with quote  
PostPosted: May 18th, 2008, 12:19 pm 
Medi wrote:
Is it possible to get it to continue a loop indefinably?

I can get it to record and play back my mouse actions which is cool but I have no idea how to edit it so it can just continue running... ?


In addition to that is there a way to edit a pause in there...?

So Get it to:

Move mouse to 503, 479
Left mouse click
Move mouse to 706, 927
left mouse click
Move mouse to 751, 479
left mouse click
Move mouse to 711, 927
Pause 40 seconds
Left mouse click
Pause 40 seconds
Left mouse click
Pause 40 seconds
Left mouse click

etc etc and just have that loop over and over?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 6th, 2008, 3:13 pm 
Offline

Joined: August 6th, 2008, 12:19 pm
Posts: 13
HEY IAN THIS IS A VERY GOOD SCRIPT MATE FOR MOUSE MOVEMENT

but it doesnt work for keys pressing keys and also mate after i record a macro and than play it is there a way to save the macro as .ahk so that i can compile it

mate i have a speacial request can u add

function so that keys to get recorded
and allow for saving a .ahk file please

waiting for your reply soon :D

if u could do this it would really mean alot to me coz i really need the two functions of recording mouse accurately and recording keys and than i want to compile the recording to an exe


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 25th, 2008, 2:22 am 
Offline

Joined: May 31st, 2008, 3:22 pm
Posts: 47
thanks 4Fix Trikster

garath - correct your script or replace with Trikster fix code, thanks


btw, i want tool for record keyboard press/unpress buttons like garath script, but for keyboard buttons, mb anyone got same prog or script?
with open record list. For example HotKeyboard 2.7 may able record mouse and keys, but file with macro not editable :(

huge possibilies for education workin with VirtualDub/Photoshop/SoundForge in realtime, must better than Flash, Avi too small size, need have only that progs. script and maybe voice of eduactor.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 11th, 2010, 3:23 pm 
Offline

Joined: October 27th, 2006, 10:12 am
Posts: 649
It would be cool to have in the same way a Wacom pen movement recorder, e.g. supporting ten "recording slots", then you could select one of those and replay them whenever you want again.

I would use this for "musical applications" where the wacom pen movement is translated into a melody (y-axis moving up and down in a given scale, x-axis changing panorama position), and being able to replay such 10 melodic fragments would be quite nice, original and interesting. I am using Wmidi, if anyone is curious.

Any ideas how this could be done?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 9th, 2010, 3:42 am 
Offline

Joined: August 26th, 2009, 11:15 pm
Posts: 38
Location: Canada
Code:
#NoEnv
SendMode Input
#Persistent
#InstallMousehook
CoordMode, Mouse, screen
SetBatchLines, -1
SetMouseDelay, -1
;
;                                           
;  Mouse movement recorder (MoRe) 0.1       
;  based on the idea of AHK script writer   
;  written by garath                       
;   Given some options to save/replay by r3tr0
;

;
;           F1 Start Recording                               
;           
;           F2 Stop & Save recording
;              just give it a name the extension is automatic
;                                         
;           F3 Double click saved recording 
;              to select & start replay
;           
;           F4 To Reload mouse_recorder     
;                                           
;


~WheelDown::Wheel_down += A_EventInfo
~Wheelup::Wheel_up += A_EventInfo


f1::

  FileDelete, %a_scriptdir%\recording.ini
  Mouse_moves =
  Wheel_up =
  Wheel_down =
  Time_old := A_TickCount
  SetTimer, WatchMouse, Off
  SetTimer, WatchMouse, 10
  SetTimer, WatchMouse, on
Return

f2::
  SetTimer, WatchMouse, Off
  tooltip
Gui, Add, Text,, Save as:
Gui, Add, Edit, vFile
Gui, Add, Button, default, OK
Gui, Show,,
return 
GuiClose:
ButtonOK:
Fileread, last, %a_scriptdir%\recording.ini
GUI, Submit
FileAppend, %last%, %a_scriptdir%\%file%.mr2
Return

f3::Gosub, replay
Return


;******************************************

WatchMouse:
  Time_Index := A_TickCount - Time_old
  MouseGetPos, xpos, ypos, id, Control
  GetKeyState, lButt, LButton
  GetKeyState, mButt, MButton
  GetKeyState, rButt, RButton
  Mouse_Data = %xpos%|%ypos%|%lButt%|%mButt%|%rButt%|%Wheel_up%|%Wheel_down%|%ID%|%Time_Index%`n
  ToolTip, Recording
 
  If (xpos<>xpos_old OR ypos<>ypos_old OR Wheel_up OR Wheel_down OR lButt<>Lbutt_old OR mButt<>mButt_old OR rButt<>rButt_old)
    {
      FileAppend, %Mouse_data%, %a_scriptdir%\recording.ini
      xpos_old  := xpos
      ypos_old  := ypos
      lButt_old := lButt
      mButt_old := mButt
      rButt_old := rButt
      Wheel_up =
      Wheel_down =
    }
Return

;*******************************************

replay:
GUI, 2:Default
Gui, Add, ListView, r20 w700 gMyListView, Name|Size (KB)
Loop, %A_scriptdir%\*.mr2
    LV_Add("", A_LoopFileName, A_LoopFileSizeKB)
LV_ModifyCol() 
LV_ModifyCol(2, "Integer") 
Gui, Show
return

MyListView:
if A_GuiEvent = DoubleClick
{
    LV_GetText(RowText, A_EventInfo)  ; Get the text from the row's first field.
    ToolTip, Closing GUI launching "%RowText%"
GUI, DESTROY   
gosub 2guiclose
    }
return

2GuiClose:
tooltip, %rowtext% now playing.
  FileRead,Mouse_moves, %RowText%
  StringReplace, Mouse_data, Mouse_moves, `n, @, All
  StringSplit, Mouse_data_, Mouse_data , @
  Loop, %Mouse_data_0%
      StringSplit, Mouse_data_%A_Index%_, Mouse_data_%A_Index% ,|
  Data_Index = 1
  Data_Index_old := 1
  id := Mouse_data_1_8
  WinActivate, ahk_id %id%
  Time_old := A_TickCount
  SetTimer, Replaytimer, Off
  SetTimer, Replaytimer, 10
  SetTimer, Replaytimer, on
Return

;********************************************

replaytimer:
  Time_Index := A_TickCount - Time_old
  Mouse_data_%Data_Index%_9 += 0

  If (Time_Index > Mouse_data_%Data_Index%_9)
    {
      MouseMove, Mouse_data_%Data_Index%_1, Mouse_data_%Data_Index%_2
      lButt := Mouse_data_%Data_Index%_3
      mButt := Mouse_data_%Data_Index%_4
      rButt := Mouse_data_%Data_Index%_5
      wheel_up := Mouse_data_%Data_Index%_6
      wheel_down := Mouse_data_%Data_Index%_7

      If (Mouse_data_%Data_Index_old%_3 <> Mouse_data_%Data_Index%_3)
          MouseClick , Left ,,,,, %lButt%
      If (Mouse_data_%Data_Index_old%_4 <> Mouse_data_%Data_Index%_4)
          MouseClick , middle ,,,,, %mButt%
      If (Mouse_data_%Data_Index_old%_5 <> Mouse_data_%Data_Index%_5)
          MouseClick , Right ,,,,, %rButt%
      If (Mouse_data_%Data_Index%_6)
          MouseClick, WheelUp, , , %wheel_up%       
      If (Mouse_data_%Data_Index%_7)
          MouseClick, Wheeldown, , , %wheel_down%       

      Data_Index_old := Data_Index
      Data_Index += 1
      If (Data_Index = Mouse_data_0)
        {
          SetTimer Replaytimer, Off
          Data_Index = 0
          ToolTip,
        }
    }
;  x := Mouse_data_%Data_Index%_9
;  tooltip %Time_Index%_%A_TickCount% - %Time_old% __%x%
Return
F4::reload


I added stuff to it that I needed cause I was tracing stencils and painting drawball, but I kept recording over my shit so I made a few tweaks. Most likely useful for other things then drawball but whats a chantard to do eh ;D

p.s After a recording and the file is saved, you have to reload ( F4 ) to save another recording replay isnt affected but F4 before starting a new recording kapesh!
Just a heads up in case you spend an hour tracing something and then go oh wtf is this shit; like I just did.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 12th, 2010, 3:14 am 
Offline

Joined: January 25th, 2010, 5:37 am
Posts: 18
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.
CoordMode mouse, screen
x = 1
Gui, Font, s11 normal
Gui, Add, ListView, x6 y150 w490 h550 Grid -LV0x10 NoSortHdr NoSort AltSubmit Report gSubListView vVarListView,       X        |     Y     |Left Button |Middle Button |Right Button |Wheel Up |Wheel Down |    Activate Window    |        Time           
Gui, Add, Edit, x56 y40 w70 h20 vrepeat,           ; repeat Time
Gui, Add, Edit, w235 vfiletorun ReadOnly
Gui, Add, Text, x65 y20 w50 h20 , Repeat
Gui, Add, Button, x126 y40 w80 h20 , Ok
Gui, Add, Button, x236 y30 w100 h30 , Load
Gui, Add, Button, x346 y30 w100 h30 , Save
Gui, Add, Button, x295 y65 w100 h30 , Browse
Gui, Add, Button, x5 y65 w50 h30 , Run
Gui, Add, Button, x430 y92 w50 h50 ghotkeyx, Set Hotkey
Gui, Add, Button, x205 y5 w100 h20 ,CLEAR
Gui, Add, Text, x5 y110 w50 h30 , Record
Gui, Add, Hotkey, x57 y108 w80 h20 vrecord ,F1
Gui, Add, Text, x150 y110 w50 h30 , Stop
Gui, Add, Hotkey, x190 y108 w80 h20 vstop ,F2
Gui, Add, Text, x300 y110 w50 h30 , Play
Gui, Add, Hotkey, x340 y108 w80 h20 vplay ,F3
Gui, Show, x422 y3 h700 w500 ,MoRe
Hotkey ,F1 ,gui_start
Hotkey ,F2 ,gui_stop
Hotkey ,F3 ,gui_play
WM_LBUTTONDOWN = 0x0201
OnMessage( WM_LBUTTONDOWN, "HandleMessage" )

WM_RBUTTONDOWN = 0x0204
OnMessage( WM_RBUTTONDOWN, "HandleMessage" )
Return

GuiClose:
ExitApp



ButtonLoad:
FileSelectFile ,loadfilex,,,,*.rec
;###############STRING SPLIT#############
  FileRead,Mouse_moves, %loadfilex%
  StringReplace, Mouse_data, Mouse_moves, `r`n, @, All
  StringSplit, Mouse_data_, Mouse_data , @
  Loop, %Mouse_data_0% ;mouse_data_0 = lines number
  {
      StringSplit, Mouse_data_%A_Index%_, Mouse_data_%A_Index% ,|
      LV_Add(%A_Index%,Mouse_data_%A_Index%_1,Mouse_data_%A_Index%_2,Mouse_data_%A_Index%_3,Mouse_data_%A_Index%_4,Mouse_data_%A_Index%_5,Mouse_data_%A_Index%_6,Mouse_data_%A_Index%_7,Mouse_data_%A_Index%_8,Mouse_data_%A_Index%_9)
       Lv_ModifyCol(1,"Center")
       Lv_ModifyCol(2,"Center")
       Lv_ModifyCol(3,"Center")
       Lv_ModifyCol(4,"Center")
       Lv_ModifyCol(5,"Center")
       Lv_ModifyCol(6,"Center")
       Lv_ModifyCol(7,"Center")
       Lv_ModifyCol(8,"Center")
       Lv_ModifyCol(9,"Center")
  }
;#########################################
Return

ButtonSave:
FileSelectFile ,savefile,S,,,*.rec
IfExist ,%savefile%
   {
      MsgBox 4,Warning, This file already exist do you want to Overwrite it?
}
IfMsgBox Yes
   {
      FileDelete %savefile%
      ControlGet, List, List, %A_Tab%, SysListView321,MoRe
    StringReplace ,List1,List,%A_Tab%,|,All
  StringReplace ,List1,List,%A_Tab%,|,All
  FileAppend %List1%, %savefile%
}
IfMsgBox No
{
   Return
}
Else
{
      FileDelete %savefile%
      ControlGet, List, List, %A_Tab%, SysListView321,MoRe
    StringReplace ,List1,List,%A_Tab%,|,All
  StringReplace ,List1,List,%A_Tab%,|,All
  FileAppend %List1%, %savefile%
  }

Return

ButtonBrowse:
FileSelectFile ,runf,,,,*.rec
GuiControl ,,filetorun,%runf%
Return

ButtonRun:
Gui, submit, nohide
GuiControlGet ,runn,,filetorun
Run %runn%
Return

ButtonOk:
Gui, submit, nohide
  FileRead,Mouse_moves, %loadfilex%
  StringReplace, Mouse_data, Mouse_moves, `r`n, @, All
  StringSplit, Mouse_data_, Mouse_data , @
  FileReadLine ,time_out, %loadfilex%, %Mouse_data_0%
  StringSplit ,time_out_,time_out,|
  repeattimes = %time_out_9%
  Return

ButtonCLEAR:
Reload
Return
hotkeyx:
Gui, submit, nohide
GuiControlGet ,record1,,record
GuiControlGet ,stop1,,stop
GuiControlGet ,play1,,play
Hotkey ,%record1%, gui_start
Hotkey ,%stop1%, gui_stop
Hotkey ,%play1%, gui_play
Return

gui_start:
  Mouse_moves =
  Wheel_up =
  Wheel_down =
  Time_old := A_TickCount
  SetTimer, WatchMouse, Off
  SetTimer, WatchMouse, 10
  SetTimer, WatchMouse, on
Return
gui_stop:
  SetTimer, WatchMouse, Off
  ToolTip
Return
gui_play:
Gosub, replay
WinHide
Return

WatchMouse:
  Time_Index := A_TickCount - Time_old
  MouseGetPos, xpos, ypos
  WinGetActiveTitle , zz
  GetKeyState, lButt, LButton
  GetKeyState, mButt, MButton
  GetKeyState, rButt, RButton
;~   Mouse_Data = %xpos%|%ypos%|%lButt%|%mButt%|%rButt%|%Wheel_up%|%Wheel_down%|%zz%|%Time_Index%`r`n
  ToolTip, recording
  If (xpos<>xpos_old OR ypos<>ypos_old OR Wheel_up OR Wheel_down OR lButt<>Lbutt_old OR mButt<>mButt_old OR rButt<>rButt_old)
    {
      xpos1 = % "xpos"
      ypos1 = % "ypos"
      lButt1 = % "lButt"
      mButt1 = % "mButt"
      Wheel_up1 = % "Wheel_up"
      Wheel_down1 = % "Wheel_down"
      zz1 = % "zz"
      Time_Index1 = % "Time_Index"
     
      LV_Add("",%xpos1%,%ypos1%,%lButt1%,%mButt1%,%rButt1%,%Wheel_up1%,%Wheel_down1%,%zz1%,%Time_Index1%)
      xpos_old  := xpos
      ypos_old  := ypos
      lButt_old := lButt
      mButt_old := mButt
      rButt_old := rButt
      Wheel_up =
      Wheel_down =
    }
       Lv_ModifyCol(1,"Center")
       Lv_ModifyCol(2,"Center")
       Lv_ModifyCol(3,"Center")
       Lv_ModifyCol(4,"Center")
       Lv_ModifyCol(5,"Center")
       Lv_ModifyCol(6,"Center")
       Lv_ModifyCol(7,"Center")
       Lv_ModifyCol(8,"Center")
       Lv_ModifyCol(9,"Center")
Return

replay:
      ControlGet, List, List, %A_Tab%, SysListView321,MoRe
      Loop, Parse, List, |  ; Rows are delimited by linefeeds (`n).
{
    Loop, Parse, A_LoopField, %A_Tab%  ; Fields (columns) in each row are delimited by tabs (A_Tab).
    Listview1 = %List1%
}
FileAppend ,%Listview1%,aaa.txt
StringReplace ,List1,List,%A_Tab%,|,All
  StringReplace, Mouse_data, List1, `n, @, All
  StringSplit, Mouse_data_, Mouse_data , @
  Loop, %Mouse_data_0%
      StringSplit, Mouse_data_%A_Index%_, Mouse_data_%A_Index% ,|
  Data_Index = 1
  Data_Index_old := 1
  title := Mouse_data_1_8
  WinActivate, %title%
  Time_old := A_TickCount
  SetTimer, Replaytimer, Off
  SetTimer, Replaytimer, 10
  SetTimer, Replaytimer, On
Return

;********************************************

replaytimer:
  Time_Index := A_TickCount - Time_old
  Mouse_data_%Data_Index%_9 += 0

  If (Time_Index > Mouse_data_%Data_Index%_9)
    {
      MouseMove, Mouse_data_%Data_Index%_1, Mouse_data_%Data_Index%_2
      lButt := Mouse_data_%Data_Index%_3
      mButt := Mouse_data_%Data_Index%_4
      rButt := Mouse_data_%Data_Index%_5
      wheel_up := Mouse_data_%Data_Index%_6
      wheel_down := Mouse_data_%Data_Index%_7

      If (Mouse_data_%Data_Index_old%_3 <> Mouse_data_%Data_Index%_3)
          MouseClick , Left ,,,,, %lButt%
      If (Mouse_data_%Data_Index_old%_4 <> Mouse_data_%Data_Index%_4)
          MouseClick , middle ,,,,, %mButt%
      If (Mouse_data_%Data_Index_old%_5 <> Mouse_data_%Data_Index%_5)
          MouseClick , Right ,,,,, %rButt%
      If (Mouse_data_%Data_Index%_6)
          MouseClick, WheelUp, , , %wheel_up%       
      If (Mouse_data_%Data_Index%_7)
          MouseClick, Wheeldown, , , %wheel_down%       

      Data_Index_old := Data_Index
      Data_Index += 1
      If (Data_Index = Mouse_data_0)
        {
          SetTimer Replaytimer, Off
          GuiControlGet ,aaaa,,,repeat
          WinShow MoRe
          Data_Index = 0
        }
    }
;  x := Mouse_data_%Data_Index%_9
;  tooltip %Time_Index%_%A_TickCount% - %Time_old% __%x%
Return

HandleMessage( p_w, p_l, p_m, p_hw )
{
   if ( A_GuiControl = "VarListView" )
   {
      VarSetCapacity( htinfo, 20 )

      DllCall( "RtlFillMemory", "uint", &htinfo, "uint", 1, "uchar", p_l & 0xFF )
         DllCall( "RtlFillMemory", "uint", &htinfo+1, "uint", 1, "uchar", ( p_l >> 8 ) & 0xFF )
      DllCall( "RtlFillMemory", "uint", &htinfo+4, "uint", 1, "uchar", ( p_l >> 16 ) & 0xFF )
         DllCall( "RtlFillMemory", "uint", &htinfo+5, "uint", 1, "uchar", ( p_l >> 24 ) & 0xFF )
     
      ; LVM_SUBITEMHITTEST
      SendMessage, 0x1000+57, 0, &htinfo,, ahk_id %p_hw%
      sel_item := ErrorLevel
     
      if ( sel_item = -1 )
         return
     
      ; LVHT_NOWHERE
      if ( *( &htinfo+8 ) & 1 )
         %A_GuiControl%@sel_col = 0
      else
         %A_GuiControl%@sel_col := 1+*( &htinfo+16 )
   }
   ToolTip
}


SubListView:

   if A_GuiEvent in DoubleClick   
   {
            LV_GetText(cel,A_EventInfo,VarListView@sel_col)         ;get text in each col and row
            InputBox ,Cell, Input Value,,,123,103,,,,, %cel%
            content = % "Cell"
;~             ToolTip , Column = %VarListView@sel_col%`, Row = %A_EventInfo%, 10,10
;a eveninfo = row varlistview = col
;Get Text In That Row
        LV_GetText(Text1, A_EventInfo, 1)
        LV_GetText(Text2, A_EventInfo, 2)
        LV_GetText(Text3, A_EventInfo, 3)
        LV_GetText(Text4, A_EventInfo, 4)
        LV_GetText(Text5, A_EventInfo, 5)
        LV_GetText(Text6, A_EventInfo, 6)
        LV_GetText(Text7, A_EventInfo, 7)
        LV_GetText(Text8, A_EventInfo, 8)
        LV_GetText(Text9, A_EventInfo, 9)
        Text11 = % "Text1"
        Text22 = % "Text2"
        Text33 = % "Text3"
        Text44 = % "Text4"
        Text55 = % "Text5"
        Text66 = % "Text6"
        Text77 = % "Text7"
        Text88 = % "Text8"
        Text99 = % "Text9"
If VarListView@sel_col = 1
   {
      Lv_Modify(A_EventInfo,"",%content%)
   }
Else If VarListView@sel_col = 2
   {
      LV_Modify(A_EventInfo,"",%Text11%, %content%)
   }
Else If VarListView@sel_col = 3
   {
      Lv_Modify(A_EventInfo,"",%Text11%, %Text22%, %content%)
   }
Else If VarListView@sel_col = 4
   {
      Lv_Modify(A_EventInfo,"",%Text11%, %Text22%, %Text33%, %content%)
   }
Else If VarListView@sel_col = 5
   {
      Lv_Modify(A_EventInfo,"",%Text11%, %Text22%, %Text33%, %Text44%, %content%)   
   }
Else If VarListView@sel_col = 6
   {
      Lv_Modify(A_EventInfo,"",%Text11%, %Text22%, %Text33%, %Text44%, %Text55%, %content%)
   }
Else If VarListView@sel_col = 7
   {
      Lv_Modify(A_EventInfo,"",%Text11%, %Text22%, %Text33%, %Text44%, %Text55%, %Text66%, %content%)
   }
Else If VarListView@sel_col = 8
   {
      Lv_Modify(A_EventInfo,"",%Text11%, %Text22%, %Text33%, %Text44%, %Text55%, %Text66%, %Text77%, %content%)
   }   
Else If VarListView@sel_col = 9
   {
      Lv_Modify(A_EventInfo,"",%Text11%, %Text22%, %Text33%, %Text44%, %Text55%, %Text66%, %Text77%, %Text88%, %content%)
   }   
   }
Return

Hey guys this is More with Gui you can record play load, edit it on list view etc... it's not perfect so pls...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 15th, 2010, 2:17 am 
Offline

Joined: August 7th, 2010, 10:13 pm
Posts: 4
I'm attempting to modify this script to have sets that can run with separate commands. For example: I'll record the mouse moving from one place to another, clicking and such. Then, it will click in a text box, and then (In the mouse script code) it will run a hotkey that will input text and tabs. Once that is complete, it will run the next set of mouse commands.

As it is, I tried having two instances of the mouse script running, with separate keyboard commands and a separate text file for each. However, if I have both scripts running, the replay is really slow. I'm guessing it has something to do with it always recording the mouse, but only sometimes recording it to the text file?

What I would LOVE is a way to do something like this in code:

Imagine the Send, {MouseCommandSetOne.txt} to be something like
Code:
Send, {MouseCommandSetOne.txt}
Send, {keyboard commands}
Send, {MouseCommandSetTwo.txt}
Return


Code:
;Mental flow, sudo code (Because I took a C++ class two years ago!)
Keyboard commands:
F1, record set one
F2, stop recording set one
F3, playback set one

F4, record set two
F5, stop recording set two
F6, playback set two




The idea is simple, to be able to integrate running separate sets of mouse commands, implementing the recording functions, without the graphical interface. The graphical interface is great for having a great many sets of mouse records, but bad at being able to run separate records quickly. I'm just not really good at editing code this deep, I've never really worked with Ahk scripts before this.

Um, another way to put it is this; To integrate the mouse script here into a sort of function like they have in C++.
Code:
//C++
mouseCommand(a, command)
{
record mouse in a
switch(command):

case record:
record into a

case replay:
replay from a
}

mouseCommand(runfile.txt, record)

mouseCommand(runfile.txt, replay)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo and 10 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group