Sign in to follow this  
Followers 0
pawel054

Need help with small script...

8 posts in this topic

I want to do little 'macro' program. But i have 2 problems - First - i don't know how to do right mouse click on hotkey ( to on and off script just by pressing right mouse button ).

Second thing - i want to do 2 scripts in one time ( if it's not possible try to mod my script thx ).

What i have now -

HotKeySet("{NUMPAD1}", "start") ;
HotKeySet("{NUMPAD2}", "start1") ;
HotKeySet("{NUMPAD0}", "stop") ;
$i=0
$o=0
;;;;;;;;;;;;;;;;;;;;;;;;
While 1
   If $o=1 Then
   While 1
   Send ("p")
   WEnd
   EndIf
   If $i=1 Then
   While 1
   Send ("p")
   WEnd
   EndIf
While $o=1
   Send (3)
   Sleep (51)
   Send (4)
   Sleep (51)
   Send (5)
   Sleep (51)
   Send (6)
   Sleep (51)
   WEnd
   sleep (100)
While $i=1
Send (3)
Sleep (71)
Send (4)
Sleep (71)
Send (5)
Sleep (71)
Send (6)
Sleep (71)
WEnd
sleep(100)
WEnd
;;;;;;;;;;;;;;;;;;;;;;;;
Func start1()
$i=1
EndFunc
Func start()
$o=1
EndFunc
Func stop()
$i=0
$o=0
EndFunc

I want something like this -

I click num1, then if I click rmb macro starts with 51 ms delay. ($o )

If i click rmb second time macro stops

I click num2, then i click rmb - macro starts with 71 ms delay ( $i )

When one of this macros start - i want 'hold' effect ( in this i wanted to do hold effect on 'p' letter )

For now it didn't work how I want. Thanks for help !

Share this post


Link to post
Share on other sites



Welcome to AutoIt and the forum!

What application do you want to automate? Maybe there is a simpler way of doing what you want.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

What water said.

And why do you have such random values for the Sleep() argument?


Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Nah there isn't simpler way.

In one game we shooting with cannons. When we press a key for shoot for ex. all 4 cannons will shoot in this same time. I can also fire that cannons using 3,4,5,6. When i shot using 3456, i create something like 'chain fire'. This isn't any kind of piracy, a lot of players use it ( admins agreed that it isn't any kind of cheat, because it won't add damage etc ) so i wanted to do my own program.

So i did that when i click num1 i have my macro, and when i stop it by num0 i can also run another by num2, but i want to run and stop using only rmb, and choose delay what i want ( if it's possible ).

There aren't any random values trust me :) I spend a lot of time to find the best one.

So in short -

I want use delay 51.

- I click num1

- I click rbm - macro starts, and holding one of the letter starts too

- i click rbm again - macro stops

For 71 i want this same but i need to click num2

Edited by pawel054

Share this post


Link to post
Share on other sites

I stopped reading when I came to "game".

Please read the forum rules and you will understand why you won't get help on your subject.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

@water

So read all.

It's only macro script -.-

Share this post


Link to post
Share on other sites

@water

So read all.

It's only macro script -.-

You need to read all the forum rules...

Share this post


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