danzar Posted December 21, 2006 Posted December 21, 2006 i am new but real excited about the use of this program. i would like some feedback on this rough but runable script. i just tring to learn from more experince people. thanks danzar CODEGlobal $mob Opt("MouseCoordMode", 0) Opt("PixelCoordMode", 0) Opt("MouseClickDelay", 0) Opt("MouseClickDownDelay", 0) Global $Paused HotKeySet("{HOME}", "Terminate") ; HotKeySet("{Pause}", "TogglePause"); HotKeySet("{ESC}", "Terminate"); ;starts here Opt("WinTitleMatchMode", 4) WinWait("RF Online","") ControlClick("RF Online","","D3D Window0") while 1 call("lookingfor") WEnd func lookingfor() $findmob = pixelgetcolor(445,54) if $findmob <> 16250863 Then call("targetbrutal") Else sleep(0) EndIf EndFunc func targetbrutal() $rand = Random(1,2,1) switch $rand Case 1 Opt("SendKeyDownDelay", 10) send("{d}") $mob = PixelSearch(0,0,800,600,0x381E0A,1,1) if not @error Then MouseClick("left", $mob[0],$mob[1]) send("{SPACE}") EndIf CASE 2 ContinueCase EndSwitch EndFunc Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd EndFunc Func Terminate() Exit 0 EndFunc
PaulIA Posted December 21, 2006 Posted December 21, 2006 (edited) Good start. Some general comments: 1. Group your Opts and Globals together. 2. Use mixed case letters in all names. All lower case/upper case is hard to read. 3. Use the "MustDeclareVars" option so that you force yourself to declare local/global variables. 4. Don't use Call() as it has very specific uses. expandcollapse popupOpt("MouseClickDelay", 0) Opt("MouseClickDownDelay", 0) Opt("MouseCoordMode", 0) Opt("MustDeclareVars", 1) Opt("PixelCoordMode", 0) Opt("SendKeyDownDelay", 10) Opt("WinTitleMatchMode", 4) Global $Mob Global $Paused HotKeySet("{HOME}", "Terminate") ; HotKeySet("{Pause}", "TogglePause"); HotKeySet("{ESC}", "Terminate"); ; ; Main ; WinWait("RF Online", "") ; <-- Might want to use WinWaitActive here ControlClick("RF Online", "", "D3D Window0") While 1 if PixelGetColor(445, 54) <> 16250863 Then if Random(1, 2, 1) = 1 then Send("{d}") $Mob = PixelSearch(0, 0, 800, 600, 0x381E0A, 1, 1) if not @error Then MouseClick("left", $Mob[0], $Mob[1]) Send("{SPACE}") EndIf EndIf EndIf Sleep(100) WEnd ; ; TogglePause ; Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd EndFunc ; ; Terminate ; Func Terminate() Exit EndFunc Edit: Took a little more liberty with the original code Edited December 21, 2006 by PaulIA Auto3Lib: A library of over 1200 functions for AutoIt
theguy0000 Posted December 21, 2006 Posted December 21, 2006 (edited) Unnecessary use of Call call("lookingfor")oÝ÷ ÙÆ§ë-mæ®¶sfÆöö¶ævf÷"oÝ÷ ٩ݲ'jwp+ay)^zrÛ²¢ç;¬¶Ö¤z¶°^[rV®±æ®¶sdgVæ2Æöö¶ætf÷"¢b33c´fæDÖö"ÒVÆvWF6öÆ÷"CCRÃSB¢bb33c´fæDÖö"fÇC²fwC²c#Sc2FVà¢F&vWD''WF¢VÇ6R¢6ÆVW²fÇC²ÒÒ6ÆVWð¢VæD`¤VæDgVæ0 Edited December 21, 2006 by theguy0000 The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN
theguy0000 Posted December 21, 2006 Posted December 21, 2006 Oh, and please use Tidy on your code. it is a great tool. The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN
Thatsgreat2345 Posted December 21, 2006 Posted December 21, 2006 wow theguy those were so beautiful code/autoit tags
theguy0000 Posted December 21, 2006 Posted December 21, 2006 wow theguy those were so beautiful code/autoit tags The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN
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