[RELEASE] Jawq (WQ bot for PWI)

07/27/2014 15:50 Smurfin#181
It's written in autoit, you can just download autoit, copy paste it, and voila, you'll get your SendPacket Call Address and Base Addres shown in output window.


...
I just did a full run of Auto WQ-ing from start to finish, and it took about 2 hours give or take to complete, not bad if we have nothing else to do in the game but if someone can come up with a script to use teleportation by packet, that would be AWESOME. Only need to go to nearest teleport then go to the area closest to the next npc for handing in quest, have to also have the teleporter routes as well though, unless using boutique item Teleport Bell.

But still, I'm grateful for this, thanks again, Shareen. :handsdown:
07/27/2014 17:22 linger8484#182
ok.. I'll give a try.. thanks :)

Edited:
[Only registered and activated users can see links. Click Here To Register...]

is this autoit software u refer to?

Below is the summary i got from the software autoit

>>>> Window <<<<
Title: Perfect World
Class: ElementClient Window
Position: 53, 0
Size: 1253, 705
Style: 0x94CE0000
ExStyle: 0x00000100
Handle: 0x00030262

>>>> Control <<<<
Class:
Instance:
ClassnameNN:
Name:
Advanced (Class):
ID:
Text:
Position:
Size:
ControlClick Coords:
Style:
ExStyle:
Handle:

>>>> Mouse <<<<
Position: 620, 341
Cursor ID: 0
Color: 0x9C613C

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<


>>>> Hidden Text <<<<
07/27/2014 17:35 Shareen#183
Quote:
Originally Posted by Smurfin View Post
... if someone can come up with a script to use teleportation by packet, that would be AWESOME. Only need to go to nearest teleport then go to the area closest to the next npc for handing in quest, have to also have the teleporter routes as well though, unless using boutique item Teleport Bell.
I never included teleportation into it, since it costs ingame money to use.
Did that change or do you prefer using ingame money rather then time?
07/27/2014 18:59 Smurfin#184
i prefer using ingame money rather than time for wq-ing my main chars, because in reincarnation update there are a lot of dailies to do, so more playtime would be great because sometimes i'm not really afk when i do wq.

sure auto wq is supposed to be run when afk, but if using teleportation it'd only take 15-20 minutes, kinda no need to be afk for that and could even be fun to watch if we're not really afk at the time we want to do wq :D
07/28/2014 08:15 linger8484#185
=.= All the possible numbers/figures i got from the autoit from the below still cant fix my problem. Oh well, i cant do much here if there's not any definite answer. Thanks.

>>>> Window <<<<
Title: Perfect World
Class: ElementClient Window
Position: 53, 0
Size: 1253, 705
Style: 0x94CE0000
ExStyle: 0x00000100
Handle: 0x00030262

>>>> Control <<<<
Class:
Instance:
ClassnameNN:
Name:
Advanced (Class):
ID:
Text:
Position:
Size:
ControlClick Coords:
Style:
ExStyle:
Handle:

>>>> Mouse <<<<
Position: 620, 341
Cursor ID: 0
Color: 0x9C613C

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<


>>>> Hidden Text <<<<
07/28/2014 08:57 Smurfin#186
You have to run the script in autoit editor (SciTE Script Editor) , then copy paste the script I posted above, not using AutoIT Window Info >_<

[Only registered and activated users can see links. Click Here To Register...]
07/29/2014 07:24 edmundtyy#187
hi all, been away a couple of days. anyway i manage to get the numbers based on smufy's post. now the only problem i need to figure out is why it crashes when i start the wq. still getting the error:13 and client crash

[29.07.2014 13:36:43] > Start of wq mission available, starting new mission
[29.07.2014 13:36:43] > Executing action land:
[29.07.2014 13:36:43] > Flying was overriden and there is no need to land. Ignoring this action
[29.07.2014 13:36:43] > Current wq item id: 14067
[29.07.2014 13:36:43] > Current action index: 2

-------------------------------------------------------------------------------------
[29.07.2014 13:36:43] > Start of wq mission available, starting new mission
[29.07.2014 13:36:43] > Executing action interact: Locking target Li Mengpai
[29.07.2014 13:36:47] > Critical error occured, instance stopped and unhooked
[29.07.2014 13:36:47] > action code: 0
[29.07.2014 13:36:47] > error code: 13
[29.07.2014 13:36:48] > Remove button was clicked, player instance removed
07/29/2014 07:41 linger8484#188
>"H:\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "D:\GarenaPerfectWorldEN\GameData\Apps\PWEN\elemen t\smurf.au3"
$base = 0xC9DFAC
$call = 0x415CEEEC20000000
>Exit code: 0 Time: 1.245

hmm.. it's not working.. It's even worst. the element client crashed after i click start from the bots.

Still error: 13



------------------------------ Object created: TPlayer ------------------------------

[29.07.2014 13:59:27] > Ready to start!

[29.07.2014 13:59:29] > Start button was clicked, instance started
[29.07.2014 13:59:29] > Current wq item id: 14067
[29.07.2014 13:59:29] > Current action index: 0

-------------------------------------------------------------------------------------
[29.07.2014 13:59:35] > Start of wq mission available, starting new mission
[29.07.2014 13:59:35] > Executing action interact: Locking target Li Mengpai
[29.07.2014 13:59:36] > Critical error occured, instance stopped and unhooked
[29.07.2014 13:59:36] > action code: 299
[29.07.2014 13:59:36] > error code: 13
[29.07.2014 14:04:21] > Remove button was clicked, player instance removed


------------------------------ Object created: TPlayer ------------------------------

[29.07.2014 14:04:22] > Ready to start!

[29.07.2014 14:04:23] > Start button was clicked, instance started
[29.07.2014 14:04:23] > Current wq item id: 14067
[29.07.2014 14:04:23] > Current action index: 0

-------------------------------------------------------------------------------------
[29.07.2014 14:04:24] > Start of wq mission available, starting new mission
[29.07.2014 14:04:24] > Executing action interact: Locking target Li Mengpai
[29.07.2014 14:04:25] > Critical error occured, instance stopped and unhooked
[29.07.2014 14:04:25] > action code: 299
[29.07.2014 14:04:25] > error code: 13
[29.07.2014 14:04:30] > Remove button was clicked, player instance removed


------------------------------ Object created: TPlayer ------------------------------

[29.07.2014 14:06:12] > Ready to start!

[29.07.2014 14:06:13] > Start button was clicked, instance started
[29.07.2014 14:06:13] > Current wq item id: 14066
[29.07.2014 14:06:13] > Current action index: 0
[29.07.2014 14:06:13] > Distance to npc Tu Heng is 42, which is too close (<50) to use flyTo, overriding and walking there
[29.07.2014 14:06:13] > Executing action walkTo: Walking towards Tu Heng
[29.07.2014 14:06:21] > Current wq item id: 14066
[29.07.2014 14:06:21] > Current action index: 1
[29.07.2014 14:06:21] > Executing action walkTo: Walking towards Tu Heng
[29.07.2014 14:06:30] > Current wq item id: 14066
[29.07.2014 14:06:30] > Current action index: 2
[29.07.2014 14:06:30] > Executing action interact: Locking target Tu Heng
[29.07.2014 14:06:30] > Target locked: Tu Heng
[29.07.2014 14:06:30] > Talking to Tu Heng
[29.07.2014 14:06:34] > Critical error occured, instance stopped and unhooked
[29.07.2014 14:06:34] > action code: 299
[29.07.2014 14:06:34] > error code: 13
[29.07.2014 14:06:37] > Remove button was clicked, player instance removed
07/29/2014 09:25 Smurfin#189
Linger8484 and edmuntyy, you both play on PW MY, but edmuntyy managed to get the numbers from what I posted ( I assume edmuntyy meant $base and $call ? , cmiiw ) , weird , same pw version , same script, but different result.

@linger8484 : You should dig in Interes07's thread, the sendpacket stuff, if I recall correctly there is a guide to find sendpacketcall manually using IDA Pro. I tried it but it gave me a headache and then lolkop posted that script for findsendpacketcall.

@edmuntyy : If the findsendpacketcall script I posted could give you the same numbers as mine, I wonder why you still had the same error msg as linger8484 was having. :confused: , the sendpacket call address then should be right.

From what binz and Shareen had observed, Jawq recognized your name and level, so charstruct should be right. Your character could move toward NPC, so the action offset should be right as well, but it crashed WHEN exchanging information with the npc, where sendpacketcall was used for handing in quest, from what I gathered from there, it could be the sendpacketcall was wrong or maybe the npc struct ?

You should try simple stuff using sendpacket from Interest07's thread like targetting your own character's ID using SelectMob or others.

Or you could check the player/npc struct using this AutoIT script, it will list all NPCs/Players around you (HP/MP/LV won't be shown in your computer memory until you click that character) , so you'll know which from the offset list you use is wrong, npc/player, or sendpacketcall.

Here is the script, be sure to change this line Global $pid=wingetprocess("Perfect World") to the wintitle of your running game client :
Code:
#include <array.au3>
#include <ListViewConstants.au3>
#include <GuiListView.au3>
Global $kernel32 = DllOpen('kernel32.dll')
Global Const $base = 0x00C9DFAC, $select_call = 0x00681F50, $pick_call = 0x00681EE0
Global $class_info[10] = ['Blademaster', 'Wizzard', 'Psychic', 'Venomancer', 'Barbarian', 'Assassin', 'Archer', 'Cleric', 'Seeker', 'Mystic']
Global $special_info[10] = ['None', 'Increased Movement', 'Unknown Special', 'Increased Defence', 'Increased Mag Resistance', 'Increased Attack', 'Increased Magical Attack', 'Sacrificial Assault', 'Increased Life', 'Weak']
Global $pid=wingetprocess("Perfect World")
Global $mid = memopen($pid)

$npcs = GetNpcList()
_ArrayDisplay($npcs)

$players = GetplayerList()
_ArrayDisplay($players)


memclose($mid)
DllClose($kernel32)

Func GetNpcList()
	Local $array[1][7], $pointer, $npc_base, $counter
	$pointer = memread(memread(memread(memread(memread($base) + 0x1C) + 0x1c) + 0x20) + 0x58)
	$npccount = memread(memread(memread(memread(memread($base) + 0x1C) + 0x1c) + 0x20) +0x14)
	For $x=0 To ($npcCount - 1)
		$npc_base = memread($pointer + $x*0x4)
		If $npc_base<>0 Then
			ReDim $array[$counter+1][7]
			$array[$counter][0] = hex(memread($npc_base + 0x120)) ;NPC Unique ID
			$array[$counter][1] = memread(memread($npc_base + 0x278), 'wchar[30]') ;NPC Name
			$array[$counter][2] = memread($npc_base + 0x128) ;NPC Level
			$array[$counter][3] = (memread($npc_base + 0x3C, 'float')+4000)/10 ;NPC x-position
			$array[$counter][4] = (memread($npc_base + 0x44, 'float')+5500)/10 ;NPC y-position
			$array[$counter][5] = memread($npc_base + 0x40, 'float')/10 ;NPC z-position
			$array[$counter][6] = (memread($npc_base + 0x124)) ;NPC ID/Serial Number
			$counter += 1
		EndIf
	Next
	Return $array
EndFunc



Func GetPlayerList()
	Local $array[1][8], $pointer, $player_base, $counter
	$pointer = memread(memread(memread(memread(memread($base) + 0x1C) + 0x1c) + 0x1c) + 0x94)
    $playerCount = memread(memread(memread(memread(memread($base) + 0x1C) + 0x1c) + 0x1c) + 0x14)  
	For $x=0 To ($playerCount - 1)
		$player_base = memread($pointer + $x*0x4)
		If  $player_base<>0	Then
			ReDim $array[$counter+1][8]
			$array[$counter][0] = memread(memread($player_base + 0x6b0), 'wchar[30]') ;Name
			$array[$counter][1] = (memread($player_base + 0x3C, 'float')+4000)/10 ;x
			$array[$counter][2] = (memread($player_base + 0x44, 'float')+5500)/10 ;y
			$array[$counter][3] = memread($player_base + 0x40, 'float')/10 ;z
			$array[$counter][4] = hex(memread($player_base + 1172)) ;id
			$array[$counter][5] = (memread($player_base +1192)) ;hp
			$array[$counter][6] = (memread($player_base + 1196)) ;mp
			$array[$counter][7] = (memread($player_base + 0x4A0)) ;lvl
			$counter += 1
		EndIf
	Next
	Return $array
EndFunc


Func memopen($pid)
	Local $mid = DllCall($kernel32, 'int', 'OpenProcess', 'int', 0x1F0FFF, 'int', 1, 'int', $pid)
	Return $mid[0]
EndFunc

Func memread($adress, $type = 'dword')
	Local $struct = DllStructCreate($type)
	DllCall($kernel32, 'int', 'ReadProcessMemory', 'int', $mid, 'int', $adress, 'ptr', DllStructGetPtr($struct), 'int', DllStructGetSize($struct), 'int', '')
	Return DllStructGetData($struct, 1)
EndFunc

Func memclose($mid)
	DllCall($kernel32, 'int', 'CloseHandle', 'int', $mid)
EndFunc
It should look like this below, the highlighted one is Li MengPai NPC (or called Antonio here) , notice the NPC ID / Serial Number is correct as in pwdatabase.com [Only registered and activated users can see links. Click Here To Register...] which is 14090, so offset for NPC ID is right.

[Only registered and activated users can see links. Click Here To Register...]
07/29/2014 10:12 titieson77#190
link broke
07/29/2014 11:39 edmundtyy#191
thanks smurfy. the base and call figures i have is the same as linger8484. i suspect the npcs might be different thus the bot unable to detect the right npc. i will check it out and see if its the same.
07/29/2014 13:00 Smurfin#192
If that's the case, then I'm quite sure the error is in the sendpacket call address.


There are 3 interactions to npc regarding quest I usually use from Interest07's sendpacket functions, open dialog, then you either hand in quest, or taking quest from npc.

I believe Shareen also uses sendpacket for opening dialogue window with NPC. So before it crashed on yours, did you ever notice npc dialogue window opened or not ? If not then chances are 100% the error is in the sendpacket call address.

You could try this :
Quote:
Originally Posted by Interest07 View Post
If you need to find the address for the sendPacket function you can use the offset retriever included in this [Only registered and activated users can see links. Click Here To Register...]
I personally never do WQ before Reincarnation, so I never tried Interest07's wQ bot, but since it's discontinued and WQ now has 37 routes and jawq is the only wq bot I found around with 37 routes, then here I am. That's the least I could find, can't really help much with hunting addresses and offsets unless the commonly used ones and the ones I usually use :p. I hope the sendpacket offset retriever included is still working.

Good Luck !
07/29/2014 16:10 linger8484#193
i've check interest07's thread before i raised the issue i had :)

none of the offset given in that thread is working.

And the findWQbotoffset seem no more working.
08/02/2014 08:43 edmundtyy#194
thanks smurfy, i will look into it when i have free time next week. the chat window nvr opens. the client just crash upon recognizing the npc to go too.
08/20/2014 14:44 martmor#195
PWI have now new offsets

PlayerLevel=0x4B0
PlayerName=0x6C0