Jump to content

modified a bot for top so it could support ao(angel online)


naw
 Share

Recommended Posts

ok like the topic says if have modified it but the thing is its not picking up any pixel can that happen??

originally made by blubblub modified by candy

Opt("MouseClickDownDelay", 100)

Global $Paused
HotKeySet("^p", "Pause")
Func Pause()
    $Paused = NOT $Paused
    While  $Paused
        Sleep (400)
    WEnd
EndFunc

Func _Sleep($iN)
    If Not StringIsDigit($iN) Then Return 0
    $tSleep = TimerInit()
    While TimerDiff($tSleep) < $iN
    WEnd
    Return 1  
EndFunc

Global $quit
HotKeySet("^x","quit")
Func quit()
    Exit
EndFunc

Global $znajdz=1
Global $znajdz2=1
Global $znajdz3=1
Global $szukaj=0
Global $szukaj2=0
Global $szukaj3=0
;IsArray($szukaj)
;IsArray($szukaj2)
;IsArray($szukaj3)

Global $kolor
Global $ctargeted
Global $wfmtd

$ngame = "Angels Online - (Haniel-1)"

$ctargeteda = 0x4a4d4a;main color of the blue circle around targets
$ctargetedb = 0x4a4d4a;alternative color of the blue circle around targets

$kolor = 0x52ffff

$wfmtd = 3000; wait for monster to disapear

Global $lowhp=30;if the lower of given %(in example 70%) it will sit down(works when no monsters in area of searching)
Global $recharged=90;it will stand up when reached the % of hp or more(works when the sit when it was engage by the $lowhp)
Global $mlowhp=10;if the lower of givem %(in example 30%) it will sit down iven if there are monsters on screen to disable just give 0
Global $mrecharged=70;it will stand up when reached the % of hp or more(works when the sit when it was engaged by $mlowhp)
Global $minsp=20;it will cast skill only if SP is higher then the % or more

Global $opcje=0
Global $czas=0
Global $granie=0
Global $czekanie=0
Global $poweroff=0
Global $wybor=0
Global $pozycja=0
Global $i=0

sleep(100)

$opcje = MsgBox(4,"Antidetect","Do you want to enable some auto relogin or logout/poweroff options")
If $opcje=6 Then
    $wybor = InputBox("Logout", "If you want to auto relog press 1 and ok, logout/poweroff press 2 or both press 3")
    If $wybor=1 Then
        $granie= InputBox("Autorelogin","Set the botting time when loged in minutes(for example 60)","60")
        $granie=$granie*60000
        $czekanie= InputBox("Autorelogin","Set the wating time to log in after reloged(for exmaple 10","10")
        $czekanie=$czekanie*60000
        $pozycja= InputBox("Char Pos", "Set the position of the character that your playing looking from the left(1,2 or 3)","1")
    EndIf
    If $wybor=2 Then
        $czas = Inputbox("Time", "Set the perioid of time(in min for example 180) to bot before logout", "180") 
        $czas = $czas*60000
        $poweroff = MsgBox(4,"Poweroff","Do you want to shutdown and power off the pc after the logout?")
    EndIf
    If $wybor=3 Then
        $granie= InputBox("Autorelogin","Set the botting time when loged in minutes(for example 60)","60")
        $granie=$granie*60000
        $czekanie= InputBox("Autorelogin","Set the wating time to log in afther reloged in minutes(for exmaple 10","10")
        $czekanie=$czekanie*60000
        $czas = Inputbox("Time", "Set the perioid of time in minutes(for example 180) to bot before logout", "180")
        $czas = $czas*60000
        $poweroff = MsgBox(4,"Poweroff","Do you want to shutdown and power off the pc after the logout?")
    EndIf
EndIf

$pmout = MsgBox(4,"Pm detection","Do you want to relogin if someone pm's you ?")
If $pmout=6 then
    If $wybor<>1 and $wybor<>3 Then
        $czekanie= InputBox("Autorelogin","Set the wating time to log in after reloge im minutes(for exmaple 10","10")
    EndIf
EndIf


#cs
Func trup()
    $0hp = Pixelsearch(78,49,82,54,0xD62C31,1,1)
    $pusto=@error
    If $pusto=1 Then
        sleep(10000)
        MouseClick("left",304,278,1,5)
        sleep(1000)
        If $wybor=2 or $wybor=3 Then
            TrayTip("DEATH","char died if set to power off pc will turn off in 1 min press F10 to quit",60000)
            Sleep(60000);
            logout()
        EndIf
        Exit
    EndIf
EndFunc
#ce

Func isdead();returns if the monster is dead or if you have not engaged a monster yet 
    $i = 0  
    ActivateGW()
    Do
    
        $cbluea = PixelSearch(323,89,462,119,$ctargeteda,1,1)
        $deada = @error
        $cblueb = PixelSearch(459,95,343,117,$ctargetedb,1,1); searches for the 2 colors of the blu circle set by you 459,95,343,117
        $deadb = @error                                      
        
        If $deada = 1 And $deadb = 1 Then; if it cannot find any of them 
            $dead = 1;returns 1
        Else 
            $dead = 0; if it can find one of the two then i returns 0
        EndIf
        
        Sleep(25)
        If $dead = 1 Then
            $i = $i + 1; it will check so many times until 
        Else 
            $i = 0
        EndIf
    
    Until $i = 40;he is completly sure that there is no monster targeted ... $i = "so many times it checkes" 
    Return $dead
EndFunc

Func siadaj($shpmax); this is the funcion that controls sitting and standing
    sleep(50)
    Send("{INSERT}"); it sits
    sleep(50)   
    Do
        ActivateGW()
        sleep(100)
        $hpproc = Pixelsearch($shpmax+114,62,$shpmax+118,62,0xEF3831,1,1)
        $notrecharged = @error 
        sleep(2000)
    ;trup()
    Until $notrecharged=0; as long as there is no HP in the point set by you with $mrecharged or $recharged it sits down  acik change to one actually 0
    sleep(50)
    Send("{INSERT}")
    Sleep(50)
EndFunc


Func hp($hpmin, $hpmax)
    ActivateGW()
    $zycie2 = Pixelsearch($hpmin+114,62,$hpmin+120,62,0xEF3831,1,1); it searches to see if the HP is lower than the value set by you
    $min = @error; if it is lower and
    If $min = 1 then
        sleep(50)
        
        $dead = isdead();if there is no monster engaged or it already died
        If $dead = 1 Then
            siadaj($hpmax);it sits until HP reaches the value set by you with $mrecharged or $recharged
        EndIf
        
        sleep(50)
    EndIf
EndFunc


Func cskill($fkey)
    ActivateGW()
    $cblue = Pixelsearch($minsp+114,74,$minsp+118,74,0x3169d6,1,1)
    $notfound = @error; if SP is higher than the value set by you with $minsp
    If $notfound=1 Then
        Send($fkey); it casts $fkey skill
    EndIf
    
EndFunc


Func gm(); i hate thisfunction ... tho you cannot make it better ... well i can't :P
    ActivateGW()
;$znaczek = PixelSearch(50,100,700,450,0xF7E74A,1,1)
;$znaczek1=@error
    $znaczek1=1
    $ziemia = Pixelsearch(300,200,535,390,0xE78639,1,1)
    $ziemia1=@error
    If $znaczek1=0  or $ziemia=0 Then
        Traytip("GM detection","GM near or teleported to orange island",0)
        sleep(1000)
        logout()
        Exit
    EndIf
     
 EndFunc
 
 Func loot()
     Sleep(50)
     Send("^a"); it loots
     Sleep(50)
EndFunc


Global $justdied

$justdied = 0; this is the variable that doesen't let you to loot like crazy ppl do every 2 secconds ... 

Func go()
    MouseMove(7,589,1)
    sleep(100)
    
    $dead = isdead(); checkes if the monster is dead
    
    If $justdied = 1 Then;if the monster is dead or there is no monster engaged
        $justdied = 0; sets the walue as engaded ... this is kindof like marking it as looted not to loot again until it attacks another monster
        Sleep(Random(50,500))
        loot();and loots
        sleep($wfmtd)
    EndIf

    If $dead = 1 Then; if the last monster you attacked or there was no monster attacked   5,21,1020,784  1028,4,14,764
       ;$szukaj = Pixelsearch(5,21,1020,784,$kolor,1,1)
        $szukaj = PixelSearch(5,21,1020,784,$kolor,1,1)
        $znajdz = @error; starts looking for monster nearby
        If $znajdz=0 Then; if it finds monster nearby
            hp($mlowhp, $mrecharged);he checks if your hp is high enough to make an attack ... if yes then it attacks if not he sits a bit longer
        ;cskill("{F4}"); change F4 with whatever F key you wish ... work with self buffs like berserk or will of steel. place a; in front of this line if you don't want any skill to be casted ... 
            Mouseclick("left",$szukaj[0],$szukaj[1],1,1); and it attacks the monster
            sleep(100)
            MouseMove(7,589,1);moves the mouse in the left down corner not to bother when checking for monster
            sleep(100)
            $justdied = 1;and marks the monster as dead
        Else
            sleep(200)
            $szukaj2 = Pixelsearch(5,21,1020,784,$kolor,1,1); this is if he doesent find a monster nearby it checks for monster on almost the entire screen
           ;$szukaj2 = Pixelsearch(1028,4,14,764,$kolor,1,1)
            $znajdz2 = @error
            If $znajdz2=0 Then
                hp($mlowhp, $mrecharged)
            ;cskill("{F4}")
                Sleep(200)
                Mouseclick("left",$szukaj2[0],$szukaj2[1],1,1)
                sleep(200)
                MouseMove(7,589,1)
                sleep(100)
                $justdied = 1
            Else
                sleep(200)
                hp($lowhp, $recharged)
                sleep(200)
            EndIf
        EndIf
    EndIf

EndFunc

Func logout()
    Sleep(100)
    Send("!o")
    sleep(1000)
    MouseClick("left",401,406)
    sleep(1000)
    MouseClick("left",405,359)
    If $poweroff=6 Then
        Shutdown(9)
        sleep(10000)
    Else
        Exit
    EndIf
EndFunc

Func relogin2()
    $czekanie1=Timerinit()
    Sleep(100)
    Send("!o")
    sleep(1000)
    MouseClick("left",401,370)
    sleep(1000)
    MouseClick("left",404,363)
    While TimerDiff($czekanie1)<$czekanie
    WEnd
    If $pozycja=1 Then
        Mouseclick("left",211,350,1,5)
        sleep(1000)
        MouseClick("left",211,450,1,5)
        sleep(1000)
        Mouseclick("left",429,587,1,10)
        sleep(10000)
    EndIf
    If $pozycja=2 Then
        Mouseclick("left",443,333,1,5)
        sleep(1000)
        MouseClick("left",443,400,1,5)
        sleep(1000)
        Mouseclick("left",429,587,1,10)
        sleep(10000)
    EndIf
    If $pozycja=3 Then
        Mouseclick("left",637,340,1,5)
        sleep(1000)
        MouseClick("left",637,440,1,5)
        sleep(1000)
        Mouseclick("left",429,587,1,10)
        sleep(10000)
    EndIf
EndFunc

Func pms()
    If $pmout=6 then
        $pms = Pixelsearch(51,584,80,589,0xFF96F7,1,1)
        $fiolet= @error
        If @error=0 Then
            relogin2()
        EndIf
    EndIf
EndFunc


Func relogin()
    $czekanie1=Timerinit()
    Sleep(100)
    Send("!o")
    sleep(1000)
    MouseClick("left",401,370)
    sleep(1000)
    MouseClick("left",404,363)
    While TimerDiff($czekanie1)<$czekanie
    WEnd
    If $pozycja=1 Then
        Mouseclick("left",211,350,1,5)
        sleep(1000)
        MouseClick("left",211,450,1,5)
        sleep(1000)
        Mouseclick("left",429,587,1,10)
        sleep(10000)
    EndIf
    If $pozycja=2 Then
        Mouseclick("left",443,333,1,5)
        sleep(1000)
        MouseClick("left",443,400,1,5)
        sleep(1000)
        Mouseclick("left",429,587,1,10)
        sleep(10000)
    EndIf
    If $pozycja=3 Then
        Mouseclick("left",637,340,1,5)
        sleep(1000)
        MouseClick("left",637,440,1,5)
        sleep(1000)
        Mouseclick("left",429,587,1,10)
        sleep(10000)
    EndIf
    $granie1 = TimerInit()
EndFunc

Func ActivateGW()
    $wactive = WinActive($ngame)
    If $wactive = 0 Then
        $wpos = WinGetPos($ngame)
        $wposer = @error
        If $wposer = 0 Then
            If $wactive = 0 Or $wpos[0] <> 1 Or $wpos[1] <> 1 Then
                sleep(50)
                WinActivate ($ngame); makes the game window active
                sleep(50)
                WinMove($ngame,"",1,1); and moves it at 1,1 ... thats left upper corner
                sleep(1000)
            EndIf
        Else
            MsgBox(1,"Game Not Found", "Start your game before you start the script.")
            Exit;   
        EndIf
    EndIf
EndFunc

Mouseclick("left",49,609)
sleep(300)
$x1=33
$a=0
Do; from here 
    $chat = PixelSearch(151+$x1,583,166+$x1,588,0x5A1C00)
    $wylacz= @error
    sleep(200)
    If $wylacz=0 Then
        sleep(200)
        Mouseclick("left",$chat[0],$chat[1],1,2)
    EndIf
    $a=$a+1
    $x1=$x1+33
Until $a=4
sleep(100)
Mouseclick("left",49,609)
If $opcje=6 Then
    If $wybor=2 or $wybor=3 Then
        $czas1 = TimerInit()
    EndIf
    If $wybor=1 or $wybor=3 Then
        $granie1= TimerInit()
    EndIf
EndIf; until here it deactivates the guild, world and trade channel ... is almost useless ... but makes it harder for you to set a color of the text find on a monster thus making it to conituously click on the chat window ...
    sleep(300)

Do
    ActivateGW()
    go(); starts the fun
    If $wybor=2 or $wybor=3 Then
        If TimerDiff($czas1) > $czas Then
            logout()
        EndIf;a logout procedure that i never use ... you could tho
    EndIf
    
    If $wybor=1 or $wybor=3 Then
        If TimerDiff($granie1) > $granie Then
            relogin(); a relogin procedure that i don't need since i don't use the logout() ... :P
        EndIf
    EndIf
    pms();the function that checks for PM's i never activate it in the start so it just sits here not to be in another place ^^
    gm(); the function that checks for gm but since i don't use it i had it commented ... just delete the ';' that are in front to activate it 
Until 1-1=1;does this until 1-1=1 ... that as i know a bit of math is kindof forever ... press Ctrl+P to pause, same for start it if in Pause, and Ctrl+X to close it down
Edited by Jos
added code tags
Link to comment
Share on other sites

  • 4 weeks later...

The answer is in there. You have just about answered you own question with your question.

Stupid thing what i heard >.>

huh?

Ehm ok i will see

oyeah ps: it says start the game before you start the script

Already did!!!

Edited by Mek
Link to comment
Share on other sites

  • 2 weeks later...
  • 4 months later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...