Noobcube Posted January 9, 2008 Posted January 9, 2008 i need my script to run thhrough this script once func target() is complete do func fight() when func fight() is done do func loot() once func loot() is done start again help please Func target() Send("{TAB}") If not pixelgetcolor( 875 , 84) = 0xFFFFFF Then Send("{TAB}") Do pixelsearch( 611 , 93 , 611 , 93 , 0xFF615A) Send("{tab}") Sleep(500) If pixelgetcolor( 875 , 84) = 0xFFFFFF Then Send("{TAB}") Until pixelgetcolor( 611 , 93) = 0xFF615A If not pixelgetcolor( 875 , 84) = 0xFFFFFF Then Send("{TAB}") endfunc func fight() do Sleep(250) Send("7") Sleep("2600") Send("8") Sleep("2600") Send("9") Sleep("2600") until pixelgetcolor( 613 , 95) = 0x212021 endfunc func loot() Send("{SPACE}") SLeep(250) Send("{SPACE}") SLeep(250) Send("{SPACE}") SLeep(250) Send("{SPACE}") SLeep(250) Send("{SPACE}") SLeep(250) Send("{SPACE}") SLeep(250) Send("{SPACE}") SLeep(250) Send("{SPACE}") SLeep(250) Send("{SPACE}") SLeep(250) Endfunc while True target() fight() loot() WEnd thats the script
SpookMeister Posted January 9, 2008 Posted January 9, 2008 (edited) That should basically do what you are asking for, meaning continually do one function after the other. You are probably having a problem with one of the functions. Try adding a few MsgBox() to the script so that you can monitor which function you are in for testing purposes Also, normally functions are placed at the end of the script, but that is just a "style" thing, it only helps readability. [Edit to add some example code] expandcollapse popupWhile True target() fight() loot() WEnd Func target() MsgBox(4096, "", "target", 1) Send("{TAB}") If Not PixelGetColor(875, 84) = 0xFFFFFF Then Send("{TAB}") Do PixelSearch(611, 93, 611, 93, 0xFF615A) Send("{tab}") Sleep(500) If PixelGetColor(875, 84) = 0xFFFFFF Then Send("{TAB}") Until PixelGetColor(611, 93) = 0xFF615A If Not PixelGetColor(875, 84) = 0xFFFFFF Then Send("{TAB}") EndFunc ;==>target Func fight() MsgBox(4096, "", "fight", 1) Do Sleep(250) Send("7") Sleep("2600") Send("8") Sleep("2600") Send("9") Sleep("2600") Until PixelGetColor(613, 95) = 0x212021 EndFunc ;==>fight Func loot() MsgBox(4096, "", "loot", 1) Send("{SPACE}") Sleep(250) Send("{SPACE}") Sleep(250) Send("{SPACE}") Sleep(250) Send("{SPACE}") Sleep(250) Send("{SPACE}") Sleep(250) Send("{SPACE}") Sleep(250) Send("{SPACE}") Sleep(250) Send("{SPACE}") Sleep(250) Send("{SPACE}") Sleep(250) EndFunc ;==>loot Edited January 9, 2008 by SpookMeister [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now