Jump to content

Simple loop


Anuran
 Share

Recommended Posts

Hi everybody,

im getting started with AutoIt and already stuck hehe. im trying to make a simple loop without having a code with 10000 rows.

this is what i made so far..

Global $Paused
HotKeySet("{F5}","TogglePause")
HotKeySet("{F6}","ExitMod")


While 1
Sleep(10000)
MouseClick("right")
Sleep(5000)
MouseClick("right")
Sleep(5000)
MouseClick("right")
Sleep(5000)
MouseClick("right")
Sleep(5000)
MouseClick("right")
Sleep(5000)
MouseClick("right")
Sleep(5000)
MouseClick("right")
WEnd

Func TogglePause()
$Paused = NOT $Paused
While $Paused
sleep(100)
ToolTip('"Paused"',0,0)
WEnd
ToolTip("")
EndFunc

Func ExitMod()
    Exit
EndFunc

and my question now is: how can i loop this script? like an infinity "mouse right" loop..

greets Anuran

Link to comment
Share on other sites

hi,

you will need to add moving coordinates, or adding mouseclick ("left") to cancel the previous right so it will do infinity...

uhm...not this is not true...

your loop is already infinite...

(except pressing F5 oder F6)

Edited by Kademlia
Link to comment
Share on other sites

ok thanks for fast answer. script works well..but in windows only..

ah well..i forgot to say this script is for KalOnline. my idea was to make a script to auto use my MP potions.

what i did:

run script (paused)

start KalOnline in window mode 1280x1024

play my script

but ingame nothing happens :/

any idea how to fix it?

Link to comment
Share on other sites

Do you take a MP potion with rightclick?

Maybe KalOnline blocks the inputs from AI?

i made something similar to this for "silkroad once" for testing

CODE

HotKeySet("{F5}", "StartMP") ; Hotkey to start/pause

TogglePauseMP() ;paused on start

Func StartMP()

HotKeySet("{F5}")

HotKeySet("{F5}", "TogglePauseMP")

ToolTip('MP an', 500, 50) ; show tooltip if script is on or off

While 1

PixelSearch(112, 53, 112, 53, 0x151515) ; Looks for my MPbar. if it drops below X% it will send "7" (my key for taking a manapotion)

If Not @error Then

Send("{7}")

EndIf

Sleep(2000)

WEnd

EndFunc; ==>Start

Func TogglePauseMP()

ToolTip('MP aus (f5)',500,50)

HotKeySet("{F5}")

HotKeySet("{F5}", "StartMP")

While 1

sleep(100)

WEnd

EndFunc

porting is up to you

Edited by Kademlia
Link to comment
Share on other sites

nah dont think so..a friend made an auto pot (bot) script with another tool. but he dont wanne give me his script, so...

another try:

Global $Paused
HotKeySet("{F5}","TogglePause")
HotKeySet("{F6}","ExitMod")


While 1
Sleep(5000)
Send("{6 down}")
Send("{6 up}")
WEnd

Func TogglePause()
$Paused = NOT $Paused
While $Paused
sleep(100)
ToolTip('PAUSE',0,0)
WEnd
ToolTip("")
EndFunc

Func ExitMod()
    Exit
EndFunc

this also dont work ingame.

is saw the following code in Gaming and Bots forum..

Winactivate ("Diablo II","")

but i dunno what to do with?!?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...