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 

My major problem

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
miss-x



Joined: 11 Feb 2005
Posts: 2
Location: Sweden

PostPosted: Tue Feb 22, 2005 9:35 pm    Post subject: My major problem Reply with quote

Hi there I have a major problem and need help : )
I have looked in the forums and solved some of the parts of my script but it wont work out for me at all in the end...
So here is what Iam trying to do
I want the script to push button 1 for ex. 100 times with an intervall of 3,2s
and then change to button 2 and push that 1 100 times with same interval.
that part is easy but the thing is that i want an pause and resume button so if I pause the script it should "see" where in the button 1 loop Iam so i can resume it after 90 pushes and do the 10 that are left and then proceed.

and question 2 is:
if I want to loop a script with push button 1 and button 2 and so on how do i do it i want to change the inverval and the amount of loops it does..

I hope you guyz can help me out or give me a hint or something and i hope that you understand my bad english and what I want.

Thx a lot from a noobie swede : )
_________________
Give a noob a fish, feed him for a day.
Teach a noob to fish and feed him for a lifetime.
Back to top
View user's profile Send private message
Invalid User



Joined: 14 Feb 2005
Posts: 442
Location: Texas, Usa

PostPosted: Wed Feb 23, 2005 6:04 am    Post subject: Reply with quote

Quote:
want the script to push button 1 for ex. 100 times with an intervall of 3,2s

What do you mean by 3,2s? I dont understand what you mean with the comma
_________________
my lame sig Smile
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Wed Feb 23, 2005 6:11 am    Post subject: Reply with quote

In Europe the sign for a decimal point is a comma.

3.2s = 3,2s
Back to top
View user's profile Send private message
Invalid User



Joined: 14 Feb 2005
Posts: 442
Location: Texas, Usa

PostPosted: Wed Feb 23, 2005 6:15 am    Post subject: Reply with quote

EDIT: there was something to see here, but now it is no more, until I fix a few things
_________________
my lame sig Smile


Last edited by Invalid User on Wed Feb 23, 2005 6:23 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Invalid User



Joined: 14 Feb 2005
Posts: 442
Location: Texas, Usa

PostPosted: Wed Feb 23, 2005 6:33 am    Post subject: Reply with quote

Moderator: (incomplete code removed)

ummm I have attempting posting the code 4 times and each time it cuts the last 3/4 off. F it!
_________________
my lame sig Smile
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Wed Feb 23, 2005 7:01 am    Post subject: Reply with quote

Invalid User wrote:
I have attempting posting the code 4 times and each time it cuts the last 3/4 off.
Maybe the forum has a per-post limit. Perhaps you could post a link to the script. You can host it on Titan's web server if you need a place.
Back to top
View user's profile Send private message Send e-mail
Invalid User



Joined: 14 Feb 2005
Posts: 442
Location: Texas, Usa

PostPosted: Wed Feb 23, 2005 7:05 am    Post subject: Reply with quote

I attempted posting the script in a seccond post and it cut off at the same point, could this still be a limit issue?

Edit: OK OK here is a really really very extreamly simple version of what I think you looking for, but its untested so you might have to edit it slightly
Code:

Gui, Add, Combobox, vCustomEntry x6 y5 w450 h290, Enter your string clips and variables here
Gui, Add, Button, gEntryUpdate x466 y5 w20 h20, U! ;Updates Entry Lists
Gui, Add, Text, vStatus x6 y215 w480 h80, Status
;------------------------------------------------------------------------------Loop 1
Gui, Add, Edit, vAmount x16 y45 w50 h20, Amount
Gui, Add, Checkbox, gRandomAmount vRandomAmount x66 y45 w100 h20, Random Amount
Gui, Add, Edit, vRandomAmountMax x166 y45 w50 h20, AmountMax
Gui, Add, Edit, vTimer x276 y45 w50 h20, Timer1
Gui, Add, Checkbox, gRandomTimer vRandomTimer x326 y45 w100 h20, Random Timer
Gui, Add, Edit, vRandomTimerMax x426 y45 w50 h20, TimerMax 1
Gui, Add, ComboBox, vKey1 x16 y65 w90 h230, Key1||LOOPNUMBER|{F1}|{F2}|{F3}|{F4}|{F5}|{F6}|{F7}|{F8}|{F9}|{F10}|{F11}|{F12}|{!}|{#}|{+}|{^}|{{}|{}}|{ENTER}|{ESCAPE}|{SPACE}|{TAB}|{BACKSPACE}|{DELETE}|{INSERT}|{UP}|{DOWN}|{LEFT}|{RIGHT}|{HOME}|{END}|{PGUP}|{PGDN}|{CapsLock}|{ScrollLock}|{NumLock}|{CONTROL}|{ALT}|
Gui, Add, ComboBox, vKey2 x106 y65 w90 h230, Key2||LOOPNUMBER|{F1}|{F2}|{F3}|{F4}|{F5}|{F6}|{F7}|{F8}|{F9}|{F10}|{F11}|{F12}|{!}|{#}|{+}|{^}|{{}|{}}|{ENTER}|{ESCAPE}|{SPACE}|{TAB}|{BACKSPACE}|{DELETE}|{INSERT}|{UP}|{DOWN}|{LEFT}|{RIGHT}|{HOME}|{END}|{PGUP}|{PGDN}|{CapsLock}|{ScrollLock}|{NumLock}|{CONTROL}|{ALT}|
Gui, Add, ComboBox, vKey3 x196 y65 w90 h220, Key3||LOOPNUMBER|{F1}|{F2}|{F3}|{F4}|{F5}|{F6}|{F7}|{F8}|{F9}|{F10}|{F11}|{F12}|{!}|{#}|{+}|{^}|{{}|{}}|{ENTER}|{ESCAPE}|{SPACE}|{TAB}|{BACKSPACE}|{DELETE}|{INSERT}|{UP}|{DOWN}|{LEFT}|{RIGHT}|{HOME}|{END}|{PGUP}|{PGDN}|{CapsLock}|{ScrollLock}|{NumLock}|{CONTROL}|{ALT}|
Gui, Add, ComboBox, vKey4 x286 y65 w90 h220, Key4||LOOPNUMBER|{F1}|{F2}|{F3}|{F4}|{F5}|{F6}|{F7}|{F8}|{F9}|{F10}|{F11}|{F12}|{!}|{#}|{+}|{^}|{{}|{}}|{ENTER}|{ESCAPE}|{SPACE}|{TAB}|{BACKSPACE}|{DELETE}|{INSERT}|{UP}|{DOWN}|{LEFT}|{RIGHT}|{HOME}|{END}|{PGUP}|{PGDN}|{CapsLock}|{ScrollLock}|{NumLock}|{CONTROL}|{ALT}|
Gui, Add, ComboBox, vKey5 x376 y65 w100 h230, Key5||LOOPNUMBER|{F1}|{F2}|{F3}|{F4}|{F5}|{F6}|{F7}|{F8}|{F9}|{F10}|{F11}|{F12}|{!}|{#}|{+}|{^}|{{}|{}}|{ENTER}|{ESCAPE}|{SPACE}|{TAB}|{BACKSPACE}|{DELETE}|{INSERT}|{UP}|{DOWN}|{LEFT}|{RIGHT}|{HOME}|{END}|{PGUP}|{PGDN}|{CapsLock}|{ScrollLock}|{NumLock}|{CONTROL}|{ALT}|
Gui, Add, Button, gTest x216 y45 w60 h20, Test
Gui, Add, GroupBox, x6 y25 w480 h70, Key Loop 1
;------------------------------------------------------------------------------Loop 2
Gui, Add, Edit, vAmount2 x16 y115 w50 h20, Amount2
Gui, Add, Checkbox, gRandomAmount2 vRandomAmount2 x66 y115 w100 h20, Random Amount2
Gui, Add, Edit, vRandomAmountMax2 x166 y115 w50 h20, AmountMax 2
Gui, Add, Edit, vTimer2 x276 y115 w50 h20, Timer2
Gui, Add, Checkbox, gRandomTimer2 vRandomTimer2 x326 y115 w100 h20, Random Timer2
Gui, Add, Edit, vRandomTimerMax2 x426 y115 w50 h20, TimerMax2
Gui, Add, ComboBox, vKey12 x16 y135 w90 h160, Key12||LOOPNUMBER|{F1}|{F2}|{F3}|{F4}|{F5}|{F6}|{F7}|{F8}|{F9}|{F10}|{F11}|{F12}|{!}|{#}|{+}|{^}|{{}|{}}|{ENTER}|{ESCAPE}|{SPACE}|{TAB}|{BACKSPACE}|{DELETE}|{INSERT}|{UP}|{DOWN}|{LEFT}|{RIGHT}|{HOME}|{END}|{PGUP}|{PGDN}|{CapsLock}|{ScrollLock}|{NumLock}|{CONTROL}|{ALT}|
Gui, Add, ComboBox, vKey22 x106 y135 w90 h160, Key22||LOOPNUMBER|{F1}|{F2}|{F3}|{F4}|{F5}|{F6}|{F7}|{F8}|{F9}|{F10}|{F11}|{F12}|{!}|{#}|{+}|{^}|{{}|{}}|{ENTER}|{ESCAPE}|{SPACE}|{TAB}|{BACKSPACE}|{DELETE}|{INSERT}|{UP}|{DOWN}|{LEFT}|{RIGHT}|{HOME}|{END}|{PGUP}|{PGDN}|{CapsLock}|{ScrollLock}|{NumLock}|{CONTROL}|{ALT}|
Gui, Add, ComboBox, vKey32 x196 y135 w90 h150, Key32||LOOPNUMBER|{F1}|{F2}|{F3}|{F4}|{F5}|{F6}|{F7}|{F8}|{F9}|{F10}|{F11}|{F12}|{!}|{#}|{+}|{^}|{{}|{}}|{ENTER}|{ESCAPE}|{SPACE}|{TAB}|{BACKSPACE}|{DELETE}|{INSERT}|{UP}|{DOWN}|{LEFT}|{RIGHT}|{HOME}|{END}|{PGUP}|{PGDN}|{CapsLock}|{ScrollLock}|{NumLock}|{CONTROL}|{ALT}|
Gui, Add, ComboBox, vKey42 x286 y135 w90 h150, Key42||LOOPNUMBER|{F1}|{F2}|{F3}|{F4}|{F5}|{F6}|{F7}|{F8}|{F9}|{F10}|{F11}|{F12}|{!}|{#}|{+}|{^}|{{}|{}}|{ENTER}|{ESCAPE}|{SPACE}|{TAB}|{BACKSPACE}|{DELETE}|{INSERT}|{UP}|{DOWN}|{LEFT}|{RIGHT}|{HOME}|{END}|{PGUP}|{PGDN}|{CapsLock}|{ScrollLock}|{NumLock}|{CONTROL}|{ALT}|
Gui, Add, ComboBox, vKey52 x376 y135 w100 h160, Key52||LOOPNUMBER|{F1}|{F2}|{F3}|{F4}|{F5}|{F6}|{F7}|{F8}|{F9}|{F10}|{F11}|{F12}|{!}|{#}|{+}|{^}|{{}|{}}|{ENTER}|{ESCAPE}|{SPACE}|{TAB}|{BACKSPACE}|{DELETE}|{INSERT}|{UP}|{DOWN}|{LEFT}|{RIGHT}|{HOME}|{END}|{PGUP}|{PGDN}|{CapsLock}|{ScrollLock}|{NumLock}|{CONTROL}|{ALT}|
Gui, Add, Button, gTest2 x216 y115 w60 h20, Test2
Gui, Add, GroupBox, x6 y95 w480 h70, Key Loop 2
;------------------------------------------------------------------------------Botton controls
;Gui, Add, Button,  x6 y185 w80 h30, Help/About
Gui, Add, Radio, vAbort x16 y185 w20 h30, Break/Abort
Gui, Add, Radio, vPause x36 y185 w20 h30, Pause
Gui, Add, Radio, x56 y185 w20 h30, Cont
Gui, Add, Button, gStartKeyLoop x86 y185 w80 h30, Start Key Loop
Gui, Add, Button, x166 y185 w80 h30, Help/About
Gui, Add, Button, x246 y185 w80 h30, Loop 1 Options
Gui, Add, Button, x326 y185 w80 h30, Loop 2 Options
Gui, Add, Button, x406 y185 w80 h30, Options
;------------------------------------------------------------------------------Disables the Max Edit boxes
GuiControl, Disable, RandomAmountMax
GuiControl, Disable, RandomAmountMax2
GuiControl, Disable, RandomTimerMax
GuiControl, Disable, RandomTimerMax2
Gui, Show, x434 y108 h301 w493, The Crystal Society's Key Stroke Automator
Return
;------------------------------------------------------------------------------controls the RandomAmountMax Edit box with checkbox
RandomAmount:
GuiControlGet, RandomAmount
If RandomAmount = 0
{
   GuiControl, Disable, RandomAmountMax
}
If RandomAmount = 1
{
   GuiControl, Enable, RandomAmountMax
}
Return
;------------------------------------------------------------------------------controls the RandomAmountMax2 Edit box with checkbox
RandomAmount2:
GuiControlGet, RandomAmount2
If RandomAmount2 = 0
{
   GuiControl, Disable, RandomAmountMax2
}
If RandomAmount2 = 1
{
   GuiControl, Enable, RandomAmountMax2
}
Return
;------------------------------------------------------------------------------controls the RandomTimerMax Edit box with checkbox
RandomTimer:
GuiControlGet, RandomTimer
If RandomTimer = 0
{
   GuiControl, Disable, RandomTimerMax
}
If RandomTimer = 1
{
   GuiControl, Enable, RandomTimerMax
}
Return
;------------------------------------------------------------------------------controls the RandomTimerMax2 Edit box with checkbox
RandomTimer2:
GuiControlGet, RandomTimer2
If RandomTimer2 = 0
{
   GuiControl, Disable, RandomTimerMax2
}
If RandomTimer2 = 1
{
   GuiControl, Enable, RandomTimerMax2
}
Return
;------------------------------------------------------------------------------Updates the custom entry into the Key lists
EntryUpdate:
GuiControlGet, CustomEntry
GuiControl,, Key1, %CustomEntry%
GuiControl,, Key2, %CustomEntry%
GuiControl,, Key3, %CustomEntry%
GuiControl,, Key4, %CustomEntry%
GuiControl,, Key5, %CustomEntry%
GuiControl,, Key12, %CustomEntry%
GuiControl,, Key22, %CustomEntry%
GuiControl,, Key32, %CustomEntry%
GuiControl,, Key42, %CustomEntry%
GuiControl,, Key52, %CustomEntry%
Return
;------------------------------------------------------------------------------This is the test section
Test:
Test2:


Gui, 2:Add, Edit, T32 vTestingEdit w500 h200
Gui, 2:Add, Button, gExitTest, Exit
Gui, 2:Show, Text Test
KeyLoopStart:
GuiControl, Focus, TestingEdit
GuiControlGet, Amount
GuiControl,, Status, Testing....
GuiControlGet, RandomAmount
GuiControlGet, RandomAmount2
GuiControlGet, RandomAmountMax
GuiControlGet, RandomAmountMax2
If RandomAmount = 1
{
   Random, Amount, %Amount%, %RandomAmountMax%
}

loop, %Amount%
{
   KeyloopNum += 1
   
   GuiControlGet, Timer
   GuiControlGet, Key1
   GuiControlGet, Key2
   GuiControlGet, Key3
   GuiControlGet, Key4
   GuiControlGet, Key5
   GuiControlGet, Abort
   GuiControlGet, Pause
   If Abort = 1
   {
      Break
   }
;   If Pause = 1
;   {
;      Pause, Toggle
;   }
;   If Pause = 0
;   {
;      Pause, Off
;   }
   If Key1 = LOOPNUMBER
   {
      Key1 = %A_Index%
   }
   If Key2 = LOOPNUMBER
   {
      Key2 = %A_Index%
   }
   If Key3 = LOOPNUMBER
   {
      Key3 = %A_Index%
   }
   If Key4 = LOOPNUMBER
   {
      Key4 = %A_Index%
   }
   If Key5 = LOOPNUMBER
   {
      Key5 = %A_Index%
   }
   If Key1 = {TAB}
   {
      Key1 = ^{TAB}
   }
   If Key2 = {TAB}
   {
      Key2 = ^{TAB}
   }
   If Key3 = {TAB}
   {
      Key3 = ^{TAB}
   }
   If Key4 = {TAB}
   {
      Key4 = ^{TAB}
   }
   If Key5 = {TAB}
   {
      Key5 = ^{TAB}
   }
   GuiControlGet, Abort
    If Abort = 1 ; If abort is selected the loop breaks.
      Break
    GuiControlGet, Pause
    if Pause = 1
    {
      Loop  ; Wait until unpaused.
      {
           Sleep 10
           GuiControlGet, Pause
           if Pause <> 1
            break
       }
       WinActivate, %TextEditor%
       Sleep, 100
    }
   Send, %Key1%
   Send, %Key2%
   Send, %Key3%
   Send, %Key4%
   Send, %Key5%
   Sleep, %Timer%
   GuiControl,, Status, Entering: %Key1% %Key2% %Key3% %Key4% %Key5%.... `nLoop Number: %A_Index%
}
GuiControl,, Status, Key Loop1 has finished
;******************************************************************************this is the second loop test area
GuiControlGet, Amount2
GuiControl,, Status, Testing....

If RandomAmount2 = 1
{
   Random, Amount2, %Amount2%, %RandomAmountMax2%
}
loop, %Amount2%
{
   GuiControlGet, Timer2
   GuiControlGet, Key12
   GuiControlGet, Key22
   GuiControlGet, Key32
   GuiControlGet, Key42
   GuiControlGet, Key52
   If Key12 = LOOPNUMBER
   {
      Key12 = %A_Index%
   }
   If Key22 = LOOPNUMBER
   {
      Key22 = %A_Index%
   }
   If Key32 = LOOPNUMBER
   {
      Key32 = %A_Index%
   }
   If Key42 = LOOPNUMBER
   {
      Key42 = %A_Index%
   }
   If Key52 = LOOPNUMBER
   {
      Key52 = %A_Index%
   }
   If Key12 = {TAB}
   {
      Key12 = ^{TAB}
   }
   If Key22 = {TAB}
   {
      Key22 = ^{TAB}
   }
   If Key32 = {TAB}
   {
      Key32 = ^{TAB}
   }
   If Key42 = {TAB}
   {
      Key42 = ^{TAB}
   }
   If Key52 = {TAB}
   {
      Key52 = ^{TAB}
   }
   GuiControlGet, Abort
    If Abort = 1 ; If abort is selected the loop breaks.
      Break
    GuiControlGet, Pause
    if Pause = 1
    {
      Loop  ; Wait until unpaused.
      {
           Sleep 10
           GuiControlGet, Pause
           if Pause <> 1
            break
       }
       WinActivate, %TextEditor%
       Sleep, 100
    }
   Send, %Key12%
   Send, %Key22%
   Send, %Key32%
   Send, %Key42%
   Send, %Key52%
   Sleep, %Timer2%
   GuiControl,, Status, Entering: %Key12% %Key22% %Key32% %Key42% %Key52%.... `nLoop Number: %A_Index%
}
GuiControl,, Status, Key Loop2 has finished
Return
;------------------------------------------------------------------------------closes the test edit box gui window
ExitTest:
Gui, 2:Cancel
Return
;------------------------------------------------------------------------------Starts the Key Loop entry
StartKeyLoop:

MsgBox, 4097, AHK Assistant, Please place the cursor in the window where you would like the Key loop to be entered, `nwhen your ready press ok.
WinGetActiveTitle, TextEditor
GoSub, KeyLoopStart
Return
;------------------------------------------------------------------------------Aborts/stops key sending
AbortKeyLoop:
Amount = 0
Amount2 = 0


Return
GuiClose:
ExitApp

sorry is not pretty
_________________
my lame sig Smile
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Wed Feb 23, 2005 7:38 am    Post subject: Reply with quote

Thanks for posting the light version of the script.

Invalid User wrote:
I attempted posting the script in a seccond post and it cut off at the same point, could this still be a limit issue?
I don't know. I'm unaware of any limit, so perhaps there is some character in the ultra-long post that the forum doesn't like.
Back to top
View user's profile Send private message Send e-mail
Invalid User



Joined: 14 Feb 2005
Posts: 442
Location: Texas, Usa

PostPosted: Wed Feb 23, 2005 9:36 am    Post subject: Reply with quote

I was thinking that a certain combo of chars caused a problem, the version I wanted to post had all the good options like back ground color or image, control colors, always on top toggle, OSD option, and a bunch more, but this version should just get the job done
_________________
my lame sig Smile
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
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