Continuing A Sequence After Loop Topic is solved

Ask gaming related questions (AHK v1.1 and older)
deca2708

Continuing A Sequence After Loop  Topic is solved

17 May 2016, 01:26

Hi, appreciate if any could help.

Im using this macro for autobuy on ragnarok online,
It's
; This script was created using Pulover's Macro Creator
; www.macrocreator.com

#NoEnv
SetWorkingDir %A_ScriptDir%
CoordMode, Mouse, Window
SendMode Input
#SingleInstance Force
SetTitleMatchMode 2
#WinActivateForce
SetControlDelay 1
SetWinDelay 0
SetKeyDelay -1
SetMouseDelay -1
SetBatchLines -1




Numpad1::
Loop, 800
{
WinActivate, Ragnarok ahk_class Ragnarok
Sleep, 333
Sleep, 672
Click, 894, 625 Left, Down
Sleep, 78
Click, 894, 625 Left, Up
Sleep, 640
Click, 895, 625, 0
Sleep, 219
Send, {Enter}
Sleep, 375
Send, {Enter}
Sleep, 391
Send, {Enter}
Sleep, 375
Send, {Enter}
Sleep, 406
Send, {Enter}
Sleep, 406
Send, {Enter}
Sleep, 625
Send, {Enter}
Sleep, 156
Click, 117, 189 Left, Down
Sleep, 110
Click, 425, 213 Left, Up
Sleep, 16
Send, {Enter}
Sleep, 16
}
Numpad2::exitapp
I would like to do a sequence after the loop has been fulfilled which is 800 times, it is just another click and typing thing, nothing complex.
how do I do it so that it runs automatically after the loop has been done for 800 times?

I tried adding the sequence after the "{" before Numpad2, and it did not work. fyi, the sequence is only run 1 time
Appreciate it if anyone could help.

I did try reading while-loop, if, etc etc, but I just cant comprehend it, please just give an example, I'm not hoping to be spoon-fed, but just want a help sending me to the right direction.

Thank you =)
User avatar
jmeneses
Posts: 524
Joined: 28 Oct 2014, 11:09
Location: Catalan Republic

Re: Continuing A Sequence After Loop

17 May 2016, 03:42

Hi deca2708 , i do not understand well but...., you can try put a RETURN to the end of numpad1

Code: Select all

Numpad1::
Loop, 800
{
WinActivate, Ragnarok ahk_class Ragnarok
Sleep, 333
............................
....................................
Sleep, 16
}
Return

Numpad2::exitapp
Donec Perficiam
deca2708

Re: Continuing A Sequence After Loop

21 May 2016, 06:26

Hi, thanks for the reply.

I do not want to end the numpad, I want it to continue doing something automatically after the loop without pressing anymore key.

so, e.g.

I want to loop to say ABCDE for 800 times,
Then after it looped for 800 times, I want it to say FGHI automatically without.

Is it possible?

Really appreciate it if you could help =)
SvenBent
Posts: 266
Joined: 09 Aug 2015, 01:34

Re: Continuing A Sequence After Loop

21 May 2016, 11:35

Code: Select all

hotkey::
Stuff that comes before the loop
Loop 800
    {
    stuff to be looped
    }
Stuff  that comes after the loop
Return ; ends the hotkey

You pretty much just type what you want to have done after the loop....after the loop
if you want another loop after that you just type in another loop. The execution order is top to bottom. until a return

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 29 guests