Jump to content

Newbie strikes again


Amnael
 Share

Recommended Posts

Hello again ! The big bad newbie struggled a lot , and with a bit of help , i made this bot for Tales of Pirates Online . Now what i want from you guys is to tell me if is something wrong or to give me ideas to improve and make it better . It would be just awesome if you can test it , but only if you can. Thank you for reading this and i hope i'll get some good lines .

CODE :

#Include <Misc.au3>

WinActivate("Pirate")

WinWaitActive("Pirate")

Opt("PixelCoordMode", 2) ;1=absolute, 0=relative, 2=client

Opt("MouseCoordMode", 2) ;1=absolute, 0=relative, 2=client

; Below is some pixel colors to use for certain animals.

;~ 0xEBB5D6 Dry Mystic Shrubs

;~ 0x844952 Snowy Mystic Shrub

;~ 0x295118 Melons & Cactus

;~ 0x538BA7 Debug the HP Bar/Heal function

;~ 0xF7D7BD Humpy Camel

;~ 0xCE9231 Bear Cub

;~ 0x6B3021 Cuddly Lamb

;~ 0xDE7573 Sea snail

;~ 0xB56508 Little Deer - Elk

;~ 0x393894 Sailor Penguin

;~ 0x5265CE Naiad

;~ 0x84DF52 Oyster 0x636D5A <-- grey on green oyster Yellow--> 0xF7FF84

;~ 0xF77500 Horned Penguin

;~ 0x39FBBD Snowy Shroom

;~ Angelic Panda 0x181818 0x08B25A

;~ Smuggler 0x7B304A

;~ Meadow Deer 0x848E18

;~ Armored Crab 0xEF6D08-0xFFB263-0xF77921

;~ Seaweed 0x89B252 0x855E1F 0xA0844A 0x7CA140 0x675642 0x885E31

$Monsters = 0xDE7573; Pixel color being searched for

$lowhealth = 85 ; makes character auto sit if health is 40% left

$Shadevar = 0

$Attack = 0

While $Attack = 0

$coord = PixelSearch(1, 1, 780, 580, $Monsters, 1);$Shadevar) ; Looking for the Pixel "Left,Top,Right,Bottom"

If Not @error Then

;~ MsgBox(0, "Pixel", "monster " & $Shadevar, 6)

;~ MsgBox(0, "Location", "x coords " & $coord[0] & " y coords " & $coord[1],2)

MouseClick("left", $coord[0], $coord[1], 3, 4) ; clicking the pixel

Sleep(3000) ;wait 5 seconds before picking up items

;~ Call("PickupDrops")

Send("^a")

sleep(1000)

Call("checkandheal")

$Shadevar = 0

If _IsPressed("23") Then $Attack = 1 ;if "end" is pressed then this will make $DryMystic=1 so the loop will stop

Else

$Shadevar = $Shadevar + 1 ;increase allowable shade variation by 1 until shade is found

EndIf

WEnd

MsgBox(0, "Bot Disabled", "You turned off the Bot!") ;Window name , text in the msgBox saying Bot is off !

Func checkandheal()

$coord = PixelSearch(75, 26, 183, 31, 0x538BA7, 5)

If Not @error Then

;~ MsgBox(0,"location","the x-location of the found pixelis "& $coord[0])

$healthlvl = (($coord[0] - 75) / (183 - 75)) * 100

If $healthlvl < $lowhealth Then

Send("{INS}")

$h = 0

$attack = 1

While $h = 0

Sleep(33000); 30 seconds of heal time.

PixelSearch(75, 26, 183, 31, 0x538BA7)

If @error Then

$h = 1

Send("{INS}")

sleep(1000)

$attack = 0

EndIf

WEnd

EndIf

EndIf

EndFunc ;==>checkandheal

Link to comment
Share on other sites

Hello again ! The big bad newbie struggled a lot , and with a bit of help , i made this bot for Tales of Pirates Online . Now what i want from you guys is to tell me if is something wrong or to give me ideas to improve and make it better . It would be just awesome if you can test it , but only if you can. Thank you for reading this and i hope i'll get some good lines .

CODE :

#Include <Misc.au3>

WinActivate("Pirate")

WinWaitActive("Pirate")

Opt("PixelCoordMode", 2) ;1=absolute, 0=relative, 2=client

Opt("MouseCoordMode", 2) ;1=absolute, 0=relative, 2=client

; Below is some pixel colors to use for certain animals.

;~ 0xEBB5D6 Dry Mystic Shrubs

;~ 0x844952 Snowy Mystic Shrub

;~ 0x295118 Melons & Cactus

;~ 0x538BA7 Debug the HP Bar/Heal function

;~ 0xF7D7BD Humpy Camel

;~ 0xCE9231 Bear Cub

;~ 0x6B3021 Cuddly Lamb

;~ 0xDE7573 Sea snail

;~ 0xB56508 Little Deer - Elk

;~ 0x393894 Sailor Penguin

;~ 0x5265CE Naiad

;~ 0x84DF52 Oyster 0x636D5A <-- grey on green oyster Yellow--> 0xF7FF84

;~ 0xF77500 Horned Penguin

;~ 0x39FBBD Snowy Shroom

;~ Angelic Panda 0x181818 0x08B25A

;~ Smuggler 0x7B304A

;~ Meadow Deer 0x848E18

;~ Armored Crab 0xEF6D08-0xFFB263-0xF77921

;~ Seaweed 0x89B252 0x855E1F 0xA0844A 0x7CA140 0x675642 0x885E31

$Monsters = 0xDE7573; Pixel color being searched for

$lowhealth = 85 ; makes character auto sit if health is 40% left

$Shadevar = 0

$Attack = 0

While $Attack = 0

$coord = PixelSearch(1, 1, 780, 580, $Monsters, 1);$Shadevar) ; Looking for the Pixel "Left,Top,Right,Bottom"

If Not @error Then

;~ MsgBox(0, "Pixel", "monster " & $Shadevar, 6)

;~ MsgBox(0, "Location", "x coords " & $coord[0] & " y coords " & $coord[1],2)

MouseClick("left", $coord[0], $coord[1], 3, 4) ; clicking the pixel

Sleep(3000) ;wait 5 seconds before picking up items

;~ Call("PickupDrops")

Send("^a")

sleep(1000)

Call("checkandheal")

$Shadevar = 0

If _IsPressed("23") Then $Attack = 1 ;if "end" is pressed then this will make $DryMystic=1 so the loop will stop

Else

$Shadevar = $Shadevar + 1 ;increase allowable shade variation by 1 until shade is found

EndIf

WEnd

MsgBox(0, "Bot Disabled", "You turned off the Bot!") ;Window name , text in the msgBox saying Bot is off !

Func checkandheal()

$coord = PixelSearch(75, 26, 183, 31, 0x538BA7, 5)

If Not @error Then

;~ MsgBox(0,"location","the x-location of the found pixelis "& $coord[0])

$healthlvl = (($coord[0] - 75) / (183 - 75)) * 100

If $healthlvl < $lowhealth Then

Send("{INS}")

$h = 0

$attack = 1

While $h = 0

Sleep(33000); 30 seconds of heal time.

PixelSearch(75, 26, 183, 31, 0x538BA7)

If @error Then

$h = 1

Send("{INS}")

sleep(1000)

$attack = 0

EndIf

WEnd

EndIf

EndIf

EndFunc ;==>checkandheal

this should be posted in example scripts section.
global $warming = true
Link to comment
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
 Share

  • Recently Browsing   0 members

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