Jump to content
Sign in to follow this  
liquiddeath

Error trying to run some scripts

Recommended Posts

liquiddeath

Posted Image

here is my error I believe you people needs to know what the codes are from the script in case here is the script

#cs
    TP Shopper
    Easier Town Portal management for mm.bot.
    Restocks your TP Scrolls, at the setting you want it too. The shop Setting can be adjusted in the TP.Shop.ini file under "TP_Buy =" At each game creation
    it writes to the ini file ,the game number its on. When TP_Buy and TP_Made equal eachother, it then shops for and restocks your TP Tome. After words, it then sets
    the TP_Made key back to 0 to start over.
    Author: blargehlin
    Version: .04 beta
#ce
; Edited A LOT to my liking, thanks Blargehlin for this great script I simply edited some things to make it work with Antfamous Gauntlet Bot.

;#Include "mm.BOT.Include.au3"
#include <file.au3>
#include <Array.au3>
    

AutoItSetOption ( "ColorMode", 1 )  ;;<=====================Here
AutoItSetOption("WinTitleMatchMode", 3)
AutoItSetOption("WinWaitDelay", 250)
AutoItSetOption ("PixelCoordMode", 2) 
AutoItSetOption ("MouseCoordMode", 2)

Global $D2_SlowIntMDelay = 2
Global $D2_FastIntMDelay = 1

Global $Char_CheckMoveDelay = 120
Global $D2_FastClickDelaysRange = 30
Global $D2_SlowClickDelaysRange = 140


Global $D2_MouseClickDelay = 10
Global $D2_MouseClickDownDelay = 30
Global $D2_SendKeyDelay = 10
Global $D2_SendKeyDownDelay = 30

$XUNIQUES_Color = 6521492
$SETS_Color = 1623816 
$XRARES_Color = 6535902
$MAGICS_Color = 11358546
$GRAYS_Color =  5394770
$WHITES_Color = 13027270
$NPC_BODY_Color = 16720037
$NPC_MENU_Color = 1623816
$GREEN_BLOCKS_Color = 65304
$MERC_GREEN_BAR_Color = 34304
$MERC_ORANGE_BAR_Color = 2197206
$UNID_RED_Color = 3229109
$CRAFTED_Color = 2197206
$TP_color = 3777263

Global $WP
Global $Go
Global $TP
Global $Begin
Global $Mala_Search
Global $Mala_Search_Again
Global $Mala_Search_Again2
Global $Menu
Global $No_Menu
Global $TP_Find
Global $No_TP_Find
Global $TPScroll
Global $TPScroll2
Const $random_delay = 200
Const $random_delay2 = 800
Const $nomenu_delay = 1000

$Left_FS = 10
$Right_FS = 800
$Bottom_FS = 550
$Top_FS = 34
$Clear =("{SPACE}")
$tp_color = 16720037;Modded Inventory tp block color| raw dec color used for below
$shop = IniRead(@ScriptDir & "\Bot_Keys.ini", "Settings", "TP_Buy", "")
$game_made = IniRead(@ScriptDir & "\Bot_Keys.ini", "Settings", "TP_Made", "")

Global $XDiff = 0
Global $YDiff = 0

WinActivate("Diablo II")
WinWaitActive("Diablo II")
WinMove("Diablo II", "", 0, 0)

    $read1 = IniRead(@ScriptDir & "\Bot_Keys.ini", "settings", "TP_Buy", "")
    $read2 = IniRead(@ScriptDir & "\Bot_Keys.ini", "settings", "TP_Made", "")
    If $read1 > $read2 Then
        _FileWriteLog(@ScriptDir & "\Bot.log","[Buy_Tp]--> Not Been The Amount Of Games Yet To Buy TP's, Continue Botting.")
        $made = $read2 + 1
        IniWrite(@ScriptDir & "\Bot_Keys.ini", "settings", "TP_Made", $made)
    Else
        If $read1 < $read2 Then
            IniWrite(@ScriptDir & "\Bot_Keys.ini", "settings", "TP_Made", "0")
        EndIf
    EndIf


if PixelGetColor(60,590) = 1024 Or PixelGetColor(780,575) = 1024 or PixelGetColor(752,578) = 1024 or PixelGetColor(779,583) = 1024 Or PixelGetColor(774,578) = 1024 or PixelGetColor(759,586) = 1024 Then
    _FileWriteLog(@ScriptDir & "\Bot.log","[**FAILED**]-->Buy_Tp.au3 Because Battlenet Room Detected Trying To Buy Town Portals!!")
    Exit(0)
EndIf

If $shop = $game_made Then
_FileWriteLog(@ScriptDir & "\Bot.log","[Buy_Tp]-->Time To Buy Town Portals.")
$WP = 0
$Go = 0
Do
    $WP = $WP + 1
    $pixel=PixelSearch(10,50,750,550,6502655,0,5)
    If Not @error Then
    MouseClick ( "left" , $pixel[0] + 45, $pixel[1] + 30, 1,0)
    _FileWriteLog(@ScriptDir & "\Bot.log","[Buy_Tp]-->Town Way Point Found, Going To Act 5 Start Point.")
    Else
    Exit(0)
    EndIf

Sleep(2500)
if PixelGetColor(60,590) = 1024 Or PixelGetColor(780,575) = 1024 or PixelGetColor(752,578) = 1024 or PixelGetColor(779,583) = 1024 Or PixelGetColor(774,578) = 1024 or PixelGetColor(759,586) = 1024 Then
    _FileWriteLog(@ScriptDir & "\Bot.log","[**FAILED**]-->Buy_Tp.au3 Because Battlenet Room Detected Trying To Buy Town Portals!!")
    Exit(0)
EndIf

    PixelSearch(10,35,354,290,11358546,0,5)
    If Not @error Then
    $Go = 1
EndIf
If $Go = 1 Then
    Send("{SPACE}")
        Sleep(250)
    _FileWriteLog(@ScriptDir & "\Bot.log","[Buy_Tp]-->Waypoint Opened, Clearing Screen.." )
    EndIf
Until $WP = 15 Or $Go = 1

If $WP = 15 Then
_FileWriteLog(@ScriptDir & "\Bot.log","[Buy_Tp]-->Could Not Get WP Menu On Screen, Let's See If We Can Still Get To Malah!!" )
EndIf

MouseMove(15,100,1)
$pixel=PixelSearch($Left_FS,$Top_FS,$Right_FS,$Bottom_FS,6502655,0,5)
If Not @error Then
    MouseClick ( "left" , $pixel[0] + 185 , $pixel[1] -179 , 1,0)
Else
    _FileWriteLog(@ScriptDir & "\Bot.log","[Buy_Tp]-->Hmmmmmmm...Could Not Detect Act 5 On First Check!!" )
EndIf

Sleep(200)
$anus = 0
Do
    $pixel=PixelSearch(510,412,566,525,65304,0,5)
    If Not @error Then
        ExitLoop
    EndIf
    Sleep(25)
    $anus = $anus + 1
    
    If $anus = 100 Then
        MouseMove(15,100,1)
        $pixel=PixelSearch($Left_FS,$Top_FS,$Right_FS,$Bottom_FS,6502655,0,5)
        If Not @error Then
            MouseClick ( "left" , $pixel[0] + 185 , $pixel[1] -179 , 1,0)
        Else
            _FileWriteLog(@ScriptDir & "\Bot.log","[Buy_Tp]-->Hmmmmmmm...Could Not Detect Act 5 On Second Check!!" )
        EndIf
    EndIf
    
    If $anus = 200 Then
        MouseMove(15,100,1)
        $pixel=PixelSearch($Left_FS,$Top_FS,$Right_FS,$Bottom_FS,6502655,0,5)
        If Not @error Then
            MouseClick ( "left" , $pixel[0] + 185 , $pixel[1] -179 , 1,0)
        Else
            _FileWriteLog(@ScriptDir & "\Bot.log","[Buy_Tp]-->Hmmmmmmm...Could Not Detect Act 5 On Third Check!!" )
        EndIf
    EndIf
    Until $anus = 250
If $anus = 250 Then
_FileWriteLog(@ScriptDir & "\Bot.log","[Buy_Tp]-->Could Not Move From Waypoint!!" )
EndIf

MouseMove(15,100,1)
$pixel=PixelSearch($Left_FS,$Top_FS,$Right_FS,$Bottom_FS,6502655,0,5)
If Not @error Then
    MouseClick ( "left" , $pixel[0] + 285 , $pixel[1] -279 , 1,0)
Else
    _FileWriteLog(@ScriptDir & "\Bot.log","[Buy_Tp]-->ROFL Weird..." )
EndIf

Sleep(200)
$anus = 0
Do
    $pixel=PixelSearch(420,485,485,577,65304,0,5)
    If Not @error Then
        ExitLoop
    EndIf
    Sleep(25)
    $anus = $anus + 1
        If $anus = 100 Then
        MouseMove(15,100,1)
        $pixel=PixelSearch($Left_FS,$Top_FS,$Right_FS,$Bottom_FS,6502655,0,5)
        If Not @error Then
            MouseClick ( "left" , $pixel[0] + 285 , $pixel[1] -279 , 1,0)
        Else
            _FileWriteLog(@ScriptDir & "\Bot.log","[Buy_Tp]-->Hmmmmmmm...Could Not Detect Act 5 On Fourth Check!!" )
        EndIf
    EndIf
    
    If $anus = 200 Then
        MouseMove(15,100,1)
        $pixel=PixelSearch($Left_FS,$Top_FS,$Right_FS,$Bottom_FS,6502655,0,5)
        If Not @error Then
            MouseClick ( "left" , $pixel[0] + 285 , $pixel[1] -279 , 1,0)
        Else
            _FileWriteLog(@ScriptDir & "\Bot.log","[Buy_Tp]-->Hmmmmmmm...Could Not Detect Act 5 On Fifth Check!!" )
        EndIf
    EndIf
Until $anus = 250
If $anus = 250 Then
_FileWriteLog(@ScriptDir & "\Bot.log","[Buy_Tp]-->Could Not Move From Waypoint!!" )
EndIf

Sleep(50)

$pixel=PixelSearch(328,404,540,576,65304,0,5)
If Not @error Then
    $ClickPos1 = $pixel[1] -364
    If $ClickPos1 < 31 Then
    $ClickPos = 31
    Else
    $ClickPos = $ClickPos1
    EndIf
    MouseClick ( "left" , $pixel[0] + 259 , $ClickPos , 1,0)
Else
    _FileWriteLog(@ScriptDir & "\Bot.log","[Buy_Tp]-->This Is Really Crazy...Still Can Not Move From Waypoint." )
EndIf

Sleep(200)
$anus = 0
Do
    $pixel=PixelSearch(193,111,343,253,65304,0,5)
    If Not @error Then
        ExitLoop
    EndIf
    Sleep(25)
    $anus = $anus + 1
Until $anus = 250
If $anus = 250 Then
_FileWriteLog(@ScriptDir & "\Bot.log","[Buy_Tp]-->Could Not Move From Waypoint After Plenty Of Checks, Let's Move Via Tile Blocks!!" )
$pixel = pixelsearch(15,50,800,500,16776010,0)
If Not @error Then
    MouseClick("left", $pixel[0], $pixel[1],1,0)
    Sleep(1000)
EndIf
$pixel = pixelsearch(15,50,800,500,16776010,0)
If Not @error Then
    MouseClick("left", $pixel[0], $pixel[1],1,0)
    Sleep(1000)
EndIf
$pixel = pixelsearch(15,50,800,500,11907839,0)
If Not @error Then
    MouseClick("left", $pixel[0], $pixel[1],1,0)
    Sleep(1000)
EndIf
$pixel = pixelsearch(15,50,800,500,11907839,0)
If Not @error Then
    MouseClick("left", $pixel[0], $pixel[1],1,0)
    Sleep(1000)
EndIf
MouseClick("left",700,85,1,0)
Sleep(250)
MouseClick("left",700,85,1,0)
Sleep(250)
MouseClick("left",700,85,1,0)
Sleep(250)
EndIf

Sleep(50)
_FileWriteLog(@ScriptDir & "\Bot.log","[Buy_Tp]-->Success = Made It To Act 5 Start Point From Act 5 Waypoint.")
Sleep(1000)

if PixelGetColor(60,590) = 1024 Or PixelGetColor(780,575) = 1024 or PixelGetColor(752,578) = 1024 or PixelGetColor(779,583) = 1024 Or PixelGetColor(774,578) = 1024 or PixelGetColor(759,586) = 1024 Then
    _FileWriteLog(@ScriptDir & "\Bot.log","[**FAILED**]-->Buy_Tp.au3 Because Battlenet Room Detected Trying To Buy Town Portals!!")
    Exit(0)
EndIf

$PathName = "StartToMalah"
    Call(Path ($PathName))
    Sleep($nomenu_delay)
    $Mala_Search = PixelSearch(5, 5, 600, 300, $NPC_BODY_Color, 0, 10)
    If Not @error Then
    MouseClick("left", $Mala_Search[0] + 15, $Mala_Search[1] + 15, 1, 10)
    Sleep(500)
    MouseMove(5,35,1)
    CheckMove ($random_delay)
Else
    MouseClick("right", 65,265, 1,0)
    Sleep(500)
    $Mala_Search = PixelSearch(5, 5, 600, 300, $NPC_BODY_Color, 0, 10)
    If @error Then
    MouseClick("right", 65,265, 1,0)
    Sleep(500)
    $Mala_Search = PixelSearch(5, 5, 600, 300, $NPC_BODY_Color, 0, 10)
    If @error Then
    _FileWriteLog(@ScriptDir & "\Bot.log","[**FAILED**]-->Buy_Tp.au3 Because Could Not See Malah!!")
    Exit(0)
EndIf
EndIf
EndIf
    
$No_Menu = 0
$Menu = 0
Do
    Sleep($nomenu_delay)
    $Open_Menu = PixelSearch(300, 75, 600, 300, $NPC_MENU_Color, 0, 5)
    If Not @error Then
        _FileWriteLog(@ScriptDir & "\Bot.log","[Buy_Tp]-->Malah Menu Located.")
        $Menu = 1
    Else
        $No_Menu = $No_Menu + 1
        $Mala_Search_Again = PixelSearch(5, 5, 600, 300, $NPC_BODY_Color, 0, 10)
        If Not @error Then
        MouseClick("left", $Mala_Search_Again[0] + 15 , $Mala_Search_Again[1] + 15, 1, 10)
        Sleep(500)
        MouseMove(5,35,1)
        CheckMove ($random_delay)
    Else
        _FileWriteLog(@ScriptDir & "\Bot.log","[**FAILED**]-->Buy_Tp.au3 Because Could Not See Malah!!")
        Exit(0)
        EndIf
        if PixelGetColor(60,590) = 1024 Or PixelGetColor(780,575) = 1024 or PixelGetColor(752,578) = 1024 or PixelGetColor(779,583) = 1024 Or PixelGetColor(774,578) = 1024 or PixelGetColor(759,586) = 1024 Then
        _FileWriteLog(@ScriptDir & "\Bot.log","[**FAILED**]-->Buy_Tp.au3 Because Battlenet Room Detected Trying To Buy Town Portals!!")
            Exit(0)
        EndIf
    EndIf
Until $Menu = 1 Or $No_Menu = 10
    
If $Menu = 1 then   
    $Open_Menu = PixelSearch(300, 75, 600, 300, $NPC_MENU_Color, 0, 5)
    If Not @error Then
    mouseClick("left", $Open_Menu[0] + 85, $Open_Menu[1] + 35, 1, 10)
    Sleep($random_delay2)
    MouseMove(5,35,1)
    EndIf
EndIf

If $No_Menu = 10 Then
    _FileWriteLog(@ScriptDir & "\Bot.log","[**FAILED**]-->Buy_Tp.au3 Because Took To Many Clicks To Get Menu On Screen!!")
    Exit(0)
EndIf

$TP_Find = 0
$No_TP_Find = 0
Do
    Sleep($nomenu_delay)
    $TPScroll2 = PixelSearch(5, 5, 600, 400, 16720037, 0, 10)
    If Not @error Then
        $TP_Find = 1
    else
        $No_TP_Find = $No_TP_Find + 1
        Send("{SPACE}")
        Sleep($random_delay)
        Send("{SPACE}")
            $Mala_Search_Again2 = PixelSearch(5, 5, 600, 300, $NPC_BODY_Color, 0, 10)
            If Not @error Then
            MouseClick("left", $Mala_Search_Again2[0] + 15 , $Mala_Search_Again2[1] + 15, 1, 15)
            CheckMove ($random_delay)
            MouseMove(5,35,1)
            Sleep(500)
            EndIf
            $Open_Menu_again = PixelSearch(300, 75, 600, 300, $NPC_MENU_Color, 0, 5)
            If Not @error Then
            MouseClick("left", $Open_Menu_again[0] + 85, $Open_Menu_again[1] + 35, 1, 10)
            Sleep($random_delay2)
            MouseClick("left", 360, 80, 1, 5)
            CheckMove ($random_delay2)
            EndIf
            if PixelGetColor(60,590) = 1024 Or PixelGetColor(780,575) = 1024 or PixelGetColor(752,578) = 1024 or PixelGetColor(779,583) = 1024 Or PixelGetColor(774,578) = 1024 or PixelGetColor(759,586) = 1024 Then
            _FileWriteLog(@ScriptDir & "\Bot.log","[**FAILED**]-->Buy_Tp.au3 Because Battlenet Room Detected Trying To Buy Town Portals!!")
                Exit(0)
            EndIf
            $TPScroll = PixelSearch(5, 5, 600, 400, 16720037, 0, 10)
            If Not @error Then
                $TP_Find = 1
            EndIf
    EndIf       
Until $TP_Find = 1  Or $No_TP_Find = 5

If $TP_Find = 1 Then
        $TPScroll2 = PixelSearch(5, 5, 600, 400, 16720037, 0, 10)
        If Not @error Then
            Send("{SHIFTDOWN}")
            MouseMove($TPScroll2[0] + 5, $TPScroll2[1] + 5, 5)
            Sleep(500)
            if PixelGetColor(60,590) = 1024 Or PixelGetColor(780,575) = 1024 or PixelGetColor(752,578) = 1024 or PixelGetColor(779,583) = 1024 Or PixelGetColor(774,578) = 1024 or PixelGetColor(759,586) = 1024 Then
            _FileWriteLog(@ScriptDir & "\Bot.log","[**FAILED**]-->Buy_Tp.au3 Because Battlenet Room Detected Trying To Buy Town Portals!!")
                Exit(0)
            EndIf
            MouseClick("right", $TPScroll2[0] + 5, $TPScroll2[1] + 5, 1, 10)
            CheckMove ($random_delay)
            Send("{SHIFTUP}")
            _FileWriteLog(@ScriptDir & "\Bot.log","[Buy_Tp]-->Town Portal Tome Filled.")
            IniWrite(@ScriptDir & "\Bot_Keys.ini", "Settings", "TP_Made", "0")
            EndIf
            Sleep($random_delay2)
            Send("{SPACE}")
            Sleep($random_delay2)
            Send("{SPACE}")
            Sleep($random_delay)
EndIf
        
If $No_TP_Find = 5 Then     
_FileWriteLog(@ScriptDir & "\Bot.log","[**FAILED**]-->Buy_Tp.au3 Because Took To Many Tries To Get Town Portal On Screen!!")
    Exit(0)
EndIf

If FromBlockClickTo(50, 5, 795, 550, - 250, 130, 2, 0) == 0 Then
            FastClick("Left", 595, 345, 5, 2)
            CheckMove ($Char_CheckMoveDelay * 2)
EndIf

If FromBlockClickTo(50, 5, 795, 550, 41, 212, 2, -1) == 0 Then 
    EndIf
If FromBlockClickTo(50, 5, 750, 550, - 140, 380, 3, 0) == 0 Then 
    EndIf
If FromBlockClickTo(300, 300, 795, 570, - 230, - 100, 2, 0) == 0 Then 
endif
If FromBlockClickTo(400, 25, 795, 545, - 230, 20, 2, 0) == 0 Then 
Else
    Exit(1)
EndIf
EndIf

Func FromBlockClickTo ($XBS_Start, $YBS_Start, $XBS_Stop, $YBS_Stop, $XBlock, $YBlock, $NBClicks, $BRCMODE)
$XBS_Start = $XBS_Start + $XDiff
$YBS_Start = $YBS_Start + $YDiff
$XBS_Stop = $XBS_Stop + $XDiff
$YBS_Stop = $YBS_Stop + $YDiff
$FailsCount = 0
Do
    $XYBlock = PixelSearch ($XBS_Start, $YBS_Start, $XBS_Stop, $YBS_Stop, $GREEN_BLOCKS_Color, 0, 15)
    If Not @error Then
        $XBS = $XYBlock[0]
        $YBS = $XYBlock[1]
        Do
            $XBS = $XBS + 4
            $ApixBS = PixelGetColor ($XBS, $YBS)
        Until $ApixBS <> 65304
        Do
            $YBS = $YBS - 4
            $ApixBS = PixelGetColor ($XBS, $YBS)
        Until $ApixBS <> 65304
        $XBC = $XBS + $XBlock
        $YBC = $YBS + $YBlock
        If $NBClicks > 1 Then
            $NBClicks = $NBClicks + Round(Random(0, 1))
        EndIf
        If $BRCMODE == - 1 Then
            While 1
                $tp_Pix = PixelSearch ($XBC - 200, $YBC - 200, $XBC + 100 , $YBC + 100, $UNID_RED_Color, 0, 10)
                If Not @error Then
                    Dim $tp_PixS[9]
                    $tp_PixS[1] = PixelGetColor($tp_Pix[0]+1, $tp_Pix[1])
                    $tp_PixS[2] = PixelGetColor($tp_Pix[0]+3, $tp_Pix[1])
                    $tp_PixS[3] = PixelGetColor($tp_Pix[0]-1, $tp_Pix[1])
                    $tp_PixS[4] = PixelGetColor($tp_Pix[0]-3, $tp_Pix[1])
                    $tp_PixS[5] = PixelGetColor($tp_Pix[0], $tp_Pix[1]+1)
                    $tp_PixS[6] = PixelGetColor($tp_Pix[0], $tp_Pix[1]+3)
                    $tp_PixS[7] = PixelGetColor($tp_Pix[0], $tp_Pix[1]-1)
                    $tp_PixS[8] = PixelGetColor($tp_Pix[0], $tp_Pix[1]-3)
                    $SimpleCounter = 0
                    For $p = 1 To 8
                        If $tp_PixS[$p] == $UNID_RED_Color Then
                            $SimpleCounter = $SimpleCounter + 1
                        EndIf
                    Next
                    If $SimpleCounter >= 4 Then
                        $XBC = $XBC + 15
                    $YBC = $YBC + 15
                    ContinueLoop
                    Else
                            ExitLoop
                    EndIf
                Else
                    ExitLoop
                EndIf
            Wend
        EndIf
        
        If $XBC > 795 Then
            $XBC = 795
        EndIf
        If $YBC > 550 Then
            $YBC = 550
        EndIf
        If $XBC < 5 Then
            $XBC = 5
        EndIf
        If $YBC < 35 Then
            $YBC = 35
        EndIf
        FastClickAbs("Left", $XBC, $YBC, 1, $NBClicks)
        CheckMove($Char_CheckMoveDelay)
        Return 1        
    EndIf
    $FailsCount = $FailsCount + 1
    Sleep (Random(200,300))
Until $FailsCount > 2
;Feedback("FromBlockClickTo Error ID: " & $XBS_Start & ", " & $YBS_Start & ", " & $XBS_Stop & ", " & $YBS_Stop & ", " & $XBlock & ", " & $YBlock & ", " & $NBClicks & ", " & $BRCMODE, 2)
Return 0
EndFunc


;========================================================
; Make a paused click. Nice for Tps.
;========================================================
Func FromBlockSureClick ($XBS_Start, $YBS_Start, $XBS_Stop, $YBS_Stop, $XBlock, $YBlock)
    CheckMove($Char_CheckMoveDelay)
    Sleep (Random(150,200))
    If FromBlockClickTo ($XBS_Start, $YBS_Start, $XBS_Stop, $YBS_Stop, $XBlock, $YBlock, 0, 0) == 0 Then
        Return 0
    EndIf
    Sleep (Random(200,250))
    MouseDown ("Left")
    Sleep (Random(80,100))
    MouseUp ("Left")
    CheckMove($Char_CheckMoveDelay)
    Return 1
EndFunc

;================================
; Randomized fast click Absolute
;================================
Func FastClickAbs($Button, $X, $Y, $R = 5, $N = 1)
    MouseMove($X + Random(- $R, $R), $Y + Random(- $R, $R), $D2_FastIntMDelay)
    Sleep ($D2_FastClickDelaysRange)
    For $Repeat = 1 To $N
        MouseDown ($Button)
        Sleep ($D2_FastClickDelaysRange)
        MouseUp ($Button)
        Sleep ($D2_FastClickDelaysRange)
    Next
EndFunc

;=======================
; Randomized slow click
;=======================
Func SlowClick($Button, $X, $Y, $R = 5, $N = 1)
    MouseMove($X + Random(- $R, $R) + $XDiff, $Y + Random(- $R, $R) + $YDiff, $D2_SlowIntMDelay)
    Sleep ($D2_SlowClickDelaysRange)
    For $Repeat = 1 To $N
        MouseDown ($Button)
        Sleep ( $D2_SlowClickDelaysRange)
        MouseUp ($Button)
        Sleep ($D2_SlowClickDelaysRange)
    Next
EndFunc

;=======================
; Randomized fast click
;=======================
Func FastClick($Button, $X, $Y, $R = 5, $N = 1)
    MouseMove($X + Random(- $R, $R) + $XDiff, $Y + Random(- $R, $R) + $YDiff, $D2_FastIntMDelay)
    Sleep (30)
    For $Repeat = 1 To $N
        MouseDown ($Button)
        Sleep (30)
        MouseUp ($Button)
        Sleep (30)
    Next
EndFunc



;=======================================================================
; Wait stop move function, function loop until character is stop moving
;=======================================================================
Func CheckMove ($Delay)
$X_Start = 5 + $XDiff   ; Left side of area
$X_Stop = 795 + $XDiff  ; Right side of area
$Y_Start = 35 + $YDiff  ; Up side of area
$Y_Stop = 510 + $YDiff  ; Bottom side of area
$Begin = TimerInit()
Do
    $CMA0 = PixelGetColor($X_Start, $Y_Start)
    $CMB0 = PixelGetColor($X_Stop, $Y_Start)
    $CMC0 = PixelGetColor($X_Stop, $Y_Stop)
    $CMD0 = PixelGetColor($X_Start, $Y_Stop)
    $CME0 = PixelGetColor(400 + $XDiff, $Y_Start)
    $CMF0 = PixelGetColor(400 + $XDiff, $Y_Stop)
    $CMG0 = PixelGetColor($X_Start, 240 + $YDiff)
    $CMH0 = PixelGetColor($X_Stop, 240 + $YDiff)
    Sleep ($Delay)
    $CMA1 = PixelGetColor($X_Start, $Y_Start)
    $CMB1 = PixelGetColor($X_Stop, $Y_Start)
    $CMC1 = PixelGetColor($X_Stop, $Y_Stop)
    $CMD1 = PixelGetColor($X_Start, $Y_Stop)
    $CME1 = PixelGetColor(400 + $XDiff, $Y_Start)
    $CMF1 = PixelGetColor(400 + $XDiff, $Y_Stop)
    $CMG1 = PixelGetColor($X_Start, 240 + $YDiff)
    $CMH1 = PixelGetColor($X_Stop, 240 + $YDiff)
    
    $Check5 = 0
    If $CMA0==$CMA1 Then
        $Check5 = $Check5 + 1
    EndIf
    If $CMB0==$CMB1 Then
        $Check5 = $Check5 + 1
    EndIf
    If $CMC0==$CMC1 Then
        $Check5 = $Check5 + 1
    EndIf
    If $CMD0==$CMD1 Then
        $Check5 = $Check5 + 1
    EndIf
    If $CME0==$CME1 Then
        $Check5 = $Check5 + 1
    EndIf
    If $CMF0==$CMF1 Then
        $Check5 = $Check5 + 1
    EndIf
    If $CMG0==$CMG1 Then
        $Check5 = $Check5 + 1
    EndIf
    If $CMH0==$CMH1 Then
        $Check5 = $Check5 + 1
    EndIf
    If ($Check5 >= 6) Then
        ExitLoop
    EndIf
Until (TimerDiff($Begin)>3000)
EndFunc

Func Path($PathName)
    
Select

    
    Case $PathName == "StartToMalah"
        Sleep(1500)
        If FromBlockClickTo (50, 5, 750, 550, - 230, 140, 3, 0) == 0 Then
            Return 0
        EndIf
        
    
EndSelect
Return 1
EndFunc



_FileWriteLog(@ScriptDir & "\Bot.log","[Buy_Tp]-->Success = Made It Down Stairs.")
Exit(1)

anyone knows what's going wrong on my script or autoit (besides i have already rolled this script in the past and it worked)

Edited by liquiddeath

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.