Does anything look incorrect here?
F2::
Loop {
IfWinActive, Neverwinter
{
if GetKeyState("F9", "P") ;Exit if f9 is pressed
break
Loop, 4
{
if GetKeyState("F9", "P") ;Exit if f9 is pressed
break
;set coords of buy button ( x, y) EDIT THE LINE BELOW
MouseMove, 815,542
sleep, 100
Send {vk01sc000}
sleep, 20 ;send 99 to buy 20 potions.
Send {9}
Send {9}
;set coords of okay button (x, y) EDIT THE LINE BELOW
MouseMove, 997,454
sleep, 100
Send {vk01sc000}
}
;set coords of potion to sell (inventory slot) EDIT THE LINE BELOW
MouseMove, 1256,475
sleep, 60
Send {vk01sc000}
Send {vk01sc000}
;set coords of buy tab (tab on the left of the potions after the sell window pops up) EDIT THE LINE BELOW
MouseMove, 458,293
Send {vk01sc000}
}
}
edit the script to this
and tell me if it worksCode:F2:: Loop { if GetKeyState("F9", "P") ;Exit if f9 is pressed break Loop, 4 { if GetKeyState("F9", "P") ;Exit if f9 is pressed break ;set coords of buy button ( x, y) EDIT THE LINE BELOW MouseMove, 815,542 sleep, 100 Send {vk01sc000} sleep, 20 ;send 99 to buy 20 potions. Send {9} Send {9} ;set coords of okay button (x, y) EDIT THE LINE BELOW MouseMove, 997,454 sleep, 100 Send {vk01sc000} } ;set coords of potion to sell (inventory slot) EDIT THE LINE BELOW MouseMove, 1256,475 sleep, 60 Send {vk01sc000} Send {vk01sc000} ;set coords of buy tab (tab on the left of the potions after the sell window pops up) EDIT THE LINE BELOW MouseMove, 458,293 Send {vk01sc000} }
The result of this script actually does something, but when I set the coordinates the first two procedures are nowhere near where I placed my buy and okay.
Update: When I start the macro the cursor ports to coordinates that I never even set. As soon as I start the macro, it shifts to coordinates 14xx,9xx
F2::
Loop {
if GetKeyState("F9", "P") ;Exit if f9 is pressed
break
Loop, 4
{
if GetKeyState("F9", "P") ;Exit if f9 is pressed
break
;set coords of buy button ( x, y) EDIT THE LINE BELOW
MouseMove, 825,540
sleep, 100
Send {vk01sc000}
sleep, 20 ;send 99 to buy 20 potions.
Send {9}
Send {9}
;set coords of okay button (x, y) EDIT THE LINE BELOW
MouseMove, 995,455
sleep, 100
Send {vk01sc000}
}
;set coords of potion to sell (inventory slot) EDIT THE LINE BELOW
MouseMove, 1164,476
sleep, 60
Send {vk01sc000}
Send {vk01sc000}
;set coords of buy tab (tab on the left of the potions after the sell window pops up) EDIT THE LINE BELOW
MouseMove, 472,282
Send {vk01sc000}
}
Last edited by Tevarin; 07-05-2013 at 04:57 PM.
Thanks! Worked like a charm.