Jump to content

ramadash

Active Members
  • Posts

    70
  • Joined

  • Last visited

ramadash's Achievements

Wayfarer

Wayfarer (2/7)

0

Reputation

  1. Because thats how I coded it and all the pixel locations are relative to the window size (a difference of 1 pixel in window size will change everything)
  2. Ok well I am releasing my old autoit guildwars bot BEWARE: I got banned from it, so use at your own risk. It should be used as reference and maby part of other bots, you should not use it as-is. There are a couple stuff you need I dont remember all of them. But 32bit color and the resolution needs to be 1009x763 with windows classic theme if i remember good. Well I might have some stuff forgotten if you have problems you can pm me i will look further into the requirments you need butI dont really feel like it right now (I dont even know if someone will use this). Main.au3 Opt ( "CaretCoordMode" , 2 ) opt ( "MouseCoordMode" , 2 ) opt ( "PixelCoordMode" , 2 ) ;WINSIZE: 1009 763 WinMinimizeAll() WinActivate( 'Guild Wars' ) WinWaitActive( 'Guild Wars' ) $file = FileOpen( 'log.txt',2) WinMove('Guild Wars','',0,0) MouseClick( 'left', 50, -10 );;è Sleep( 2000 ) ;511/38 _log( '==================================================================================' ) HotKeySet( '9','TooglePause' ) ;configs global $SkillChecksum1 = 629865937 , _ $SkillChecksum2 = 1432347367 , _ $SkillChecksum3 = 548153391 , _ $SkillChecksum4 = 3353687470, _ $SkillChecksum5 = 1037325805, _ $SkillChecksum6 = 789173279, _ $SkillChecksum7 = 0, _ $SkillChecksum8 = 0 global $AttackTimeout_Minotaur = 8*60*1000 , $AttackTimeout_Hydra=20*60*1000, $AttackTimeout_Griffon=10*60*1000 global const $ItemColor_White = 16777215, $ItemColor_Blue = 0x99EEFF, $MonsterColor_Red = 15663104;item colors definition global $SplashText = '' global $SellRun = 5;ID each x runs ;private vars global $VigorousTimer = -1, $DefyTimer = -1, $GladTimer = 11000,$way = 1, $Dead = false, $coretimer = TimerInit(), $paused = false global $FirstBrake = Random( 1*60*60*1000,2*60*60*1000) , $SecondBrake = Random( 2*60*60*1000,4*60*60*1000), $ThirdBrake=Random(4*60*60*1000,6*60*60*1000), $FourthBrake= Random( 6*60*60*1000,9*60*60*1000 ) global $runs = 0, $hours, $mins, $Secs func TooglePause() $paused = not $paused EndFunc #region reference arrays global $Monster[255] $Monster[0] = '98BD9641C9EA99C47A121186A98968A12CA5';level 24 minotaure ;98BD9641C9EA9F6189C47A121186A98968A12CA5;F6189 $Monster[1] = '98BD99896BCF4249C47A121186A98968A12CA5';level 10 minotaure $Monster[2] = '271A99BBAF4DF9F42423D4271F4241';lvl 22 hydra $Monster[3] = '271A99BBAC8F42423D4271F4241';lvl 26 hydra $Monster[4] = '3E9F4DF9643E93D49959D2DC6C186A98968C356498968F4628186A2715';lvl 21 griffon $Monster[5] = '3E8292888F4381312D141312D1E848C8A7D1312D14C81';gordok merchant in ICS $Monster[6] = '98BD9641C9EA9F6189C47A121186A98968A12CA5';level 27 minotaur 98BD9641C9EA9F6189C47A121186A98968A12CA5 $Monster[7] = '18743D998968AF424186A1E186A271A1E84817A123E864989683ED';whiptail devourer $monster[8] = '989681F41271A3E8186A98968138864989683E8A98968F4241';carrion devourer ;$Monster[5] = ''; lvl 26 griffon global $IgnoreItems[255] $IgnoreItems[0] = '3E864F424186A2713E81F4283E8493E1';ice tooth cave $IgnoreItems[1] = '2FB179F4243E84E232FAF8F4241312DF42464271F4241'; skyward reach $IgnoreItems[2] = '4C4DB1F424C83E85F424164F4241';augury rock $IgnoreItems[3] = '3E864271F4244C63C327113882714C4B41874131C941642715';teleport switch $IgnoreItems[4] = '98BDA43ED12C13881998968BB8192713E8141';destinys gorge 98BDA43ED12C13881998968BB8192713E8141 64989683E812C271A5C81312DF4A198BD93E8186A4D99A3ED $IgnoreItems[5] = '6498E4AA3ED64A7A122713E898BD93E8186A98968A4C4B43';bleached bones (grif) $IgnoreItems[6] = 'A7A122713E93D4989683E9'; the scar $IgnoreItems[7] = '271AC8C3564F551F462964F4628186A3264AF4241';captn calaan ;271AC8C3564F551F462964F4628186A3264AF4241 global $KeepItems[7] $KeepItems[0] = '3D927112714C4B4F424127151';warrior tome $KeepItems[1] = '6498968A3E9';lockpick $KeepItems[2] = '138861A8AFA98968F624861DA271D5EDA61A8CD';silver dye $KeepItems[3] = '3E83D9A9C4FB44C4B7EA28138D23E83D9155CC989681'; GRAY $KeepItems[4] = '6461A81FA1927A12641312D43F4E261A8A9DD1';black dye $KeepItems[5] = '2861A82861A862AE8F51E61A8C82626A2CFA2625A1';yellow dye $KeepItems[6] = '4C4B442713D964A7D1F44C35989682625A451';red dye #endregion ;include other files #include <date.au3> #include 'Common.au3' #include 'Minotaur.au3' #include 'hydra.au3' #include 'Griffon.au3' #include 'Griffon_HM.au3' #include 'ElonaLevel.au3' ;ClipPut( getitemcode( $ItemColor_White) ) ;ClipPut( PixelChecksum(576,663,640,716) ) ;Exit ;877,79 ;ClipPut( PixelGetColor( 877,79 ) ) ;SellItems() ;ClearInventory() ;HotKeySet( '9','test' ) ;while 1 ; Sleep( 100 ) ; if PixelChecksum(369,68,401,80,1 ) == 1993648085 then ; MsgBox( 0,'','HEAL SIG' ) ; Exit ; EndIf ;WEnd test() exit func test() WaitEndOfMove( 250 ) EndFunc func WaitEndOfMove($Delay) local $FirstCheck[101], $index = 0, $MultX = 100, $MultY = 70, $MatchPercent = 0 while 1 for $x = 0 to 9 for $y = 0 to 9 $FirstCheck[$index] = PixelGetColor( $x * $MultX, $Y * $MultY ) $index += 1 Next Next Sleep( $Delay ) $MatchPercent = 0 $index = 0 for $x = 0 to 9 for $y = 0 to 9 if PixelGetColor( $x * $MultX, $Y * $MultY ) == $FirstCheck[$index] then $MatchPercent += 1 $index += 1 Next Next SplashTextOn( 'Testing', $MatchPercent, 200, 100, 1010, 0 ) $index = 0 WEnd EndFunc func ClearInventory() Send('m') Sleep( Random( 1000, 1500 ) ) MouseClick( 'Left',500,500,2,1) Sleep( Random( 1000, 1500 ) ) MouseClick( 'Left',650,380) Sleep( Random( 1000, 1500 ) ) MouseClick( 'Left', 469,535,2,1) Sleep( Random( 7000, 10000 ) ) Send( 'v' ) Sleep( Random( 1000, 2000 ) ) if getitemcode( $ItemColor_White ) <> $Monster[5] then return Send( '{SPACE}') Sleep( Random( 5000, 7000 ) ) ;ClipPut( SpecificChecksum( 463,123,653, 145, $ItemColor_White ) ) if SpecificChecksum( 463,123,653, 145, $ItemColor_White ) <> 51 then _log( 'Error opening trade screen' ) ;MsgBox( 0,'','ERROR OPENING TRAde sacreen' ) return false EndIf MouseClick( 'Left',560,106 ) Sleep( 2000 ) $lastsum = 0 while 1 if SellItems() then _log('sellitems return true continue loop') continueloop Else _log('sellitems return false') MouseMove( 769, 351 ) MouseWheel( 'down', 5 ) if $lastsum = 0 then _log( 'lastsum=' & $lastsum ) $lastsum = PixelChecksum( 950,252,962,388, 1 ) _log( 'lastsum=' & $lastsum ) ContinueLoop EndIf _log( 'Lastsum=' & $lastsum & ' Currentsum=' & PixelChecksum( 950,252,962,388, 1 ) ) Sleep( Random( 50, 100 ) ) if $lastsum == PixelChecksum( 950,252,962,388, 1 ) then return $lastsum = PixelChecksum( 950,252,962,388, 1 ) EndIf WEnd EndFunc func SellItems() dim $ItemsArray[6][2] $ItemsArray[0][0] = 0 $ItemsArray[1][0] = 0 $ItemsArray[2][0] = 0 $ItemsArray[3][0] = 0 $ItemsArray[4][0] = 0 $ItemsArray[5][0] = 0 local $InvLeft = 505, $InvTop = 228, $invRight = 745, $InvBottom = 392;the square to scan for items local $numPixelsFound = 0, $ConsecutiveLines = 0, $ItemsArrayIndex = 0 for $y = $InvTop to $InvBottom;scan top to bottom... for $x = $InvLeft to $invRight;... left to right if PixelGetColor( $x, $y ) == $ItemColor_White then $numPixelsFound += 1;get the total pixels per lines Next if $numPixelsFound < 2 then ;this line is empty ;_log( $y & ' is empty' ) if $ConsecutiveLines > 3 then ;this means we found an item and are at the end of it _log( 'Item end found, Start = ' & $y - $ConsecutiveLines & ' End = ' & ($y - 1) & ' Size = ' & $ConsecutiveLines ) _log( 'Item code = ' & SpecificChecksum( $InvLeft, $y - $ConsecutiveLines, $invRight, $y - 1, $ItemColor_White ) ) $ItemsArray[$ItemsArrayIndex][0] = $y - $ConsecutiveLines $ItemsArray[$ItemsArrayIndex][1] = $y - 1 $ItemsArrayIndex +=1;increase the index EndIf $ConsecutiveLines = 0 Else ;this line contains white pixels _log( $y & ' contains white pixels. Total pixels found: ' & $numPixelsFound ) $ConsecutiveLines += 1 EndIf $numPixelsFound = 0 Next local $LastItem = 5 for $i = 0 to 5 if $ItemsArray[$i][0] == 0 then $LastItem = $i ExitLoop EndIf Next dim $SellItems[6] $SellItems[0] = false $SellItems[1] = false $SellItems[2] = false $SellItems[3] = false $SellItems[4] = false $SellItems[5] = false local $continueloop for $i = 0 to $LastItem;-1 $continueloop = true Switch( $i ) case 1 for $x = $InvLeft to $invRight;... left to right if PixelGetColor( $x, $InvTop -1 ) == $ItemColor_White Then $SellItems[0] = False $continueloop = false EndIf Next case 5 for $x = $InvLeft to $invRight;... left to right if PixelGetColor( $x, $InvBottom + 1 ) == $ItemColor_White then $SellItems[5] = false $continueloop = false EndIf Next EndSwitch if not $ContinueLoop then ContinueLoop if $i > 5 then ExitLoop _log( 'Selling item #' & $i & ' to true' ) $SellItems[$i] = true $ItemCode = SpecificChecksum( $InvLeft,$ItemsArray[$i][0],$invRight,$ItemsArray[$i][1], $ItemColor_White ) _log($ItemCode) for $a = 0 to UBound( $KeepItems ) - 1 if $ItemCode == $KeepItems[$a] then _log( 'Item is in keep items list. current item: ' & $ItemCode & ' List item: ' & $KeepItems[$a] ) $SellItems[$i] = false ExitLoop EndIf Next Next for $i = 0 to 5 if $SellItems[$i] == true then if $ItemsArray[$i][0] < $InvTop then ContinueLoop;this is a GAY bug, sometime i click out of inv (I think y = 0) must investigate, this is a temp fix _log( 'Selling item #' & $i ) ;todo sell item MouseClick( 'left', $InvLeft + 50, $ItemsArray[$i][0] + 4 ) Sleep( Random( 1000, 2000 ) ) MouseClick( 'left',799,597 ) Sleep( Random( 1000, 2000 ) ) return true Else _log( 'Dosent selling item #' & $i ) EndIf Next return False ;if return false it means no item is sold, so scrool or if at end exit, return true will ONLY sell 1 item. EndFunc func SpecificChecksum($left, $top, $right, $bottom, $color) local $LastFound, $ConsecutiveFails = 0, $TotalColors = 0 local $sum2[255];array of bytes local $sum = 0, $index = 1, $byteIndex = 0,$started = false for $x5 = $right to $left step -3 for $y5 = $Bottom to $Top - 14 step -3 if PixelGetColor( $x5, $y5 ) == $color then $sum += $index $started = true EndIf if not $started then ContinueLoop $index = $index *2 if $index > 4294967295 then ;add the byte into the array $sum2[$byteIndex] = Hex( $sum ) $sum = 0 $byteIndex += 1 $index = 1 EndIf Next Next ;built the string off the bytes $bytestring = '' for $i = $byteIndex to 0 step -1 $bytestring &= Hex( $sum2[$i] ) Next $bytestring = StringReplace( $bytestring, '0','') return $bytestring EndFunc while 1 global $RunTracker = 0 while not $paused _TicksToTime( TimerDiff( $coretimer ), $hours, $mins,$Secs ) $SplashText = @CRLF & 'Total runs: ' & $runs & @CRLF & 'Next inv clearance: ' & $SellRun - $RunTracker _ & @CRLF & 'Total run time: ' & $hours & ':' & $mins SplashTextOn( 'State','Starting a new run'&$SplashText,200,400,1010,0) $runs += 1 LeaveArea_ElonaLevel() Attack_ElonaLevel() GoBack_ElonaLevel() ;TravelTo_NorthWall() ;LeaveArea_NorthWall() ;Send( 'c' ) ;Sleep( Random( 500, 1000 ) ) ;$Timer = TimerInit() ;while TimerDiff( $Timer ) < Random( 2*60*1000, 4*60*1000 ) ; while StringInStr( getitemcode( $ItemColor_White ), '98968' ) and TimerDiff( $Timer ) < Random( 2*60*1000, 4*60*1000 ) ; Sleep( Random( 500, 1000 ) ) ; Send( 'c' ) ; Sleep( Random( 200, 1000 ) ) ; Send( '{SPACE}' ) ; Sleep( Random( 500, 1000 ) ) ; Send( '1' ) ; Sleep( Random( 500, 1000 ) ) ; Send( '2' ) ; Sleep( Random( 500, 1000 ) ) ; if getlifepercent() < 50 then ; Send( '7' ) ; Sleep( Random( 500, 1000 ) ) ; EndIf ; WEnd ; Send( 'c' ) ; Sleep( Random( 500, 900 ) ) ; if not StringInStr( getitemcode( $ItemColor_White ), '98968' ) then ExitLoop ;; WEnd ;for $i = ;travelto_hydra() ;SetDiff(1) ;SetSkillTemplate(1) ;LeaveArea_Hydra() ;Reach_Hydra() ;Main_Hydra() ;travelto_minotaur() ;SetDiff(1) ;SetSkillTemplate(3) ;main_minotaur() ;travelto_Griffon() ;while not LeaveArea_Griffon() ; travelto_minotaur() ; travelto_Griffon() ; WEnd ; Main_Griffon() ;travelto_Griffon_HM() ;while not LeaveArea_Griffon_HM() ; travelto_minotaur() ; travelto_Griffon_HM() ;WEnd ;Main_Griffon_HM() ;if $RunTracker >= $SellRun then ; $RunTracker = 0 ; ClearInventory() ;EndIf ;$RunTracker += 1 ;$runs += 1 WEnd WEnd func TravelTo_NorthWall() Send( 'm' ) Sleep( Random( 500, 1000 ) ) MouseClick( 'left', 291, 425, 2, 5 ) Sleep( Random( 1000, 2000 ) ) MouseClick( 'left', 867, 137, 1, 5 ) Sleep( Random( 1000, 2000 ) ) MouseClick( 'left', 548, 492, 2, 5 ) Sleep( Random( 8000, 10000 ) ) EndFunc func LeaveArea_NorthWall() MouseClick( 'left', 881, 667, 1, 5 ) Sleep( Random( 1000, 3000 ) ) MouseClick( 'left', 510, 403, 1, 5 ) Sleep( Random( 7000, 10000 ) ) ;Send( '{w down}' ) ;Sleep( 8500 ) ;Send( '{w up}' ) ;Send( '{}' ) ;MouseClick( 'left', 407, 388, 1, 5 ) Send( '{w down}' ) Sleep( Random( 100, 500 ) ) Send( '{w down}' ) Sleep( Random( 1000, 1500 ) ) $Timer = TimerInit() while not targetmatch( $IgnoreItems[7], getitemcode( $ItemColor_White ) ) and TimerDiff( $Timer ) < Random( 15000, 20000 ) Send( 'v' ) Sleep( Random( 500, 700 ) ) WEnd Send( '{w up}' ) Send( '{SPACE}' ) Sleep( Random( 7000, 8000 ) ) Send( '{e down}' ) Sleep( Random( 3000, 4000 ) ) Send( '{e up}' ) EndFunc Common.au3 ;TODO func func MissionMap( $Action ) ;1 = open 2 = close ;TODO EndFunc ;detect if a monster is within aggro are, true = monster in aggro, false = no monster in aggro Func ScanAggro() ;PixelSearch( 826,122,882,172,$MonsterColor_Red,10,1 ) ;if @error then ; Sleep( 100 ) ; PixelSearch( 826,122,882,172,$MonsterColor_Red,10,1 ) ; if @error then return false ;EndIf ;return True PixelSearch( 4,74,755,616,$MonsterColor_Red,10,1 ) if @error then Sleep( 100 ) PixelSearch( 4,74,755,616,$MonsterColor_Red,10,1 ) if @error then return false EndIf return True EndFunc ;set difficulty, 0=normal 1=hard Func SetDiff( $ID ) Switch( $ID ) case 0 MouseClick( 'left',790,352 ) Sleep( 500 ) case 1 MouseClick( 'left',829,352 ) Sleep( 500 ) EndSwitch EndFunc ;check if the desired skill is available func SkillAvailable($Location) ;location = 1 to 8 Switch $location case 1 if PixelChecksum(239,663,291,716) == $SkillChecksum1 then return true Case 2 if PixelChecksum(306,663,359,716) == $SkillChecksum2 then return true Case 3 if PixelChecksum(376,663,424,716) == $SkillChecksum3 then return true ;temp fix this is for watch yourself if PixelChecksum(376,663,424,716) == 3441050876 then return true case 4 if PixelChecksum(444,663,496,716) == $SkillChecksum4 then return true ;temps fix this is for glad defence if PixelChecksum(444,663,496,716) == 2655215 then return true case 5 if PixelChecksum(510,663,564,716) == $SkillChecksum5 then return true case 6 if PixelChecksum(576,663,640,716) == $SkillChecksum6 then return true case 7 EndSwitch return false EndFunc ;return mana % func GetManaPercent() local $LifeIndex = -1 for $x = 517 to 760 if PixelGetColor( $x, 644 ) == 7502 then $LifeIndex = $x ExitLoop EndIf Next if $LifeIndex = -1 then return 100 return Round( ( ( $LifeIndex - 517 ) / 243 ) * 100 ) - 6 EndFunc ;return life % func GetLifePercent() local $LifeIndex = -1 for $x = 246 to 493 if PixelGetColor( $x, 644 ) == 5711645 then $LifeIndex = $x ExitLoop EndIf Next if $LifeIndex = -1 then return 100 return Round( ( ( $LifeIndex - 246 ) / 247 ) * 100 ) EndFunc ;check if a target match (used on monster because it dosent match 100% due to health bar func TargetMatch( $Target, $StringReturned ) local $strLen = StringLen( $Target ), $MatchedChars = 0 if StringLen( $StringReturned ) < $strLen then $strLen = StringLen( $StringReturned ) for $i = 1 to $strLen if StringMid( $Target, $i, 1 ) == StringMid( $StringReturned, $i, 1 ) then $MatchedChars += 1 Next _log( 'Targetmatch: ' & $MatchedChars / $strLen ) if $MatchedChars / $strLen > 0.9 then return true return false EndFunc ;get the item code off a focused item func GetItemCode( $color ) local $Left = 360, $Top = 28, $Right = 653, $Bottom = 49 local $LastFound, $ConsecutiveFails = 0, $TotalColors = 0 local $sum2[255];array of bytes local $sum = 0, $index = 1, $byteIndex = 0,$started = false for $x5 = $right to $left step -3 for $y5 = $Bottom to $Top - 14 step -3 if PixelGetColor( $x5, $y5 ) == $color then $sum += $index $started = true EndIf if not $started then ContinueLoop $index = $index *2 if $index > 4294967295 then ;add the byte into the array $sum2[$byteIndex] = Hex( $sum ) $sum = 0 $byteIndex += 1 $index = 1 EndIf Next Next ;built the string off the bytes $bytestring = '' for $i = $byteIndex to 0 step -1 $bytestring &= Hex( $sum2[$i] ) Next $bytestring = StringReplace( $bytestring, '0','') return $bytestring EndFunc ;do some random stuff to avoid detection func DoRandomStuff() $bet = Random( 0, 100 ) Select case $bet > -1 and $bet < 10 return case $bet > 10 and $bet < 20 Send( '{enter}' ) Sleep( Random( 1000, 9000 ) ) Send( '/dance' ) Sleep( Random( 500, 2000 ) ) Send( '{enter}' ) Sleep( Random( 30000, 5*60*1000 ) ) case $bet > 20 and $bet < 30 Sleep( Random( 1000,2000 ) ) case $bet > 30 and $bet < 40 Sleep( Random( 100,1000 ) ) case $bet > 40 and $bet < 50 Sleep( Random( 10 * 1000,20*1000 ) ) case $bet > 50 and $bet < 60 Sleep( Random( 5*60*1000, 1*60*1000) ) case $bet > 60 and $bet < 70 Sleep( Random( 100,120*1000 ) ) case $bet > 70 and $bet < 80 Sleep( Random( 10,100 ) ) case $bet > 80 and $bet < 90 Send( '{enter}' ) Sleep( Random( 1000, 9000 ) ) Send( '/dance' ) Sleep( Random( 500, 2000 ) ) Send( '{enter}' ) Sleep( Random( 100,10000 ) ) case $bet > 90 and $bet < 101 Sleep( Random( 10,50 ) ) EndSelect EndFunc func _log( $string ) FileWriteLine( $file, $String ) EndFunc func TakeBreak() return if $FirstBrake > 0 then if TimerDiff( $coretimer ) > $FirstBrake then $FirstBrake = -1 $sleep = Random( 5, 35 ) for $i = 0 to $Sleep MouseMove( Random( 0, 800 ) ,Random(0,600) ) Sleep( 60*1000 ) Next endif ElseIf $SecondBrake > 0 then if TimerDiff( $coretimer ) > $SecondBrake then $SecondBrake = -1 $sleep = Random( 5, 35 ) for $i = 0 to $Sleep MouseMove( Random( 0, 800 ) ,Random(0,600) ) Sleep( 60*1000 ) Next endif ElseIf $ThirdBrake > 0 then if TimerDiff( $coretimer ) > $ThirdBrake then $ThirdBrake = -1 $sleep = Random( 5, 35 ) for $i = 0 to $Sleep MouseMove( Random( 0, 800 ) ,Random(0,600) ) Sleep( 60*1000 ) Next endif ElseIf $FourthBrake > 0 then if TimerDiff( $coretimer ) > $FourthBrake then $FourthBrake = -1 $sleep = Random( 5, 35 ) for $i = 0 to $Sleep MouseMove( Random( 0, 800 ) ,Random(0,600) ) Sleep( 60*1000 ) Next EndIf EndIf EndFunc func SetSkillTemplate($ID) Send( 'k' ) Sleep( Random( 2000, 3000 ) ) mouseclick( 'left', 192,118 ) Sleep( Random( 400, 800 ) ) MouseClick( 'left',276,160) Sleep( Random( 1000, 2000 ) ) switch $ID case 1 ;hydras MouseClick( 'left' , 274,207, 2, 1 ) Sleep( Random( 1000, 2000 ) ) case 2 Sleep( Random( 1000, 2000 ) ) case 3 ;minotaur griffons MouseClick( 'left',311,255,2,1 ) Sleep( Random( 1000, 2000 ) ) EndSwitch Send('{escape}') Sleep( Random( 1000, 2000 ) ) EndFunc ElonaLevel.au3 (I used this for leveling my monk...) func LeaveArea_ElonaLevel() MouseClick( 'Left', Random( 855,895), Random( 650,670 ) , 1, Random( 3, 6 ) ) Sleep( Random( 1000, 2000 ) ) MouseClick( 'Left', Random( 495, 520 ), Random( 407, 419 ), 1, Random( 2, 6 ) ) Sleep( Random( 8000, 13000 ) ) ;PRECAST Send( '8' ) Sleep( Random( 5000, 8000 ) ) Send( '7' ) Sleep( Random( 4000, 7000 ) ) Send( '6' ) local $MinimumMana = Random( 50, 99 ) While $MinimumMana > GetManaPercent() Sleep( Random( 5, 1500 ) ) WEnd Send( 'v' ) Sleep( Random( 400, 2000 ) ) Send( '{SPACE}' ) Sleep( Random( 10000, 11000 ) ) MouseClick( 'Left', Random( 475, 515 ), Random( 550, 570 ), 1, Random( 1, 7 ) ) Sleep( Random( 500, 1500 ) ) Send( '{w down}' ) Sleep( Random( 4000, 7000 ) ) Send( '{w up}' ) EndFunc func Attack_ElonaLevel() Send( 'c' ) Sleep( Random( 300, 600 ) ) Send( '{SPACE}' ) Sleep( Random( 1000, 2000 ) ) Send( '5' ) Sleep( Random( 500, 800 ) ) local $Timer = TimerInit() while ScanAggro() and TimerDiff( $Timer ) < 2*60*1000 ;local $SendTarget = Random( 1, 4 ) ;if $SendTarget == 1 then Send( 'c' ) Sleep( Random( 300, 900 ) ) ;EndIf Send( '{SPACE}' ) Sleep( Random( 900, 1300 ) ) Send( '5' ) Sleep( Random( 900, 1300 ) ) Send( '4' ) Sleep( Random( 900, 1300 ) ) Send( '2' ) Sleep( Random( 1200, 1600 ) ) Send( '1' ) Sleep( Random( 1000, 1400 ) ) Send( '3' ) if not ScanAggro() then ExitLoop if getlifepercent() < 10 then return Sleep( Random( 6000, 7000 ) ) WEnd Send( 'c' ) Sleep( Random( 500, 900 ) ) Send( '{SPACE}' ) Sleep( Random( 900, 1500 ) ) $Timer = TimerInit() while ScanAggro() and TimerDiff( $Timer ) < 2*60*1000 ;local $SendTarget = Random( 1, 4 ) ;if $SendTarget == 1 then Sleep( Random( 900, 1300 ) ) Send( '5' ) Sleep( Random( 900, 1300 ) ) Send( '4' ) Sleep( Random( 900, 1300 ) ) Send( '2' ) Sleep( Random( 1200, 1600 ) ) Send( '1' ) Sleep( Random( 1000, 1400 ) ) Send( '3' ) if not ScanAggro() then ExitLoop if getlifepercent() < 10 then return Sleep( Random( 6000, 7000 ) ) WEnd if getlifepercent() < 10 then return Send( ';' ) Sleep( Random(100, 700) ) Send( '{space}' ) Sleep( Random( 3000, 7000 ) ) Send( ';' ) Sleep( Random(300, 700) ) Send( '{space}' ) Sleep( Random( 3000, 7000 ) ) EndFunc func GoBack_ElonaLevel() if getlifepercent() > 10 then Send( '{ENTER}' ) Sleep( Random( 700, 1000 ) ) Send( '/resign' ) Sleep( Random( 1000, 2300 ) ) Send( '{ENTER}' ) Sleep( Random( 3000, 6000 ) ) endif MouseClick( 'Left', Random( 460, 530 ), Random( 381, 390 ),1, Random( 1, 9 ) ) Sleep( Random( 10000, 15000 ) ) EndFunc Griffon.au3 func Main_Griffon() local $Failcount, $PickitTimer , $PickitTimeout = 10*60*1000 local $AttackTimer = TimerInit() local $AttackRandom = Random ( 1000, 2000 ) local $LastLife = GetLifePercent() while TimerDiff( $AttackTimer ) < ( $AttackTimeout_Griffon + $AttackRandom ) for $i = 0 to 200 if ScanAggro() then ExitLoop Sleep( 100 ) if $LastLife > GetLifePercent() then ExitLoop $LastLife = GetLifePercent() Next if not Attack_Griffon() then ExitLoop while ScanAggro() or $LastLife > GetLifePercent() or ( $LastLife - GetLifePercent() ) < -2 if StringInStr( GetItemCode( $ItemColor_White ), 'F6189' ) then ;this iis a boss minotaur lvl 27 while StringInStr( GetItemCode( $ItemColor_White ), 'F6189' ) ;98BD9641C9EA9F6189C47A121186A98968A12CA5 Send( '2' ) Sleep( Random( 500, 1000 ) ) if SkillAvailable( 4 ) Then Send( '4' ) Sleep( Random( 500, 1600 ) ) EndIf WEnd EndIf _log( 'ScanAggro true attacking minotaur' ) if not Attack_Griffon() then ExitLoop if GetLifePercent() < 10 then $dead = true ExitLoop 2 EndIf $LastLife = GetLifePercent() WEnd local $Failcount = 0, $PickitTimer = TimerInit(), $PickitTimeout = 10*60*1000 while not ( TargetMatch( $IgnoreItems[4],GetItemCode( $ItemColor_White ) ) ) and not ( TargetMatch( $IgnoreItems[3],GetItemCode( $ItemColor_White ) ) ) and TimerDiff( $PickitTimer ) < $PickitTimeout if GetItemCode( $ItemColor_White ) == '' then $Failcount += 1 if $Failcount > 5 then ExitLoop endif Send( ';' ) Sleep( Random(100, 700) ) Send( '{space}' ) Sleep( Random( 100, 700 ) ) if GetLifePercent() < 10 then ExitLoop EndIf WEnd WEnd local $Failcount = 0, $PickitTimer = TimerInit(), $PickitTimeout = 10*60*1000 while not ( TargetMatch( $IgnoreItems[4],GetItemCode( $ItemColor_White ) ) ) and not ( TargetMatch( $IgnoreItems[3],GetItemCode( $ItemColor_White ) ) ) and TimerDiff( $PickitTimer ) < $PickitTimeout if GetItemCode( $ItemColor_White ) == '' then $Failcount += 1 if $Failcount > 5 then ExitLoop endif Send( ';' ) Sleep( Random(100, 700) ) Send( '{space}' ) Sleep( Random( 100, 700 ) ) if GetLifePercent() < 10 then ExitLoop EndIf WEnd EndFunc func Attack_Griffon() ;check health to stop ... blablabla local $skip = False ;check dolyak signet first always if SkillAvailable( 5 ) then _log( 'casting dolyak' ) Send( '5' ) Sleep( Random(100,300) ) Send( '6' ) Sleep( Random( 300, 400 ) ) if not SkillAvailable(6) THEN $VigorousTimer = TimerInit() ;check vigorous spirit (30% mana atleast on 20mana) elseIf $VigorousTimer == -1 or TimerDiff( $VigorousTimer ) > Random( 15000, 20000 ) then _log( 'casting vigorous spirit' ) ;well we gota cast it $VigorousTimer = -1 for $i = 0 to Random( 1, 3 ) Send( '6' ) Sleep( Random(100,300) ) Next Sleep( Random( 300, 400 ) ) if not SkillAvailable(6) THEN $VigorousTimer = TimerInit() ;glad defence elseif SkillAvailable( 4 ) Then _log( 'casting glad defence' ) Send( '4' ) Sleep( Random( 100, 300 )) $GladTimer = TimerInit() ;riposte elseif SkillAvailable( 2 ) then _log( 'casting riposte' ) Send( '2' ) Sleep( Random( 100,300 ) ) ;flurry ElseIf SkillAvailable(1) and GetManaPercent() > 24 and TimerDiff($GladTimer) > 10000 Then _log( 'casting flurry' ) Send( '1' ) Sleep( Random( 100, 300 ) ) ;watch urself elseif SkillAvailable(3) and GetManaPercent() > 24 then _log( 'casting watch urself' ) Send( '3' ) Sleep( Random( 100, 300 ) ) EndIf Send( 'c' ) Sleep( Random ( 50, 150 ) ) Send( '{space}' ) Sleep( random( 50, 150) ) if not TargetMatch( $Monster[4], GetItemCode( $ItemColor_White ) ) then Sleep( Random( 300, 500 ) ) Send( 'c' ) Sleep( Random ( 50, 150 ) ) Send( '{space}' ) if not TargetMatch($Monster[4], GetItemCode( $ItemColor_White ) ) then return false EndIf return True EndFunc ;SplashTextOn( 'State',''&$SplashText,200,400,1010,0) func LeaveArea_Griffon() SplashTextOn( 'State','Leaving Destiny gorge. Destination: the scar' &$SplashText,200,400,1010,0) Send( ';' ) Sleep( Random( 1000, 2000 ) ) if GetItemCode( $ItemColor_White ) <> $IgnoreItems[6] then Send( 'è' ) Sleep( Random( 1000, 2000 ) ) if GetItemCode( $ItemColor_White ) <> $IgnoreItems[6] then SplashTextOn( 'State','Failed to find the scar'&$SplashText,200,400,1010,0) return false EndIf EndIf Sleep( Random( 500, 1000 ) ) Send( '{SPACE}' ) Sleep( Random( 7000, 9000 ) ) Send( 'u' ) Sleep( Random( 100, 300 ) ) ;180,241 local $GoOutsideTimer = TimerInit(), $GoOutsideTimeout = 20000 SplashTextOn( 'State','Searching the right orientation to leave town'&$SplashText,200,400,1010,0) while 1 Sleep( 100 ) PixelSearch( 178, 239, 183, 244 , 5435218,0,1 ) if not @error then ExitLoop Send( '{d down}' ) Sleep( 50 ) Send( '{d up}' ) if TimerDiff( $GoOutsideTimer ) > $GoOutsideTimeout then Send( '{s down}' ) Sleep( Random(3000,7000) ) Send( '{s up}' ) ExitLoop EndIf WEnd Sleep( 500 ) Send('{w down}') Sleep( 500 ) Send('{w down}') SplashTextOn( 'State','Going outside'&$SplashText,200,400,1010,0) local $GoOutsideTimer = TimerInit(), $GoOutsideTimeout = 20000 While 1 $pix1 = PixelGetColor( 200,20 ) $pix2 = PixelGetColor( 220,20 ) $pix3 = PixelGetColor( 240,20 ) $pix4 = PixelGetColor( 260,20 ) $pix5 = PixelGetColor( 280,20 ) $pix6 = PixelGetColor( 300,20 ) if $pix1 == 0x000000 and $pix1 == $pix2 and $pix1 == $pix3 and $pix1 == $pix4 and $pix1 == $pix5 and $pix1 == $pix6 then ExitLoop if TimerDiff( $GoOutsideTimer ) > $GoOutsideTimeout then ExitLoop WEnd Send('{w up}') Sleep(Random(500,1000)) $GoOutsideTimer = TimerInit() while PixelGetColor( 200,20 ) == 0x000000 and PixelGetColor( 300,20 ) == 0x000000 SplashTextOn( 'State','Loading...'&$SplashText,200,400,1010,0) Sleep( Random(800, 1000) ) if TimerDiff( $GoOutsideTimer ) > $GoOutsideTimeout then ExitLoop WEnd Sleep( random( 1000, 2000 ) ) Send( 'u' ) SplashTextOn( 'State','Casting balthazar aura'&$SplashText,200,400,1010,0) Sleep( Random( 500, 1500 ) ) Send( '8' ) SplashTextOn( 'State','Moving up'&$SplashText,200,400,1010,0) Sleep( Random( 4000,5000 ) ) ;Send( 'é' ) ;Sleep( Random( 500, 1000 ) ) ;MouseClick( 'left', 565, 465, 1, 1 ) ;Sleep( Random( 500, 1000 ) ) Send( '{w down}' ) Sleep( Random( 2000, 3000 ) ) Send( '{w up}' ) local $GoOutsideTimer = TimerInit(), $GoOutsideTimeout = 25000 Sleep( Random( 1000, 2000 ) ) Send('{q down}') while TimerDiff( $GoOutsideTimer ) < $GoOutsideTimeout SplashTextOn( 'State','Searching for griffons...'&$SplashText,200,400,1010,0) Send( 'c' ) if TargetMatch($Monster[4], GetItemCode( $ItemColor_White ) ) then SplashTextOn( 'State','Griffon found'&$SplashText,200,400,1010,0) ExitLoop EndIf Sleep( Random( 100, 5000 ) ) Send('{q down}') WEnd Send('{q up}') Sleep( Random( 500, 1500 ) ) SplashTextOn( 'State','Casting Live visomething'&$SplashText,200,400,1010,0) Send( '7' ) Sleep( Random( 3000, 5000 ) ) if not TargetMatch($Monster[4], GetItemCode( $ItemColor_White ) ) Then SplashTextOn( 'State','Failed to find griffons, heading right a little'&$SplashText,200,400,1010,0) Send( 'c' ) Sleep( Random( 1000, 2000 ) ) Send('{e down}') Sleep( Random( 2000, 3000 ) ) Send('{e up}') EndIf Sleep( Random( 500, 1500 ) ) Send( 'c' ) Sleep( Random( 500, 1000 ) ) if not TargetMatch($Monster[4], GetItemCode( $ItemColor_White ) ) Then SplashTextOn( 'State','Failed to find griffons, heading straight'&$SplashText,200,400,1010,0) local $GoOutsideTimer = TimerInit(), $GoOutsideTimeout = 15000 Send('{w down}') Sleep( 500 ) while TimerDiff( $GoOutsideTimer ) < $GoOutsideTimeout Send( 'c' ) if TargetMatch($Monster[4], GetItemCode( $ItemColor_White ) ) then ExitLoop Sleep( Random( 100, 5000 ) ) WEnd Send('{w up}') EndIf SplashTextOn( 'State','We have now reached griffons'&$SplashText,200,400,1010,0) local $GoOutsideTimer = TimerInit(), $GoOutsideTimeout = 10000 while TimerDiff( $GoOutsideTimer ) < $GoOutsideTimeout Send( 'c' ) Sleep( Random( 200, 300 ) ) Send( '{SPACE}' ) Sleep( Random( 200, 300 ) ) if ScanAggro() then ExitLoop WEnd return true EndFunc Func TravelTo_Griffon() Send('m') Sleep( Random( 1000, 1500 ) ) MouseClick( 'Left',500,500,2,1) Sleep( Random( 1000, 1500 ) ) MouseClick( 'Left',863,559) Sleep( Random( 1000, 1500 ) ) MouseClick( 'Left', 417,518,2,1) Sleep( Random( 7000, 10000 ) ) EndFunc GriffonHM.au3 func Main_Griffon_HM() local $Failcount, $PickitTimer , $PickitTimeout = 10*60*1000 local $AttackTimer = TimerInit() local $AttackRandom = Random ( 1000, 2000 ) local $LastLife = GetLifePercent() while TimerDiff( $AttackTimer ) < ( $AttackTimeout_Griffon + $AttackRandom ) for $i = 0 to 200 if ScanAggro() then ExitLoop Sleep( 100 ) if $LastLife > GetLifePercent() then ExitLoop $LastLife = GetLifePercent() Next if not Attack_Griffon_HM() then ExitLoop while ScanAggro() or $LastLife > GetLifePercent() or ( $LastLife - GetLifePercent() ) < -2 _log( 'ScanAggro true attacking minotaur' ) if not Attack_Griffon() then ExitLoop if GetLifePercent() < 10 then $dead = true ExitLoop 2 EndIf $LastLife = GetLifePercent() WEnd local $Failcount = 0, $PickitTimer = TimerInit(), $PickitTimeout = 10*60*1000 while not ( TargetMatch( $IgnoreItems[4],GetItemCode( $ItemColor_White ) ) ) and not ( TargetMatch( $IgnoreItems[3],GetItemCode( $ItemColor_White ) ) ) and TimerDiff( $PickitTimer ) < $PickitTimeout if GetItemCode( $ItemColor_White ) == '' then $Failcount += 1 if $Failcount > 5 then ExitLoop endif Send( ';' ) Sleep( Random(100, 700) ) Send( '{space}' ) Sleep( Random( 100, 700 ) ) if GetLifePercent() < 10 then ExitLoop EndIf WEnd WEnd local $Failcount = 0, $PickitTimer = TimerInit(), $PickitTimeout = 10*60*1000 while not ( TargetMatch( $IgnoreItems[4],GetItemCode( $ItemColor_White ) ) ) and not ( TargetMatch( $IgnoreItems[3],GetItemCode( $ItemColor_White ) ) ) and TimerDiff( $PickitTimer ) < $PickitTimeout if GetItemCode( $ItemColor_White ) == '' then $Failcount += 1 if $Failcount > 5 then ExitLoop endif Send( ';' ) Sleep( Random(100, 700) ) Send( '{space}' ) Sleep( Random( 100, 700 ) ) if GetLifePercent() < 10 then ExitLoop EndIf WEnd EndFunc func Attack_Griffon_HM() ;check health to stop ... blablabla local $skip = False ;check dolyak signet first always if PixelChecksum( 369,68,401,80,1 ) == 1993648085 then Send( '6' ) Sleep( Random( 500, 1500 ) ) EndIf if SkillAvailable( 5 ) then _log( 'casting dolyak' ) Send( '5' ) ;Sleep( Random(100,300) ) ;Send( '6' ) Sleep( Random( 300, 400 ) ) ;if not SkillAvailable(6) THEN $VigorousTimer = TimerInit() ;check vigorous spirit (30% mana atleast on 20mana) ;elseIf $VigorousTimer == -1 or TimerDiff( $VigorousTimer ) > Random( 15000, 20000 ) then ; _log( 'casting vigorous spirit' ) ;;well we gota cast it ; $VigorousTimer = -1 ; for $i = 0 to Random( 1, 3 ) ; Send( '6' ) ; Sleep( Random(100,300) ) ; Next ; Sleep( Random( 300, 400 ) ) ; if not SkillAvailable(6) THEN $VigorousTimer = TimerInit() ;glad defence elseif SkillAvailable( 4 ) Then _log( 'casting glad defence' ) Send( '4' ) Sleep( Random( 100, 300 )) $GladTimer = TimerInit() ;riposte elseif SkillAvailable( 2 ) then _log( 'casting riposte' ) Send( '2' ) Sleep( Random( 100,300 ) ) ;flurry ElseIf SkillAvailable(1) and GetManaPercent() > 24 and TimerDiff($GladTimer) > 10000 Then _log( 'casting flurry' ) Send( '1' ) Sleep( Random( 100, 300 ) ) ;watch urself ;elseif SkillAvailable(3) and GetManaPercent() > 24 then ; _log( 'casting watch urself' ) ; Send( '3' ) ; Sleep( Random( 100, 300 ) ) EndIf Send( 'c' ) Sleep( Random ( 50, 150 ) ) Send( '{space}' ) Sleep( random( 50, 150) ) if not TargetMatch( $Monster[4], GetItemCode( $ItemColor_White ) ) then Sleep( Random( 300, 500 ) ) Send( 'c' ) Sleep( Random ( 50, 150 ) ) Send( '{space}' ) if not TargetMatch($Monster[4], GetItemCode( $ItemColor_White ) ) then return false EndIf return True EndFunc ;SplashTextOn( 'State',''&$SplashText,200,400,1010,0) func LeaveArea_Griffon_HM() SplashTextOn( 'State','Leaving Destiny gorge. Destination: the scar' &$SplashText,200,400,1010,0) Send( ';' ) Sleep( Random( 1000, 2000 ) ) if GetItemCode( $ItemColor_White ) <> $IgnoreItems[6] then Send( 'è' ) Sleep( Random( 1000, 2000 ) ) if GetItemCode( $ItemColor_White ) <> $IgnoreItems[6] then SplashTextOn( 'State','Failed to find the scar'&$SplashText,200,400,1010,0) return false EndIf EndIf Sleep( Random( 500, 1000 ) ) Send( '{SPACE}' ) Sleep( Random( 7000, 9000 ) ) Send( 'u' ) Sleep( Random( 100, 300 ) ) ;180,241 local $GoOutsideTimer = TimerInit(), $GoOutsideTimeout = 20000 SplashTextOn( 'State','Searching the right orientation to leave town'&$SplashText,200,400,1010,0) while 1 Sleep( 100 ) PixelSearch( 178, 239, 183, 244 , 5435218,0,1 ) if not @error then ExitLoop Send( '{d down}' ) Sleep( 50 ) Send( '{d up}' ) if TimerDiff( $GoOutsideTimer ) > $GoOutsideTimeout then Send( '{s down}' ) Sleep( Random(3000,7000) ) Send( '{s up}' ) ExitLoop EndIf WEnd Sleep( 500 ) Send('{w down}') Sleep( 500 ) Send('{w down}') SplashTextOn( 'State','Going outside'&$SplashText,200,400,1010,0) local $GoOutsideTimer = TimerInit(), $GoOutsideTimeout = 20000 While 1 $pix1 = PixelGetColor( 200,20 ) $pix2 = PixelGetColor( 220,20 ) $pix3 = PixelGetColor( 240,20 ) $pix4 = PixelGetColor( 260,20 ) $pix5 = PixelGetColor( 280,20 ) $pix6 = PixelGetColor( 300,20 ) if $pix1 == 0x000000 and $pix1 == $pix2 and $pix1 == $pix3 and $pix1 == $pix4 and $pix1 == $pix5 and $pix1 == $pix6 then ExitLoop if TimerDiff( $GoOutsideTimer ) > $GoOutsideTimeout then ExitLoop WEnd Send('{w up}') Sleep(Random(500,1000)) $GoOutsideTimer = TimerInit() while PixelGetColor( 200,20 ) == 0x000000 and PixelGetColor( 300,20 ) == 0x000000 SplashTextOn( 'State','Loading...'&$SplashText,200,400,1010,0) Sleep( Random(800, 1000) ) if TimerDiff( $GoOutsideTimer ) > $GoOutsideTimeout then ExitLoop WEnd Sleep( random( 1000, 2000 ) ) Send( 'u' ) SplashTextOn( 'State','Casting balthazar aura'&$SplashText,200,400,1010,0) Sleep( Random( 500, 1500 ) ) Send( '8' ) SplashTextOn( 'State','Moving up'&$SplashText,200,400,1010,0) Sleep( Random( 4000,5000 ) ) ;Send( 'é' ) ;Sleep( Random( 500, 1000 ) ) ;MouseClick( 'left', 565, 465, 1, 1 ) ;Sleep( Random( 500, 1000 ) ) Send( '{w down}' ) Sleep( Random( 2000, 3000 ) ) Send( '{w up}' ) local $GoOutsideTimer = TimerInit(), $GoOutsideTimeout = 25000 Sleep( Random( 1000, 2000 ) ) Send('{q down}') while TimerDiff( $GoOutsideTimer ) < $GoOutsideTimeout SplashTextOn( 'State','Searching for griffons...'&$SplashText,200,400,1010,0) Send( 'c' ) if TargetMatch($Monster[4], GetItemCode( $ItemColor_White ) ) then SplashTextOn( 'State','Griffon found'&$SplashText,200,400,1010,0) ExitLoop EndIf Sleep( Random( 100, 5000 ) ) Send('{q down}') WEnd Send('{q up}') Sleep( Random( 500, 1500 ) ) SplashTextOn( 'State','Casting Live visomething'&$SplashText,200,400,1010,0) Send( '7' ) Sleep( Random( 3000, 5000 ) ) if not TargetMatch($Monster[4], GetItemCode( $ItemColor_White ) ) Then SplashTextOn( 'State','Failed to find griffons, heading right a little'&$SplashText,200,400,1010,0) Send( 'c' ) Sleep( Random( 1000, 2000 ) ) Send('{e down}') Sleep( Random( 2000, 3000 ) ) Send('{e up}') EndIf Sleep( Random( 500, 1500 ) ) Send( 'c' ) Sleep( Random( 500, 1000 ) ) if not TargetMatch($Monster[4], GetItemCode( $ItemColor_White ) ) Then SplashTextOn( 'State','Failed to find griffons, heading straight'&$SplashText,200,400,1010,0) local $GoOutsideTimer = TimerInit(), $GoOutsideTimeout = 15000 Send('{w down}') Sleep( 500 ) while TimerDiff( $GoOutsideTimer ) < $GoOutsideTimeout Send( 'c' ) if TargetMatch($Monster[4], GetItemCode( $ItemColor_White ) ) then ExitLoop Sleep( Random( 100, 5000 ) ) WEnd Send('{w up}') EndIf SplashTextOn( 'State','We have now reached griffons'&$SplashText,200,400,1010,0) local $GoOutsideTimer = TimerInit(), $GoOutsideTimeout = 10000 while TimerDiff( $GoOutsideTimer ) < $GoOutsideTimeout Send( 'c' ) Sleep( Random( 200, 300 ) ) Send( '{SPACE}' ) Sleep( Random( 200, 300 ) ) if ScanAggro() then ExitLoop WEnd return true EndFunc Func TravelTo_Griffon_HM() Send('m') Sleep( Random( 1000, 1500 ) ) MouseClick( 'Left',500,500,2,1) Sleep( Random( 1000, 1500 ) ) MouseClick( 'Left',863,559) Sleep( Random( 1000, 1500 ) ) MouseClick( 'Left', 417,518,2,1) Sleep( Random( 7000, 10000 ) ) EndFunc hydra.au3 func TravelTo_Hydra() Send('m') Sleep( Random( 1000, 1500 ) ) MouseClick( 'Left',500,500,2,1) Sleep( Random( 1000, 1500 ) ) MouseClick( 'Left',802,580) Sleep( Random( 1000, 1500 ) ) MouseClick( 'Left', 560,470,2,1) Sleep( Random( 7000, 10000 ) ) EndFunc Func Main_Hydra() ;global $AttackTimer = TimerInit() ;global $AttackRandom = Random ( 1000, 2000 ) ;while TimerDiff( $AttackTimer ) < ( $AttackTimeout_Hydra + $AttackRandom ) ; if not Attack_Hydra() then ExitLoop ; if GetLifePercent() < 10 then ; $dead = true ; ExitLoop ; EndIf ;WEnd ;local $Failcount = 0, $PickitTimer = TimerInit(), $PickitTimeout = 10*60*1000 ;while not ( TargetMatch( $IgnoreItems[2],GetItemCode( $ItemColor_White ) ) ) and TimerDiff( $PickitTimer ) < $PickitTimeout ; if GetItemCode( $ItemColor_White ) == '' then ; $Failcount += 1 ; if $Failcount > 10 then ExitLoop ; endif ; Send( ';' ) ; Sleep( Random(100, 700) ) ; Send( '{space}' ) ; Sleep( Random( 1000, 7000 ) ) ; if GetLifePercent() < 10 then ; ExitLoop ; EndIf ;WEnd local $Failcount, $PickitTimer , $PickitTimeout = 10*60*1000 local $AttackTimer = TimerInit() local $AttackRandom = Random ( 1000, 2000 ) local $LastLife = GetLifePercent() while TimerDiff( $AttackTimer ) < ( $AttackTimeout_Hydra + $AttackRandom ) if not Attack_Hydra() then ExitLoop for $i = 0 to 300 if ScanAggro() then ExitLoop Sleep( 100 ) if $LastLife > GetLifePercent() then ExitLoop $LastLife = GetLifePercent() Next while ScanAggro() or $LastLife > GetLifePercent() or ( $LastLife - GetLifePercent() ) < -2 _log( 'ScanAggro true attacking minotaur' ) Attack_Hydra() if GetLifePercent() < 10 then $dead = true ExitLoop 2 EndIf $LastLife = GetLifePercent() WEnd local $Failcount = 0, $PickitTimer = TimerInit(), $PickitTimeout = 10*60*1000 while not ( TargetMatch( $IgnoreItems[2],GetItemCode( $ItemColor_White ) ) ) and TimerDiff( $PickitTimer ) < $PickitTimeout if GetItemCode( $ItemColor_White ) == '' then $Failcount += 1 if $Failcount > 5 then ExitLoop endif Send( ';' ) Sleep( Random(100, 700) ) Send( '{space}' ) Sleep( Random( 100, 700 ) ) if GetLifePercent() < 10 then ExitLoop EndIf WEnd WEnd local $Failcount = 0, $PickitTimer = TimerInit(), $PickitTimeout = 10*60*1000 while not ( TargetMatch( $IgnoreItems[2],GetItemCode( $ItemColor_White ) ) ) and TimerDiff( $PickitTimer ) < $PickitTimeout if GetItemCode( $ItemColor_White ) == '' then $Failcount += 1 if $Failcount > 5 then ExitLoop endif Send( ';' ) Sleep( Random(100, 700) ) Send( '{space}' ) Sleep( Random( 100, 700 ) ) if GetLifePercent() < 10 then ExitLoop EndIf WEnd EndFunc Func Attack_Hydra() ;check dolyak signet first always if SkillAvailable( 5 ) then _log( 'casting dolyak signet' ) Send( '5' ) Sleep( Random(100,300) ) ;check vigorous spirit (30% mana atleast on 20mana) elseIf $VigorousTimer == -1 or TimerDiff( $VigorousTimer ) > 29000 then _log( 'casting vigorous spirit' ) ;well we gota cast it $VigorousTimer = -1 Send( '6' ) Sleep( Random(500,800) ) if not SkillAvailable(6) THEN $VigorousTimer = TimerInit() ;defy pain here also very important elseif ($DefyTimer = -1 or TimerDiff( $DefyTimer ) > 10 ) and SkillAvailable( 4 ) Then Send( '4' ) Sleep( Random( 100, 300 )) ;riposte elseif SkillAvailable( 2 ) then Send( '2' ) Sleep( Random( 100,300 ) ) ;flurry ElseIf SkillAvailable(1) and GetManaPercent() > 25 Then Send( '1' ) Sleep( Random( 100, 300 ) ) ;deadly riposte elseif SkillAvailable(3) and GetManaPercent() > 25 then Send( '3' ) Sleep( Random( 100, 300 ) ) EndIf if not TargetMatch( $Monster[2], GetItemCode( $ItemColor_White ) ) and not TargetMatch( $Monster[3], GetItemCode( $ItemColor_White ) ) then Sleep( Random( 300, 500 ) ) Send( 'c' ) Sleep( Random ( 50, 150 ) ) Send( '{space}' ) if not TargetMatch($Monster[2], GetItemCode( $ItemColor_White ) ) and not TargetMatch( $Monster[3], GetItemCode( $ItemColor_White ) ) then return false EndIf Send( 'c' ) Sleep( Random ( 50, 150 ) ) Send( '{space}' ) return true EndFunc func Reach_Hydra() Send( '8' ) While GetManaPercent() < 90 Sleep( 100 ) WEnd Sleep( Random( 2000, 3000 ) ) Send( '7' ) Sleep( Random( 3000, 5000 ) ) ;MouseClick( 'left',713,37,1,1 ) ;Sleep( Random( 7000, 9000 ) ) ;for $i = 0 to 5 ; MouseClick( 'left',990,592 ) ; Sleep( Random( 1500, 2500 ) ) ; Next #cs MouseClick( 'left' ,651,40,1,1 ) Sleep( Random( 7000, 8000 ) ) for $i = 0 to 2 MouseClick( 'Left',989,708,1,1 ) Sleep( Random( 1500,2500 ) ) if ScanAggro() then return Next MouseClick( 'left',987,185,1,1 ) Sleep( Random( 7000, 9000 ) ) if ScanAggro() then return for $i = 0 to 12 MouseClick( 'left',688,615 , 1,1 ) Sleep( Random( 1000, 1500 ) ) if ScanAggro() then return Next for $i = 0 to 9 MouseClick( 'left', 583,609, 1, 1 ) Sleep( Random( 1000, 1500 ) ) if ScanAggro() then return Next for $i = 0 to 3 MouseClick( 'left',990,705,1,1 ) Sleep( Random( 1000, 1500 ) ) if ScanAggro() then return Next ;Sleep( Random( 300, 500 ) ) ;if GetItemCode($ItemColor_White) <> $Monster[2] Then ;;do something cuz we too far from hydras... ;;TODO ;EndIf #ce Send( 'c' ) Sleep( 2000 ) Send( '{SPACE}' ) Sleep( Random( 1000, 2000 ) ) EndFunc Func LeaveArea_Hydra() Send( 'u' ) Sleep( random( 500, 1500 ) ) Send(';') Sleep( 500 ) if not ( GetItemCode( $ItemColor_White ) ) == $IgnoreItems[1] then Send( 'è' ) Sleep( Random( 1500, 3000 ) ) Send( '{SPACE}' ) Sleep( random( 11000, 13000 ) ) local $GoOutsideTimer = TimerInit(), $GoOutsideTimeout = 60000 while 1 Sleep( 100 ) PixelSearch( 177, 229, 179, 233 , 5435218,0,1 ) if not @error then ExitLoop Send( '{d down}' ) Sleep( 50 ) Send( '{d up}' ) if TimerDiff( $GoOutsideTimer ) > $GoOutsideTimeout then Send( '{s down}' ) Sleep( Random(3000,7000) ) Send( '{s up}' ) ExitLoop EndIf WEnd Send('{w down}') Sleep( random( 1000, 2000 ) ) Send('{w up}') Sleep( random( 1000, 2000 ) ) Send('{q down}') local $GoOutsideTimer = TimerInit(), $GoOutsideTimeout = 60000 While 1 $pix1 = PixelGetColor( 200,20 ) $pix2 = PixelGetColor( 220,20 ) $pix3 = PixelGetColor( 240,20 ) $pix4 = PixelGetColor( 260,20 ) $pix5 = PixelGetColor( 280,20 ) $pix6 = PixelGetColor( 300,20 ) if $pix1 == 0x000000 and $pix1 == $pix2 and $pix1 == $pix3 and $pix1 == $pix4 and $pix1 == $pix5 and $pix1 == $pix6 then ExitLoop if TimerDiff( $GoOutsideTimer ) > $GoOutsideTimeout then ExitLoop WEnd Send('{q up}') Sleep(Random(500,1000)) $GoOutsideTimer = TimerInit() while PixelGetColor( 200,20 ) == 0x000000 and PixelGetColor( 300,20 ) == 0x000000 Sleep( Random(800, 1000) ) if TimerDiff( $GoOutsideTimer ) > $GoOutsideTimeout then ExitLoop WEnd Sleep( random( 1000, 2000 ) ) Send( 'u' ) Sleep( Random( 500, 1500 ) ) EndFunc Minotaur.au3 func Main_Minotaur() TakeBreak() $FirstPause = true SplashTextOn('Run info','Total runs: ' & $runs,100, 30, 1100,0 ) $runs += 1 $dead = false LeaveArea_Minotaur() _log( 'going to minotaurs' ) Sleep( Random( 100, 300 ) ) Send( '8' ) Sleep( Random( 6000, 7000 ) ) Send( 'é' ) Sleep( Random( 500, 1000 ) ) MouseClick( 'left', 565, 465, 1, 1 ) Sleep( Random( 500, 1000 ) ) Send('{q down}' ) Sleep( random( 2000, 3000 ) ) Send('{q up}') Sleep( Random( 100, 300 ) ) Send('{w down}' ) Sleep( random( 3700, 4300 ) ) Send('{w up}') Sleep( Random( 100, 300 ) ) Send('{q down}' ) Sleep( random( 4500, 5000 ) ) Send('{q up}') Sleep( Random( 100, 300 ) ) Send('{w down}' ) Sleep( random( 1500, 3500 ) ) Send('{w up}') _log( 'waiting for mana to replenish' ) global $AntiDeadLock = 0 while GetManaPercent() < 100 and $AntiDeadLock < 600 $AntiDeadLock +=1 Sleep( 100 ) WEnd $AntiDeadLock = 0 Sleep( Random( 500, 6000 ) ) Send( '7' ) Sleep( Random( 5000, 6000 ) ) Send('c') Sleep(Random( 100, 400 ) ) Send('{space}') for $i = 0 to 5 Send('c') Sleep( Random( 100, 200 ) ) Send('{space}') Sleep( random( 600, 1000 ) ) Next _log( 'Starting attack' ) #cs global $AttackTimer = TimerInit() global $AttackRandom = Random ( 1000, 2000 ) while TimerDiff( $AttackTimer ) < ( $AttackTimeout_Minotaur + $AttackRandom ) if not Attack_Minotaur() then ExitLoop if GetLifePercent() < 10 then $dead = true ExitLoop EndIf WEnd global $Failcount = 0, $PickitTimer = TimerInit(), $PickitTimeout = 10*60*1000 while not ( TargetMatch( $IgnoreItems[0],GetItemCode( $ItemColor_White ) ) ) and TimerDiff( $PickitTimer ) < $PickitTimeout if GetItemCode( $ItemColor_White ) == '' then $Failcount += 1 if $Failcount > 10 then ExitLoop endif Send( ';' ) Sleep( Random(100, 700) ) Send( '{space}' ) Sleep( Random( 100, 700 ) ) if GetLifePercent() < 10 then ExitLoop EndIf WEnd #ce local $Failcount, $PickitTimer , $PickitTimeout = 10*60*1000 local $AttackTimer = TimerInit() local $AttackRandom = Random ( 1000, 2000 ) local $LastLife = GetLifePercent() while TimerDiff( $AttackTimer ) < ( $AttackTimeout_Minotaur + $AttackRandom ) if not Attack_Minotaur() then ExitLoop for $i = 0 to 200 if ScanAggro() then ExitLoop Sleep( 100 ) if $LastLife > GetLifePercent() then ExitLoop $LastLife = GetLifePercent() Next while ScanAggro() or $LastLife > GetLifePercent() or ( $LastLife - GetLifePercent() ) < -2 if StringInStr( GetItemCode( $ItemColor_White ), 'F6189' ) then ;this iis a boss minotaur lvl 27 while StringInStr( GetItemCode( $ItemColor_White ), 'F6189' ) ;98BD9641C9EA9F6189C47A121186A98968A12CA5 Send( '2' ) Sleep( Random( 500, 1000 ) ) if SkillAvailable( 4 ) Then Send( '4' ) Sleep( Random( 500, 1600 ) ) EndIf WEnd Send( '1' ) Sleep( Random( 500,1500 ) ) EndIf _log( 'ScanAggro true attacking minotaur' ) Attack_Minotaur() if GetLifePercent() < 10 then $dead = true ExitLoop 2 EndIf $LastLife = GetLifePercent() WEnd local $Failcount = 0, $PickitTimer = TimerInit(), $PickitTimeout = 10*60*1000 while not ( TargetMatch( $IgnoreItems[0],GetItemCode( $ItemColor_White ) ) ) and TimerDiff( $PickitTimer ) < $PickitTimeout if GetItemCode( $ItemColor_White ) == '' then $Failcount += 1 if $Failcount > 5 then ExitLoop endif Send( ';' ) Sleep( Random(100, 700) ) Send( '{space}' ) Sleep( Random( 100, 700 ) ) if GetLifePercent() < 10 then ExitLoop EndIf WEnd WEnd local $Failcount = 0, $PickitTimer = TimerInit(), $PickitTimeout = 10*60*1000 while not ( TargetMatch( $IgnoreItems[0],GetItemCode( $ItemColor_White ) ) ) and TimerDiff( $PickitTimer ) < $PickitTimeout if GetItemCode( $ItemColor_White ) == '' then $Failcount += 1 if $Failcount > 5 then ExitLoop endif Send( ';' ) Sleep( Random(100, 700) ) Send( '{space}' ) Sleep( Random( 100, 700 ) ) if GetLifePercent() < 10 then ExitLoop EndIf WEnd DoRandomStuff() EndFunc func TravelTo_Minotaur() WinActivate( 'Guild Wars', '' ) WinWaitActive( 'Guild Wars','',10) Send( 'm' ) Sleep( random ( 2000, 3000 ) ) MouseClick( 'left',400,400,1,1 ) Sleep( Random( 1000, 2000 ) ) MouseClick( 'left', 577,52 ) Sleep( Random( 500, 2000 ) ) MouseClick( 'left', 475,349,2,1) Sleep( Random( 4000, 6000 ) ) EndFunc Func LeaveArea_Minotaur() Send( 'u' ) Sleep( Random( 500, 1500 ) ) ;DoRandomStuff() send( ';' ) Sleep( 200 ) Send( '{space}' ) Sleep( Random( 5000, 7000 ) ) ;140 232 ;MsgBox(0,'',PixelGetColor(143,232)) ;5435218 local $GoOutsideTimer = TimerInit(), $GoOutsideTimeout = 60000 while 1 Sleep( 100 ) PixelSearch( 139, 225, 142, 250 , 5435218,0,1 ) if not @error then ExitLoop Send( '{d down}' ) Sleep( 50 ) Send( '{d up}' ) if TimerDiff( $GoOutsideTimer ) > $GoOutsideTimeout then Send( '{s down}' ) Sleep( Random(3000,7000) ) Send( '{s up}' ) ExitLoop EndIf WEnd send( '{w down}' ) $GoOutsideTimer = TimerInit() While 1 $pix1 = PixelGetColor( 200,20 ) $pix2 = PixelGetColor( 220,20 ) $pix3 = PixelGetColor( 240,20 ) $pix4 = PixelGetColor( 260,20 ) $pix5 = PixelGetColor( 280,20 ) $pix6 = PixelGetColor( 300,20 ) if $pix1 == 0x000000 and $pix1 == $pix2 and $pix1 == $pix3 and $pix1 == $pix4 and $pix1 == $pix5 and $pix1 == $pix6 then ExitLoop if TimerDiff( $GoOutsideTimer ) > $GoOutsideTimeout then ExitLoop WEnd send( '{w up}' ) Sleep(Random(500,1000)) $GoOutsideTimer = TimerInit() while PixelGetColor( 200,20 ) == 0x000000 and PixelGetColor( 300,20 ) == 0x000000 Sleep( Random(800, 1000) ) if TimerDiff( $GoOutsideTimer ) > $GoOutsideTimeout then ExitLoop WEnd Sleep( random( 1000, 2000 ) ) Send( 'u' ) Sleep( Random( 500, 1500 ) ) EndFunc func Attack_Minotaur() ;check health to stop ... blablabla local $skip = False ;check dolyak signet first always if SkillAvailable( 5 ) then _log( 'casting dolyak' ) Send( '5' ) Sleep( Random(100,300) ) Send( '6' ) Sleep( Random( 300, 400 ) ) if not SkillAvailable(6) THEN $VigorousTimer = TimerInit() ;check vigorous spirit (30% mana atleast on 20mana) elseIf $VigorousTimer == -1 or TimerDiff( $VigorousTimer ) > Random( 15000, 20000 ) then _log( 'casting vigorous spirit' ) ;well we gota cast it $VigorousTimer = -1 for $i = 0 to Random( 1, 3 ) Send( '6' ) Sleep( Random(100,300) ) Next Sleep( Random( 300, 400 ) ) if not SkillAvailable(6) THEN $VigorousTimer = TimerInit() ;glad defence elseif SkillAvailable( 4 ) Then _log( 'casting glad defence' ) Send( '4' ) Sleep( Random( 100, 300 )) $GladTimer = TimerInit() ;riposte elseif SkillAvailable( 2 ) then _log( 'casting riposte' ) Send( '2' ) Sleep( Random( 100,300 ) ) ;flurry ElseIf SkillAvailable(1) and GetManaPercent() > 24 and TimerDiff($GladTimer) > 10000 Then _log( 'casting flurry' ) Send( '1' ) Sleep( Random( 100, 300 ) ) ;watch urself elseif SkillAvailable(3) and GetManaPercent() > 24 then _log( 'casting watch urself' ) Send( '3' ) Sleep( Random( 100, 300 ) ) EndIf Send( 'c' ) Sleep( Random ( 50, 150 ) ) Send( '{space}' ) Sleep( random( 50, 150) ) if not TargetMatch( $Monster[0], GetItemCode( $ItemColor_White ) ) then Sleep( Random( 300, 500 ) ) Send( 'c' ) Sleep( Random ( 50, 150 ) ) Send( '{space}' ) if not TargetMatch($Monster[0], GetItemCode( $ItemColor_White ) ) then return false EndIf return True EndFunc
  3. Lifewatct (life and mana) accurate to a couple %. must use LARGER UI display, window mode Opt ( "CaretCoordMode" , 2 ) opt ( "MouseCoordMode" , 2 ) opt ( "PixelCoordMode" , 2 ) func GetManaPercent() local $LifeIndex = -1 for $x = 517 to 760 if PixelGetColor( $x, 644 ) == 7502 then $LifeIndex = $x ExitLoop EndIf Next if $LifeIndex = -1 then return 100 return Round( ( ( $LifeIndex - 517 ) / 243 ) * 100 ) - 6 EndFunc func GetLifePercent() local $LifeIndex = -1 for $x = 246 to 493 if PixelGetColor( $x, 644 ) == 5711645 then $LifeIndex = $x ExitLoop EndIf Next if $LifeIndex = -1 then return 100 return Round( ( ( $LifeIndex - 246 ) / 247 ) * 100 ) EndFunc
  4. quick update, I made an item identifier, its still very beta like the above script but is very promising. Ok well this generates an array of data that can be used to detect wich item it is. I tested it on gold, and i can detect if a white item is droped is gold or something else. If it is gold the the $sum2[0] (wich is an array of data read from the game) is 0x421085e1. in order to use this function you must detect an item, find the bottom-most pixel matching the item color you are scanning (white in the case of gold) and pass the x,y coords of that pixel, along with the color you are scanning to the function. func GetItemCode( $x, $y, $color ) ;find the left side of the item local $Left = $x, $Top = $y, $Right = $x, $Bottom = $y, $file = FileOpen( 'Log.txt', 2 ) local $LastFound, $ConsecutiveFails = 0, $TotalColors = 0 ;find left (not accurate but required) for $i = $x to $x - 300 step -1 ;scan horizontal to be sure there is a pixel matching our color or not in the item name for $a = $y - 14 to $y + 14 $tmpColor = PixelGetColor( $i, $a ) ;FileWriteLine( $file, 'Scanning: ' & $i & ',' & $a & ' ' & PixelGetColor( $i, $a ) ) if $tmpColor == $color then ExitLoop ;$TotalColors +=1 ;EndIf Next if $tmpColor == $color then ;if $TotalColors > 3 then ;MsgBox( 0, '', 'found color' ) $LastFound = $i $ConsecutiveFails = 0 Else $ConsecutiveFails += 1 EndIf if $ConsecutiveFails > 30 then $Left = $LastFound ExitLoop EndIf Next ;find bottom (not accurate but required) for $i = $y to $y + 14 ;scan vertically to be sure there is a pixel matching our color or not in the item name for $a = $x - 14 to $x + 14 $tmpColor = PixelGetColor( $a, $i ) if $tmpColor == $color then ExitLoop Next if $tmpColor == $color then $LastFound = $i $ConsecutiveFails = 0 Else $ConsecutiveFails += 1 EndIf ;if $ConsecutiveFails > 1 then ; $Bottom = $LastFound ; ExitLoop ;EndIf Next $bottom = $LastFound MouseMove( $left, $bottom + 5 ) Sleep( 200 ) ;find y axis of the white line underneat the text local $Yaxis = 0, $found = false for $y3 = $bottom to $bottom + 10 for $x3 = $left to $left + 50 if PixelGetColor( $x3, $y3 ) <> $color then ExitLoop if $x3 >= $left +45 then $found = True $Yaxis = $y3 ExitLoop 2 EndIf Next Next if $found Then ;MsgBox( 0, '', $Yaxis ) Else ;MsgBox( 0, '', 'Not found' ) EndIf ;find left for $x4 = $left + 10 to 0 step -1 if PixelGetColor( $x4, $Yaxis) <> $color then $left = $x4 + 1 ExitLoop EndIf Next ;find right for $x4 = $left to 1000 if PixelGetColor( $x4, $Yaxis) <> $color then $right = $x4 - 1 ExitLoop EndIf Next ;MouseMove( $left, $Yaxis ) ;MouseMove( $right, $Yaxis ) local $sum2[255];array of bytes local $sum = 0, $index = 1, $byteIndex = 0 for $x5 = $right to $left step -3 for $y5 = $Yaxis to $Yaxis - 14 step -3 if PixelGetColor( $x5, $y5 ) == $color then $sum += $index EndIf $index = $index *2 if $index > 4294967295 then ;add the byte into the array $sum2[$byteIndex] = Hex( $sum ) $sum = 0 $byteIndex += 1 $index = 1 EndIf Next Next ;built the string off the bytes $bytestring = '' for $i = $byteIndex to 0 step -1 $bytestring &= $sum2[$i] & ' ' Next StringReplace( $bytestring, '0','') MsgBox( 0, '' , $bytestring ) EndFunc
  5. hook me up on irc im developing an advanced gw bot
  6. no i never tryed this i dont know if i would have the skills necessary to do that, might look into it someday
  7. hey guys i bought guildwars yesterday.. this thread seems dead but some people might still be using it as reference. Anyway I made a little bot and tough I would share it since once of these script helped me alot, after trying for 2hours to find the color of blue items I found it here on this topic. So this is a level bot to go from level 1-5 using the ranger pet (you can get it when you get to try other proffesions even if you arent a ranger and dont plan on using this as your second profeesion. The bot goes to the level 5 bull on lake place and kill it, go back to town and repeat. Its probably very buggy (i had to restard it only once in 1hour tho so maby not that bad) but it works good even if its very slow and im having problems with turn functions (ill work on a turn function based on mouse using a set of degrees wich should work MUCH better). it also pick up ANY items. welll there are some requirments theyre written on top of the script. I hope this can be of some kind of use to someone. ;REQUIREMENTS: Max zoom out (must be the fartest from char). The biggest icons and french language. window mode ;TODO add timeouts ;set coorsd relative to client window Opt ( "CaretCoordMode" , 2 ) opt ( "MouseCoordMode" , 2 ) opt ( "PixelCoordMode" , 2 ) global $TurnDelay = 500;time to wait befor each turn operation (turn left, right) ;HotKeySet( '9', 'left' );uncomment for testing ;HotKeySet( '0', 'right' ) WinActivate( 'Guild Wars' ) Sleep( 1000 ) global $ItemColor_White = 16777215, $ItemColor_Blue = 0x99EEFF;item colors definition ;main bot loop while 1 GoOutsideAscalon() Sleep( 7000 ) GoToBigBull() Sleep( 15000 ) AttackBigBull() Sleep( 1000 ) pickit() BackToAscalon() WEnd func GoOutsideAscalon() mouseclick( 'left', 586, 44, 1, 0 ) ;1=near fence ;2=near stairs local $StartingPoint ;find wwhere we started $Sum = 0 for $x = 891 To 918 for $y = 189 to 216 if PixelGetColor( $x, $y ) == 0xFFFFFF then $Sum += 1 Next Next $StartingPoint = 2 if $sum > 5 then $StartingPoint = 1 ;act depending on the starting point and head outside Switch( $StartingPoint ) case 1 ;MsgBox(0,'','Starting point 1' ) send( 'x' ) Sleep( 2000 ) Send( '{w down}' ) for $i = 1 to 7 Sleep( 1000 ) Next send( '{w up}' ) Sleep( 1000 ) turn( 'left', 10 ) Send( '{w down}' ) While 1 $pix1 = PixelGetColor( 200,20 ) $pix2 = PixelGetColor( 220,20 ) $pix3 = PixelGetColor( 240,20 ) $pix4 = PixelGetColor( 260,20 ) $pix5 = PixelGetColor( 280,20 ) $pix6 = PixelGetColor( 300,20 ) if $pix1 == 0x000000 and $pix1 == $pix2 and $pix1 == $pix3 and $pix1 == $pix4 and $pix1 == $pix5 and $pix1 == $pix6 then ExitLoop WEnd send( '{w up}' ) case 2 ;MsgBox(0,'','Starting point 2' ) Send( '{w down}' ) Sleep( 100 ) Send( '{w down}' ) While 1 $pix1 = PixelGetColor( 200,20 ) $pix2 = PixelGetColor( 220,20 ) $pix3 = PixelGetColor( 240,20 ) $pix4 = PixelGetColor( 260,20 ) $pix5 = PixelGetColor( 280,20 ) $pix6 = PixelGetColor( 300,20 ) if $pix1 == 0x000000 and $pix1 == $pix2 and $pix1 == $pix3 and $pix1 == $pix4 and $pix1 == $pix5 and $pix1 == $pix6 then ExitLoop WEnd send( '{w up}' ) EndSwitch EndFunc func GoToBigBull() ;go to the bull on the lake for $i = 1 to 12 turn( 'right', 1 ) Sleep( 100 ) Next Sleep( 1000 ) Send('{w down}') Sleep( 100 ) Send('{w down}') for $i = 1 to 17 Sleep( 1000 ) Next Send('{w up}') Sleep( 100 ) Send('{w up}') Sleep( 1000 ) turn( 'left', 6 ) Sleep( 1000 ) Send('{w down}') while 1 Send('{TAB}') Sleep( 100 ) if PixelChecksum(370,29,586,44) == 993448726 then ExitLoop Sleep( 100 ) WEnd Send('{w up}') Send('{SPACE}') EndFunc func AttackBigBull() while 1 ;EDIT YOUR ATTACK ROUTINE HERE. Send( '1' ) Sleep( 4000 ) Send( '2' ) Sleep( 4000 ) ;0xD83D3D PixelSearch(282,7,686,111,0xD83D3D,10,2) if @error then ExitLoop WEnd EndFunc func Pickit() ;TODO Scan more pixels maby because some monsters have white graphics (bandits is an example) ;TODO find a way that it dsent try to pickup the sky... lol ;TODO: Scan multiple time using different start value to speed up, so if u dont find on first scan, start again with the same xstart value + offset. $Item_MinimumPixel = 10;the number of pixel that must match an item color in order to be considered an item $X_ScanStep = 10;step used in scanning the whole screen $Y_ScanStep = 5;same but for y axis $X_ScanStart = 272;next 4 vars are start*stop values of scan $Y_ScanStart = 3 $X_ScanStop = 738 $Y_ScanStop = 631 $Item_XMax = 300; maximum x size of an item name (used to search) $Item_YMax = 20; same as above local $PixelsMatched = 1, $ItemFound[3];func vars dont edit ;start scanning for $y = $Y_ScanStart to $Y_ScanStop step $Y_ScanStep for $x = $X_ScanStart to $X_ScanStop step $X_ScanStep ;Sleep( 1 ) ;check if we have a pixel that match an item color local $currPixel = PixelGetColor( $x, $y ) if $currPixel == $ItemColor_White or $currPixel == $ItemColor_Blue then MouseMove( $x, $y, 0 ) ;scan around to find more pixels of the same color for $iX = $x - $Item_XMax / 2 to $x + $Item_XMax / 2 for $iY = $y - $Item_YMax / 2 to $y +$Item_YMax / 2 $currPixel = PixelGetColor( $iX , $iY ) if $currPixel == $ItemColor_White or $currPixel == $ItemColor_Blue Then $PixelsMatched += 1 if $PixelsMatched == $Item_MinimumPixel Then $ItemFound[0] = true $ItemFound[1] = $x $ItemFound[2] = $y ExitLoop 4 EndIf EndIf Next Next EndIf Next Next if $ItemFound[0] == true Then ;we found an item MouseMove( $ItemFound[1], $ItemFound[2] ) mouseclick('left') Sleep( 1000 ) EndIf ;exit EndFunc func BackToAscalon() send('m') Sleep( 4000 ) MouseClickDrag( 'left', 25,20,833,626 ) Sleep( 1000 ) MouseClick( 'left', 929, 591 ) Sleep( 5000 ) MouseClick( 'left', 657, 516 ) Sleep( 15000 ) EndFunc func left() turn( 'left', 1 ) EndFunc func right() turn( 'right', 1 ) EndFunc func Turn( $Direction, $Repeat ) ;GAY ASS BUGGY FUNCTION ;direction = left or right ;repeat = 1 for 1 click, 2 for 2 click, etc... for $i = 1 to $Repeat Switch( StringLower( $Direction ) ) case 'left' Send("{a down}") sleep ( 50 ) Send("{a up}") case 'right' Send("{d down}") sleep ( 50 ) Send("{d up}") EndSwitch Sleep( $TurnDelay ) Next EndFunc
  8. hey I havent been here in awhile just wondering if anyone tryied this
  9. I tryied this and it dosent work. I would really like some hints im starting to get really pissed..
  10. indeed i will try this, I will post results tomorrow. If this work, then I would really like to know why. (curiosity)
  11. ok I use GUIRegisterMessage on 2 script, they both run at the same time. the first time the first script is executed it works, the first time the second script is executed it works. but the 2nd time the first script is executed it dosent work and I am really starting to get clueless as the "why" it dosent work. the first script register: $CMD_CallWrapper = 10000 GUIRegisterMsg($CMD_CallWrapper, "CallWrapper" ) the second script register: $CMD_CallWrapper = 10002 GUIRegisterMsg($CMD_CallWrapper, "CallWrapper" ) it looks like the 2nd register overwrite the first one.. but message ID's are differents so I don't see why it would do this (I dont have much experience of windows messaging, not to say none at all). Also I was not able to test if the 2nd script receive message works the 2nd time because I need the first script to work in order for the 2nd one to start again. I also tryied to re-register the first script each time befor it start's but there was absolutly no difference at all. Any help would be very appreciated thanks you in advance.
  12. this bitmap function is from (I believe) Kernel32.dll (not sure 100%?). The win32 API functions are documented on msdn.com (search win32 api documentation). Btw it would be better to use MakeCompatibleBitmap Instaed of MAkeBitamp (if you want to make color bmps atleast). This function can be used with dllcall (maby COM also but i dontt hink so). My first suggestion was this, but not to get rid of the array. Because you had 2 loops: 1 that put the values in an array, and another that parse that array and use filewrite, what I was saying is that all this could be done with 1 loop, so I dont think the array is needed since instead of holding the data, you can deal with it immediatly, but it should not make a very big difference anyway, but I realyl think that calling multiple filewriteline is slower than appending to a string and using filewrite. well all those are supposition we would need to do some concrete tests to see what is fastest but that create bitmap function seem very insteresting!
  13. mousepos return an array: $MousePos = MouseGetPos() $MousePosX = $MousePos[0] $MousePosY = $MousePos[1]
  14. hello, I am implementing a star algo in autoit, and I was looking for some suggestions (mostly speed-related). I would also like any suggestion on what to use for open list, use an array and redim it everytime? and I would like to make this an UDF eventually but im not sure wich functions to provide / not provide, and wich options should be "hard coded' and wich should be changed by the user. I did not start to make the algo yet i just have my node list so far and scanning for unwalkable areas. Yep im really looking for ideas! and also if anyone want to have a look at this code and make suggestions, im far from the best scripter so I always like new tips to improve my scripting here is the code so far btw, does anyone ever tryed to do this? #include <ARRAY.AU3> Opt ( "CaretCoordMode" , 2 ) opt ( "ColorMode" , 1 ) opt ( "MouseCoordMode" , 2 ) opt ( "PixelCoordMode" , 2 ) global const $NodeParams = 6;total params for each nodes global $X_TotalNodes = 160, $Y_TotalNodes = 120 global $Screen_Height = 600, $Screen_Width = 800, $UnwalkableColor = 2197206, $UnwalkableSearchStep = 10 _ ,$X_LeftNode = 0 , $Y_TopNode = 0 , $X_RightNode = $Screen_Width , $Y_BottomNode = $Screen_Height ;the default 4 values below generate node for the full screen, to generate nodes for a part of screen, use ChangeNodeBox() ;PARAMS: ; Walkable, F, G, H, Parent global enum $n_Walkable, $n_F, $n_G, $n_H, $n_Parent, $n_InitialPos ;return an array x,y func _GetNodeByPixel( $X, $Y ) return _ArrayCreate( round ( $X / ( $Screen_Width / $X_TotalNodes ) ) , round( $Y / ( $Screen_Height / $Y_TotalNodes ) ) ) EndFunc ;scan for walkable/unwalkable nodes func _SetNodeWalkable() local $stepX = $Screen_Width / $X_TotalNodes, $StepY = $Screen_Height / $Y_TotalNodes $timer = TimerStart() for $nX = Round( 0 + $X_LeftNode / $stepX ) to Round( $X_RightNode / $stepX ) for $nY = Round( $Y_TopNode / $StepY ) to Round( $Y_BottomNode / $StepY ) if PixelGetColor( $nX * $stepX + $stepX / 2 , $nY * $StepY + $StepY / 2 ) == $UnwalkableColor then $NodeList [ $nX ] [ $nY ] [ $n_Walkable ] = 1 Else $NodeList [ $nX ] [ $nY ] [ $n_Walkable ] = 0 EndIf Next Next MsgBox( 0, "", "Walkable flag set, time: " & TimerDiff( $timer ) ) EndFunc ;this is a custom function func _ChangeNodeBoxSearch() $timer = TimerStart() local $Left = 0, $Top = 0, $Right = 0, $Bottom = 0 ;set left for $x = 0 to 400 step 15 for $y = 0 to 600 step 15 if PixelGetColor( $x, $y ) == $UnwalkableColor Then $Left = $X ExitLoop 2 EndIf Next Next ;set top for $Y = 0 to 400 step 15 for $X = 0 to 800 step 15 if PixelGetColor( $x, $y ) == $UnwalkableColor then $Top = $Y ExitLoop 2 EndIf Next Next ;set right for $x = 800 to 400 step -15 for $y = 0 to 600 step 15 if PixelGetColor( $x, $y ) == $UnwalkableColor then $Right = $X ExitLoop 2 EndIf Next Next ;set bottom for $y = 600 to 200 step -15 for $x = 0 to 800 step 15 if PixelGetColor( $x, $y ) == $UnwalkableColor then $Bottom = $y ExitLoop 2 EndIf Next Next FileWriteLine( $LogFile, $Left & " " & $top & " " & $Right & " " & $Bottom ) _ChangeNodeBox( $Left, $top, $Right, $Bottom ) MsgBox( 0, "", "ChangeNodeBoxSearch, time: " & TimerDiff( $timer ) ) EndFunc ;change the edges of the area to generate nodes (full screen by default, but put it lower for better speed ) func _ChangeNodeBox( $Left, $Top, $Right, $Bottom ) $X_LeftNode = $Left $Y_TopNode = $top $X_RightNode = $Right $Y_BottomNode = $Bottom EndFunc ;dump the map according to the changes made by _ChangeNodeBox (dont dump the full screen) func _DumpMap ( $File ) local $currLine, $hFile = FileOpen ( $file, 2 ), $stepX = $Screen_Width / $X_TotalNodes, $StepY = $Screen_Height / $Y_TotalNodes for $y_log = Round( $Y_TopNode / $StepY ) to Round( $Y_BottomNode / $StepY ) $currLine = "" for $x_log = Round( 0 + $X_LeftNode / $stepX ) to Round( $X_RightNode / $stepX ) if $NodeList [ $x_log ] [ $y_log ] [ $n_Walkable ] then $currLine &= "..." Else $currLine &= " " EndIf Next FileWriteLine( $file, $currLine ) FileWriteLine( $file, $currLine ) Next FileClose( $file ) EndFunc ;dump the full map even unnasigned nodes func _DumpMapFull ( $File ) local $currLine, $hFile = FileOpen ( $file, 2 ) for $y_log = 0 to $Y_TotalNodes - 1 $currLine = "" for $x_log = 0 to $X_TotalNodes - 1 if $NodeList [ $x_log ] [ $y_log ] [ $n_Walkable ] == true then $currLine &= "." Else $currLine &= " " EndIf Next FileWriteLine( $file, $currLine ) Next FileClose( $file ) EndFunc
  15. hmm weird indeed maby someone more experienced could tell us why it is slower (I would personally really like to know too) btw im gonna go do some research i will edit this post later, im sure there is a way to deal directly with file streams so all this convertion wont be needed (maby hex()) and for the variables at the top, do you really need to convert them to string? like could u, instead of: -$headerOffset = _HexToString("36000000") do this? -$headerOffset = 0x36000000 because autoit does have hex syntax edit: have you looked at this? CreateBitmap The CreateBitmap function creates a bitmap with the specified width, height, and color format (color planes and bits-per-pixel). HBITMAP CreateBitmap( int nWidth, // bitmap width, in pixels int nHeight, // bitmap height, in pixels UINT cPlanes, // number of color planes UINT cBitsPerPel, // number of bits to identify color CONST VOID *lpvBits // color data array ); Parameters nWidth [in] Specifies the bitmap width, in pixels. nHeight [in] Specifies the bitmap height, in pixels. cPlanes [in] Specifies the number of color planes used by the device. cBitsPerPel [in] Specifies the number of bits required to identify the color of a single pixel. lpvBits [in] Pointer to an array of color data used to set the colors in a rectangle of pixels. Each scan line in the rectangle must be word aligned (scan lines that are not word aligned must be padded with zeros). If this parameter is NULL, the contents of the new bitmap is undefined. Return Values If the function succeeds, the return value is a handle to a bitmap. If the function fails, the return value is NULL. while dealing with arrays might be slow, it will be alot faster than dealing with strings (strings are probably the slower variables to process on every languages) so it might worth a try.
×
×
  • Create New...