hi , can somebody help me with this , aparently the hotkey is out of a function but the script send me error box

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
hello425059
Posts: 1
Joined: 07 May 2024, 21:29
Contact:

hi , can somebody help me with this , aparently the hotkey is out of a function but the script send me error box

07 May 2024, 21:33

Code: Select all

#Include <findtext>
#Include <MDC>
#Warn ; warning to detect Errors
#NoEnv
#Persistent
#IfWinActive ahk_class MHXYMainFrame
CoordMode, Mouse, window
if !(A_IsAdmin || InStr(DllCall("GetCommandLine", "str"), ".exe"" /r"))
 RunWait % "*RunAs " (s:=A_IsCompiled ? "" : A_AhkPath " /r ") """" A_ScriptFullPath """" (s ? "" : " /r") ;自动以管理员方式运行

SetBatchLines -1


^1::SetTimer, FengYao, 111

return
FengYao:
    Text:="|<>*111$61.k000000001nwtynffxzqHzzzzzzzzzlzzzzzzzzztpzzzzzzzyqzLK80304xiRTzzzzzzzLDTzzzzzzzrbzzzzzzzzznzzzzzzzzztzzyTzztbzszwTDzzwzzwTzY0zy01zjDzznzzC7zzbyTtzzz3zvnzW00Ty0TztzzCQTq93zwRzyPzwQsTwTzCQzsSS7zDTCSDyzDbzbjj0LzzbzznzzzzzzrzztvzzzzzzzywuzzzzzzzyyRYI0000JSbDDzzzzzzzv8"


if (fight:=FindText(, , 799, 251, 1002, 386, 0, 0, Text))  ;进入战斗判定
{

ToolTip, 进战斗, 155, 954
ToolTip, ,-1111
Text1:=X:=Y:=""
Text1:="|<>##000000$0/0/56DF6D,0/4/56DF6D,10/4/56DF6D,10/0/56DF6D,-1/9/56DF6D,-2/14/56DF6D,9/7/56DF6D"

if (ok:=FindText(X, Y, 408, 154, 601, 318, 0, 0, Text1))
{
if (by:=FindText(Xby1, Yby1, 598, 148, 597, 500, 0.2, 0.2, Text1)) ;右上有没有变异判定
 
ToolTip, 有变异, 255, 955
;IfWinActive 梦幻西游 ONLINE - (北京1区[生日快乐] - 。夕下〃[50441591])
pt :=FindText(X1, Y1, 598, 148, 597, 500, 0.2, 0.2, Text1)
x1 :=x1-15
y1 :=Y1-39
Sleep 51
Send {F7 Down}
sleep, 8
Send {F7 Up}
c(X1,Y1)
sleep, 55
click 3
send {Ctrl Down}{Tab}{Ctrl Up}
Sleep 55
lb :=FindText(X2, Y2, 598, 148, 597, 500, 0.2, 0.2, Text1)
x2 :=x2-15
y2 :=y2-33
send {F1}
sleep, 55
c(X2,Y2)
sleep, 35
click 3
Sleep 44
send {Ctrl Down}{Tab}{Ctrl Up}
Sleep 55
df :=FindText(X3, Y3, 598, 148, 597, 500, 0.2, 0.2, Text1)
x3 :=x3-14
y3 :=y3-33

send {Alt Down}{s}{Alt Up}
c(x3,y3)
sleep, 33
click 3
Sleep 44
send {Ctrl Down}{Tab}{Ctrl Up}
Sleep 55
wd :=FindText(X4, Y4, 598, 148, 597, 500, 0.2, 0.2, Text1)
x4 :=x4-15
y4 :=y4-33
send {F2}
Sleep, 55
c(X4,Y4)
sleep, 48
click 3
Sleep 44
send {Ctrl Down}{Tab}{Ctrl Up}
Sleep 55
mw :=FindText(X5, Y5, 598, 148, 597, 500, 0.2, 0.2, Text1)
x5 :=x5-15
y5 :=y5-33
send {F2}
Sleep, 55
c(X5,Y5)
sleep, 49
click 4
Sleep 44
send {Ctrl Down}{Tab}{Ctrl Up}
Sleep 55
}
;else if

}


}
Sleep 1000

return
^F12::Suspend
^r::Reload
^e::ExitApp
image.png
image.png (5.78 KiB) Viewed 455 times

[Mod edit: Added [code][/code] tags around the code, not around an inline attachment placed in the middle of the code. Also, removed two of the three identical images.]
tabr3
Posts: 18
Joined: 25 Feb 2024, 04:06

Re: hi , can somebody help me with this , aparently the hotkey is out of a function but the script send me error box

08 May 2024, 02:19

I don't have the same error. If the MDC (include) script is not needed, remove that line, as it does nothing for this script.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], DaveT1, Google [Bot], peter_ahk and 108 guests