helpmepls 0 Posted January 23, 2007 (edited) ok i want to make a program that click in the top middle of the screen now everytime i try to start it i get error here are the scripts but i need it to be repeating it the time that i put it, when i put it like that i get error in func check HP HotKeySet("{F11}", "Pause") Global $Paused While 1 WinWaitActive("SRO_Client") Sleep(200) CheckZerk() CheckHP() CheckMP() CheckDC() SendSkill() MouseClick() WEnd Func CheckZerk() If PixelGetColor(14, 22) <> (0) Then Send("{TAB}") EndIf EndFunc ;==>CheckZerk Func MouseClick() MouseClick ("Left",500,0,5) Sleep(15000) MouseClick ("Left",500,0,5) Sleep(15000) MouseClick ("Left",500,0,5) Sleep(15000) MouseClick ("Left",500,0,5) Sleep(15000) MouseClick ("Left",500,0,5) Sleep(15000) MouseClick ("Left",500,0,5) Sleep(15000) Func CheckHP() If PixelGetColor(703, 743) <> (0) Then Else EndIf EndFunc ;==>CheckHP Func CheckMP() If PixelGetColor(667, 743) <> (0) Then EndIf EndFunc ;==>CheckMP Func CheckDC() If PixelGetColor(528, 425) = (16710616) Then MouseClick("left", 512, 422, 1, 0) EndIf EndFunc ;==>CheckDC Func SendSkill() While PixelGetColor(429, 46) = (16724273) and PixelGetColor(411, 20) <> (16248774) ControlSend("SRO_Client", "", "", "{F1}") ControlSend("SRO_Client", "", "", "1") Sleep(2000) ControlSend("SRO_Client", "", "", "2") Sleep(2000) ControlSend("SRO_Client", "", "", "3") Sleep(2000) ControlSend("SRO_Client", "", "", "4") Sleep(2000) ControlSend("SRO_Client", "", "", "5") Sleep(2000) ControlSend("SRO_Client", "", "", "6") Sleep(2000) Wend EndFunc ;==>SendSkill Func Pause() $Paused = Not $Paused While $Paused Sleep(400) WEnd EndFunc ;==>Pause Edited January 23, 2007 by helpmepls Share this post Link to post Share on other sites
xcal 3 Posted January 23, 2007 Who knows... you didn't include the whole mouseclick() function, and you didn't even say what the error is. How To Ask Questions The Smart Way Share this post Link to post Share on other sites
helpmepls 0 Posted January 23, 2007 the error is: Error:"Func" statement has no matching "EndFunc" Share this post Link to post Share on other sites
xcal 3 Posted January 23, 2007 (edited) Put your script in SciTE and press CTRL + T (or go Tools >> Tidy Autoit Source). Edited January 23, 2007 by xcal How To Ask Questions The Smart Way Share this post Link to post Share on other sites
Uten 9 Posted January 23, 2007 the error is:Error:"Func" statement has no matching "EndFunc" Wonder what that can be You know, structuring your script is important. Use Tidy as @xcal sugested.Also, it would help a lot of you wrap your code with the autoit tags. Use the A button at the midle of the editor (The blue one)..Where is ;==>MouseClick ??? Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Share this post Link to post Share on other sites
helpmepls 0 Posted January 23, 2007 when i press ctrl +t it just move the scripts up or down so what script should i move? Share this post Link to post Share on other sites
crzftx 0 Posted January 23, 2007 This is the most ridiculous request ever. You're having the forum tidy your script... when it's spelled out in front of you!?! Error:"Func" statement has no matching "EndFunc" Look for a "Func" statement that has no matching "EndFunc"!! what more is there....? Func MouseClick has no matching EndFunc Put one in Share this post Link to post Share on other sites
SmOke_N 210 Posted January 24, 2007 (edited) This is the most ridiculous request ever. You're having the forum tidy your script... when it's spelled out in front of you!?!Error:"Func" statement has no matching "EndFunc"Look for a "Func" statement that has no matching "EndFunc"!! what more is there....?Func MouseClick has no matching EndFuncPut one inI'll agree with most of what you typed... but the suggestion you posted is not entirely true.Func with No EndFunc... Doesn't always mean there is a function without an EndFunc... What it could be is...From:Func....>> EndFuncthere could be an If missing an EndIf ... a For missing a Next ... a Switch missing an EndSwitch ... a While missing a WEnd ... a Do missing an Until ... a Select missing an EndSelect and anything else I may have left out.Edit:The error is kind of a stupid one though... The actual error is caused by: Func MouseClick()Which actually has no EndFunc as everyone suggested, but you can't create a function name that is already a Standard Function. Edited January 24, 2007 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Share this post Link to post Share on other sites