Jump to content
Sign in to follow this  
Mazdryk

Add a timer to my macro please

Recommended Posts

Mazdryk

I posted my macro below.  Basically it checks for a certain color and if it is not there presses a key or goes to the next "else".  I would like to add a timer for the second "else" statement so that after it presses "F1" it wont include that part of the "else" for 25 seconds.  The other problem is that I would like F1 to be available to be pressed for 4 seconds after it meets its requirements but after that 4 seconds totally off for 25.  I will happily send $15 to your paypal if you solve this.

 

#include <Misc.au3>

HotKeySet("{F9}", "_exit")
Hotkeyset ("{1}", "_fight" )

AutoItSetOption( "PixelCoordMode", 1)

$wgh = WinGetHandle("Frog game")
$color1 = "ox400000"

While 1
 Sleep (1000) ;Keeps script running
WEnd

Func _Fight()
   $Black = PixelSearch(828, 920, 828, 920, $color1,100, 1, $wgh)
   $Black2 = PixelSearch(828, 924, 828, 924, $color1,100, 1, $wgh)  
   If (IsArray($Black) = 0 or IsArray($Black2) = 0) Then
   Send ("{F3 DOWN}")
   Sleep (100)
   Send ("{F3 UP}")
   else
   $Black = PixelSearch(860, 920, 860, 920, $color1,100, 1, $wgh)
   $Black2 = PixelSearch(860, 924, 860, 924, $color1,100, 1, $wgh)  
   If (IsArray($Black) = 0 or IsArray($Black2) = 0) Then
   Send ("{F1 DOWN}")
   Sleep (100)
   Send ("{F1 UP}")
   else
   Send ("{2 DOWN}")
   Sleep (100)
   Send ("{2 UP}")

   endif

EndFunc

Func _exit()
Sleep(3000)
    Exit 0
EndFunc

Share this post


Link to post
Share on other sites
FireFox

@Mazdryk

Hi,

Welcome the the autoit forum :)

Please BOTH read the forum rules, link at right bottom of each page.

Br, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
decadence

Oh yeah, he is probably trying to make a game bot and it is forbidden on the forum. I didn't realise at first sight,  My bad... o.o'

And I am not willing to take his money as well...

OFF: HELP ME ON MY PROBLEM FIREFOX PLSZOR!

Share this post


Link to post
Share on other sites
FireFox

Oh yeah, he is probably trying to make a game bot and it is forbidden on the forum. I didn't realise at first sight,  My bad... o.o'

Then delete your post or if you can't, edit it to remove the code you posted.

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
Mazdryk

this is not a game bot. I am grouping 3 skills together in one button and using the one I pick based on a color.  The color is the box around the combo when it becomes available.

Share this post


Link to post
Share on other sites
decadence

Send me an e-mail Mazdryk on eroguro.nagash@gmail.com

Share this post


Link to post
Share on other sites
TheSaint

Welcome decadence!

Deleting posts is generally not acceptable here, once they've been responded to.

It is preferred that you edit and then leave a comment if necessary.

You do have to have a certain post count for editing capability though.

MODERATORS can be appealed to though at need.

@Mazdryk - There is no exception, and you'd know that if you read the rules.


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites
FireFox

Deleting posts is generally not acceptable here, once they've been responded to.

Well, I'm the only one who responded.

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
FireFox

@Mazdryk

Next time, please use autoit code tags to post your code :)

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
TheSaint

Send me an e-mail Mazdryk on eroguro.nagash@gmail.com

Don't ever do that again please.

If you want to discuss something that is unacceptable here, then we don't want to know about it or have it advertised ... use a PM.


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites
TheSaint

Well, I'm the only one who responded.

True, and in this instance I see no problem, but he needs to know what is general accepted practice.

P.S. I presume that just slipped your mind. I wasn't having a go at you or second guessing.  :)

Edited by TheSaint

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites
decadence

Welcome decadence!

Deleting posts is generally not acceptable here, once they've been responded to.

It is preferred that you edit and then leave a comment if necessary.

You do have to have a certain post count for editing capability though.

MODERATORS can be appealed to though at need.

@Mazdryk - There is no exception, and you'd know that if you read the rules.

 

But why do I have the option to delete them, even if my post count is <10? If I shouldn't delete them the Admin's won't give me this right in the first place? And I didn't find anything about deleting posts on the forum rules, is there a more complete version of the rules? And I didn't find anything about exchanging e-mails on the rules as well. And I don't have the option to send PM's, at least I couldn't find them.

Thank you for receiving me on the forums.

Edited by decadence

Share this post


Link to post
Share on other sites
TheSaint

You responded openly with an email to help someone who made what is classed as a Game Bot topic/post by the rules.

I don't make the rules, I just obey and help enforce them, by pointing them out to people.

I don't recall the reasoning for allowing Delete, but not Editing until after 10(?) posts.

And I'm not telling you off for that, just making you aware.

PM's may also have a post limit, which also applies to the use of the Chat section.

But personally, in this instance, we don't want you to help anyone with Game Bot related issues ... even by PM.

It was suggested purely because it is then beyond our knowledge, not because we condone it.

It would be in the general rules I suspect, but you no doubt overlooked it.

Edited by TheSaint

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×