Bossco Posted February 10, 2010 Posted February 10, 2010 Okay I am tryign to run this bot which it works fine untill Shenk at that point I get an error for line 25 time stop and idk what to do. ;------------Monster Centering script------------ ;Version 1.1 ;Writtin By Smorg & modified by ramadash ;-------------------Paramaters------------------- ;#Include "mm.BOT.Include.au3" ;#include <Array.au3> opt ("PixelCoordMode", 0) opt ("MouseCoordMode", 0) opt ("ColorMode", 1) ;------------User Defined Variables-------------- Global $MouseSpeed = 0 ;Speed for all mouse movements. '0' = instant movement. Global $SearchRes = 20 ;resolution for each pixel search (very important to speed) Global $resolutionx = 40 ;number of 'virtual pixels' (steps) across (very important to speed) Global $resolutiony = 30 ;number of 'virtual pixels' (steps) down (very important to speed) Global $xmin = 0 ;Min x coord for scan Global $xmax = 800 ;Max x coord for scan Global $ymin = 0 ;Min y for scan Global $ymax = 600 ;Max y for scan Global $TotalSleepTime=500 ;in ms ;------------------Constants--------------------- Global $pixel[$resolutionx + 1][$resolutiony + 1];all of the binary monster presence data for all dimensions Global $totalx[$resolutiony + 1] ;the sums of all Y data along the X axis Global $totaly[$resolutionx + 1] ;the sums of all X data along the Y axis1 Global $timer = Timestart() global $file = FileOpaen("pixels.txt",2) Global $Found=0 Global $redcolor = 3739887 ;monster red color Global $xcount = 1 ;the virtual x pixel count Global $ycount = 1 ;the virtual y pixel count Global $MultX = 0 ;sums all of $x data multiplied by $x Global $MultY = 0 ;sums all of $totaly data multiplied by $y Global $sum = 0 ;------------------Scan Module------------------- FileWriteLine($file,"[sTATS]") ;original smorg code with minor modifications For $y = $ymin + ((($ymax-$ymin)/$resolutiony)/2) To $ymax-((($ymax-$ymin)/$resolutiony)/2) Step ($ymax-$ymin)/$resolutiony For $x = $xmin+((($xmax-$xmin)/$resolutionx)/2) To $xmax-((($xmax-$xmin)/$resolutionx)/2) Step ($xmax-$xmin)/$resolutionx if PixelGetColor($x,$y)=$redcolor Or PixelGetColor($x+$resolutionx/2,$y)=$redcolor Or PixelGetColor($x,$y+$resolutiony/2)=$redcolor or PixelGetColor($x-$resolutionx/2,$y)=$redcolor Or PixelGetColor($x,$y-$resolutiony/2)=$redcolor Then $pixel[$xcount][$ycount] = 1 $sum = $sum + 1 $Found=1 Else $pixel[$xcount][$ycount] = 0 EndIf $xcount = $xcount + 1 Next $ycount = $ycount + 1 $xcount = 1 Next If $Found=0 Then Exit(1) ;ramadash code (array dump in .ini format) Global $LogArray $file2=FileOpen("data.log",2) For $dumpY=0 To $resolutiony $LogArray="" For $dumpX=0 To $resolutionx If $dumpX<>$resolutionx Then $LogArray=$LogArray&$pixel[$dumpX][$dumpY]&"," Else $LogArray=$LogArray&$pixel[$dumpX][$dumpY] EndIf Next StringStripWS(StringTrimRight($LogArray,1),8) FileWriteLine($file2,$LogArray) Next FileClose($file2) FileWriteLine($file,"resx="&$resolutionx) FileWriteLine($file,"resy="&$resolutiony) FileWriteLine($file,"sum="&$sum) Sleep($TotalSleepTime-TimerDiff($timer)) Exit(1)
FinalVersion Posted February 10, 2010 Posted February 10, 2010 Read this thread. Game Bots! [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center]
Bossco Posted February 10, 2010 Author Posted February 10, 2010 Read this thread. Game Bots!Ty mate sorry for the post I am enw to AutoIt and the forums and this is a hole enw thign to em and confusing really.
Recommended Posts