Azrakan Posted August 15, 2005 Posted August 15, 2005 (edited) hi all, I got a nice working au3 bot for fishing in wow, but it fishes every fish I'd like to add an if statement that is able to check the fish and loot it only if it is the fish I want... I thought I could do so : $check = pixelgetcolor(42,215) If Hex($check, 6) = 0xF7FA40 Then MouseClick("right", 42, 215, 1, 5) ;0xF7FA40 is the color of the pixel at 42,215 of the fish I need ;42,215 is a pixel of the fish in the loot window The only problem is that it doesn't work I think I'm doing syntax errors... please help ^^ The original script is : (I put where I'd like to add this thing) ; AutoIt Version: 3.0 ; Language: English ; Platform: WinXP ; Author: Mibz (Pantless Krab) ; ; Script Function: ; WoW FishBot. ; ; Wow Window Title - World of Warcraft ; WoW Window Size - w1032 x h795 ; classname=GxWindowClassD3d ; Colour of splash - 0xA2A67D ; 0xC1AD7A ; 0xD0C08D ; Position of item - x:44 y:226 ; Position of hotkey 0 - x:409 y:768 ; Prompt the user to run the script using Yes/No prompt $run = MsgBox(4, "FishBot", "Do you want to run FishBot?") ; Exit if "No" If $run = 7 Then Exit EndIf ; Initial shit $time = MsgBox(4, "FishBot - Time of Day?", "Yes = Day | No = Night") WinActivate("World of Warcraft") HotKeySet("{PAUSE}", "EndScript") ; Script Start While 1 Send("0") MouseMove(500, 500) $start = TimerInit() $dif = TimerDiff($start) While 1 If $time = 6 Then $coord = PixelSearch (150, 300, 1024, 560, 0xF6F6F6, 30, 4) Else $coord = PixelSearch (150, 300, 1024, 560, 0xEEEEEE, 55, 3) EndIf ; 5, 300 - 1024, 560 can be changed if you want to search a wider area. ; Not recommended though since you can just adjust your view to fit all ; the water in that space. The bigger the area, the less likely it is to ; detect it. ; If the splash isn't getting detected then change the hex colour to ; something a bit closer. Top one is day, bottom is night. If UBound($coord)>1 Then MouseClick("right", $coord[0], $coord[1], 1, 3) Sleep(500) MouseClick("right", 42, 215, 1, 5) ;this loots every fish ExitLoop Else Sleep(250) $dif = TimerDiff($start) If $dif > 30000 Then ExitLoop EndIf EndIf WEnd WEnd ; Function to exit script Func EndScript() $exit = MsgBox(4, "FishBot", "End FishBot?") If $exit = 6 Then Exit EndIf EndFunc Edited August 15, 2005 by Azrakan
hgeras Posted August 15, 2005 Posted August 15, 2005 (edited) Why did you start a new topic and didnt continue on the old one? I had indicated the mistakes you had....Anyway you have to focus on the syntax of commands....Especially If...Then.... You have misplaced an endif again.... ;Script Start While 1 Send("0") MouseMove(500, 500) $start = TimerInit() While TimerDiff($start) < 30000 If $time = 6 Then $coord = PixelSearch (150, 300, 1024, 560, 0xF6F6F6, 30, 4) Else $coord = PixelSearch (150, 300, 1024, 560, 0xEEEEEE, 55, 3) EndIf If UBound($coord)>1 Then MouseClick("right", $coord[0], $coord[1], 1, 3) Sleep(500) MouseClick("right", 42, 215, 1, 5);this loots every fish ExitLoop Else Sleep(250) Endif WEnd WEnd This is the right code.....I tweaked it also by removing some unwanted lines.Try this and tell me.... EDIT: Typos C ya Edited August 15, 2005 by hgeras Useful information about COM/Objects referenceMy Scripts:PapDefragNvidia Temperature Logger V3.0 with graph analyzerAutoiIt Update Checker And Downloader V1.0ArrayPush UDF
Errorlevel_03 Posted October 3, 2005 Posted October 3, 2005 Tested it, doesnt work right. I hope you know what a spoiler is...[u]"title WOOPS:Var_start "WOOPS" %0goto Var_"-A true n00b at work[/u]
seandisanti Posted October 3, 2005 Posted October 3, 2005 Tested it, doesnt work right.When i'm checking conditions in games, i'll use PixelChecksum() alot. i'll use a tooltip to figure out the checksum of an area of screen (like the line where the fishname would be displayed) when it's what i want it to be, then have the condition just compare the current checksum vs the desired one and respond accordingly.
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