Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 06:06

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Simple script

Discussion on Simple script within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2015
Posts: 4
Received Thanks: 0
Simple script

Hello, to begin with I would like to say hello, I'm a new guy here, If the post doesn't belong here you are welcome to move it. Soo... I need help with writing simple script using AutoIt, below I'm showing you guys how would it look like.

- Start/Stop key = Alt + Pause Break

when start key pressed:

- Press F1, wait 2 seconds, use right click
wait 2 seconds
- Press F2, wait 2 seconds, use right click
wait 2 seconds
- Press F3, wait 2 seconds, use right click
continue pressing "F3, wait 2 seconds, use right click" for 1-2 minutes and then repeat F1, F2 and again F3 (loop)

Also I would like the script to use the right click where the mouse is set at, no need for setting coordinates.

I'm looking forward to hear from you guys.
floz1994 is offline  
Old 09/02/2015, 23:06   #2
 
WJNeeson's Avatar
 
elite*gold: 1445
Join Date: Sep 2011
Posts: 199
Received Thanks: 177
Hi floz

next time, please use
its for simple script requests

PHP Code:

HotKeySet
("!{PAUSE}""_Start")
HotKeySet("{ESC}""_Exit")

;
sets the hot key "alt+pause" for function _start
;sets the hot key "esc" for function _exit

Global $isPaused True

;bool for toggle start/pause

While 1
    
If $isPaused False Then
        
;checks if bot is on/off
        
;if on then...
        ;
everything in this while will be repeated until you press alt+pause again
        Send
("{F1}")
        ;
sends key F1
        Sleep
(2000)
        ;
sleeps for 2000ms 2s
        MouseClick
("Right")
        ;
uses right click (mouse)

        
Send("{F2}")
        
Sleep(2000)
        
MouseClick("Right")

        
$timer TimerInit()
        ;
sets a timer
        $diff 
TimerDiff($timer)
        ;
reads the time difference to TimerInit()
        While 
$diff 120000
            
;while the timer difference is less than 120000ms (2min).....
            
$diff TimerDiff($timer)
            ;
read diff again otherwise it will always be as big as before the while
            
Send("{F3}")
            
Sleep(2000)
            
MouseClick("Right")
        
WEnd
    
EndIf
    ;if 
off then ask again
WEnd

Func _Start
()
    ;function 
which is called by pressing alt+pause
    
If $isPaused False Then $isPaused True
    
If $isPaused True Then $isPaused False
EndFunc

Func _Exit
()
    Exit
EndFunc 
very simple explanations in the comments (with ; at the beginning)
WJNeeson is offline  
Thanks
1 User
Old 09/02/2015, 23:35   #3
 
elite*gold: 0
Join Date: Sep 2015
Posts: 4
Received Thanks: 0
perfect, what about F3? will it repeat for 1-2 minutes then go back to F1, F2 and repeating again?

The F2 function is not working, the script is not even using it
floz1994 is offline  
Old 09/03/2015, 15:45   #4
 
WJNeeson's Avatar
 
elite*gold: 1445
Join Date: Sep 2011
Posts: 199
Received Thanks: 177
f1, f2, f3 for 2 mins
go back

try to add #requireadmin at the top
WJNeeson is offline  
Old 09/03/2015, 16:03   #5
 
elite*gold: 0
Join Date: Sep 2015
Posts: 4
Received Thanks: 0
Okay, I'm not sure now if that's what you meant..

F1, F2, F3 for 2 mins... - meaning all of them are going to work for 2 minutes in a loop?

I need: F1+RIGHT MOUSE and F2+RIGHT MOUSE for single use and then loop F3 so its keep pressing it and right mouse click for 2 minutes

could you fix that for me? and add the #requireadmin thing you were talking about

The script doesn't read function F2, looks like its skipping it
The pause is not working, you can start it but can't pause it
floz1994 is offline  
Old 09/03/2015, 21:10   #6
 
WJNeeson's Avatar
 
elite*gold: 1445
Join Date: Sep 2011
Posts: 199
Received Thanks: 177
check the code

PHP Code:
#RequireAdmin

HotKeySet("!{PAUSE}""_Start")
HotKeySet("{ESC}""_Exit")

Global 
$isPaused True

While 1
    
If $isPaused False Then
        Send
("{F1}")
        
Sleep(2000)
        
MouseClick("Right")
    
Sleep(2000)

        
Send("{F2}")
        
Sleep(2000)
        
MouseClick("Right")
    
Sleep(2000)

        
$timer TimerInit()
        
$diff TimerDiff($timer)
        While 
$diff 120000
            $diff 
TimerDiff($timer)
            
Send("{F3}")
            
Sleep(2000)
            
MouseClick("Right")
            
Sleep(2000)
        
WEnd
    
EndIf
WEnd

Func _Start
()
    If 
$isPaused False Then $isPaused True
    
If $isPaused True Then $isPaused False
EndFunc

Func _Exit
()
    Exit
EndFunc 
when you press alt+pause
everthing below "If $isPaused = False Then" will happen
->
send f1
wait 2s
right click
wait 2s

send f2
wait 2s
right click
wait 2s

timer will be set for 2m
during this 2m
->
send f3
wait 2s
right click
wait 2s
repeat until time is > 2m

go back and repeat everything

when you press alt+pause again
->
script will finish this operation (if you press alt+pause after the script presses f1 it will first do f2 and the 2mins f3)

my bad that the pause wasnt working
WJNeeson is offline  
Reply


Similar Threads Similar Threads
Simple script needed
12/12/2013 - Diablo 2 Programming - 0 Replies
Hi I need a simple script that will create a game for x amount of minutes and display the time left until next game above the head of the character and nothing else.. I would write this myself but I don't know how. thanks for any help
Need help on simple background bot script.
12/02/2010 - CO2 Programming - 5 Replies
Hi all, Can anyone help me to write a very small very simple bot (not macro), using C# that walks to a particular co-ordinate... I found : 008CABEC as X Coord 008CABF0 as Y Coord from Cheat Engine.
Very Simple AFK script
10/03/2009 - Aion Hacks, Bots, Cheats & Exploits - 0 Replies
Autoit afk script, saw there was none but if you need it like i do at 20:00 and gotta go afk this is for you.
simple script or what ?
11/24/2008 - Lineage 2 - 1 Replies
first sry my bad english i'm just 9 year old and i live in bulgaria i need help for this : on l2j , ct1 /or 2/ server i run ig walker /maybe 2.05 or 2.07/ i have necro character , and i want to this char use own skill death spike continously /on boss or etc./ without pressing the F-keys i need some script , or something else , or it is possible or not sorry if i ask too stupid things , but this is my first post , first problem , first walker using



All times are GMT +1. The time now is 06:11.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.