PDA

View Full Version : Pirate King Online Analysis


Tart
24th October 2006, 16:17
Hi guys, I'm relatively new to the forums and I started playing Pirate King Online (http://www.piratekingonline.com) a few days ago. I decided to compile some information that I have found myself and taken from other webpages to make everyone's job of hacking this game easier.

Part 1: Packets
-------------------

Attack packets in the game are size 49. It's fairly easy to bot just with this information alone. Just record the attack packets from the monsters you click on and send them again. You might get a message saying "Illegal movement" but that is only because the monster you targetted has not spawned yet. While sending attack packets repeatedly, your character on screen will not move, however others will see you attacking monsters. To solve the problem of picking loot, press Ctrl+Shift+A to autopick. As I said, with this information alone, you can auto-hit monsters, but you do get hit back by them. If you're going to use this method, make sure you write a script on sitting/healing to avoid death. You can also bot at lower level monsters that don't hit so hard, or you can bot with a full CON swordsman.

Some people might want to dupe items, however, if you resend the pick item packets (size 25/35), you will just get an error that the item does not exist.

Other Packets:
Sit - Size 21

Part 2: Bots
--------------------------

On the GzP forums, there is a BucaneerBot for download and its source code is posted. Firstly, it reduces your chances of getting caught by including random sleep times in between attacks, making you less suspicious looking. It is also useful as you can let the bot pick up items automatically after attacking for a while. When the HP of the character is below a certain level, the bot will also sit automatically, although this function seems to be bugged for many. To use the bot, you need to run PKO and WPE at the same time, with PKO attached to WPE and attack packets ready to be sent. It is a simple bot with a simple code. I shall split it up and describe the major functions.

Hotkeyset("{HOME}","start")
Hotkeyset("{END}","stop")

Firstly, it sets the hotkeys. To start the bot, press "Home" and to end, press "End".

if Not WinExists("Pirate King Online 1.32 - 00005") then
MsgBox(1, "BucaneerBot", "You must be running Pirate king online and WPE Pro")
Exit
EndIf

It then checks whether PKO is running.

MsgBox(1, "BucaneerBot", "First you must set up WPE PRO with the attack monster packet that you want to use, if you have press OK.")
$attacktime = InputBox("BucaneerBot", "Enter the pickup time in seconds so every ? seconds it will stop attacking for a few seconds and pickup items.", "", "")
MsgBox(1, "BucaneerBot", "To start the bot, press the Home key. To end, press the End key.")
Global $stop

First, it lets the user confirm that he has set up everything, then he lets the user define regular intervals between attacks that lets the character pick up item.

Func start()
WinActivate ( 'Pirate King Online 1.32 - 00005' )
ToolTip("BucaneerBot: Setting Windows up.... ", 2, 0)
Sleep(350)
WinMove("Pirate King Online 1.32 - 00005","", 1, 106,806,632)
Sleep(500)
WinMove("WPE PRO - game.exe","", 806, 209,768,530)
Sleep ( 500 )
while 1
If PixelGetColor(124,158) = 6709221 Then ;
Check()
Else
Attack()
EndIf
WEnd
$stop = NOT $stop
While $stop
Wend
EndFunc

This is the main function. When the "Home" key is pressed, the bot aligns the two windows and proceed to check the character's HP with th PixelGetColor function. Here, the Check() function is the sitting process, and the Attack() function is the attack process, which I will be going through.

Func Check()
ToolTip("BucaneerBot: HP Check ", 2, 0)
Sleep(Random(500,1000))
Send("{INSERT}")
ToolTip("BucaneerBot: Sitting... ", 2, 0)
While PixelGetColor(182, 158) = 6708965 ;
Sleep(Random(1000,1500))
Wend
Sleep(Random(500,800))
Send("{INSERT}")
Sleep(random(800,1500))
EndFunc

This is the sitting function. The "Insert" button is pressed automatically (Insert is the hotkey for sit ingame). Again, the bot uses PixelGetColor to decide when the character's HP is full.

Func Attack()
ToolTip("BucaneerBot: Attacking... ", 2, 0)
sleep(Random(120,350))
WinActivate ( 'WPE PRO - game.exe' )
$timer1 = TimerStart()
While 1
MouseClick("left", 833,509)
Sleep(400)
MouseClick("left", 965,488)
ToolTip("BucaneerBot: Sending Attack Packets ", 2, 0)
sleep(Random(2000,4000))
if timerdiff($timer1) > $attacktime * 1000 then ExitLoop
sleep(Random(2000,4000))
WEnd
ToolTip("BucaneerBot: Picking up Items ", 2, 0)
WinActivate ( 'Pirate King Online 1.32 - 00005' )
sleep(Random(2000,3000))
Send("{CTRLDOWN}")
Send("a")
Sleep(Random(500,1000))
Send("{CTRLUP}")
sleep(Random(1500,3000))
EndFunc

Firstly, when the Attack() function is triggered, the bot moves the cursor to the "Play" button of the WPE and clicks it, therefore start sending the packets. There are "sleep(Random))" inserted to make the bot pause before attacking. $attacktime is a user-defined interval for the character to pick item (see above). The bot presses Ctrl+A, which is the hotkey for item pick ingame, then proceeds.

Func stop()
Exit
EndFunc

While 1
Sleep(50)
WEnd

Ends the bot when user presses "Home" key.

This bot has worked extremely well for me and the pause in between attacks helps in preventing my character from being detected. Recently, however, I've stopped as GMs have become increasingly active and many people have already been banned.

Further Notes on BucaneerBot:

-I'm currently working on my own Puissance Bot for PKO, and the concept is loosely based on BucaneerBot. I do not want to use WPE, but I have no experience at all in TCP/UDP functions. If anyone could guide me along, please PM me and your help would be greatly appreciated.

-Many people have reported the sitting function faulty. Some can't stand up after sitting, while others cannot even sit in the first place. The problem may be caused by incorrect coordinates, so the best thing to do for those experiencing problems would be to change these 2 lines of code:
Func Check()
ToolTip("BucaneerBot: HP Check ", 2, 0)
Sleep(Random(500,1000))
Send("{INSERT}")
ToolTip("BucaneerBot: Sitting... ", 2, 0)
While PixelGetColor(182, 158) = 6708965 ;
Sleep(Random(1000,1500))
Wend
Sleep(Random(500,800))
Send("{INSERT}")
Sleep(random(800,1500))
EndFunc
Func start()
WinActivate ( 'Pirate King Online 1.32 - 00005' )
ToolTip("BucaneerBot: Setting Windows up.... ", 2, 0)
Sleep(350)
WinMove("Pirate King Online 1.32 - 00005","", 1, 106,806,632)
Sleep(500)
WinMove("WPE PRO - game.exe","", 806, 209,768,530)
Sleep ( 500 )
while 1
If PixelGetColor(124,158) = 6709221 Then ;
Check()
Else
Attack()
EndIf
WEnd
$stop = NOT $stop
While $stop
Wend
EndFunc

Change the highlighted parts using your own information from Windows Info that comes with AutoIt, and it should work.

-Some people have also reported that they are unable to sit because they keep attacking. I just thought up of method to prevent this, but haven't really tried it out:

Func Check()
ToolTip("BucaneerBot: HP Check ", 2, 0)
WinActivate ('WPE PRO - game.exe' )
MouseClick("left", 864,509)
Sleep(Random(500,1000))
Send("{INSERT}")
ToolTip("BucaneerBot: Sitting... ", 2, 0)
While PixelGetColor(182, 158) = 6708965 ;
Sleep(Random(1000,1500))
Wend
Sleep(Random(500,800))
Send("{INSERT}")
Sleep(random(800,1500))
EndFunc

Part 3: Links and Credits
-------------------------------
AutoIt Download (http://www.autoitscript.com)

Credits to:
salter, creator of BucaneerBot

I'm not going to upload BucaneerBot, but you can paste the pieces of script together and compile it yourself.

If anyone has any questions, feel free to post them here or PM me.

Helpful people with knowledge of TCP/UDP, please help =).

danielisk
6th December 2006, 06:27
Nice, but it's already been posted in other forums.And this game is not worth hacking..

xirt
17th April 2007, 22:09
*Revives topic*

I use WPE without scripts, so yeah no sitting, no healing, just attacking and picking up stuff. Good thing I have pure CON characters. ;)