WQ bot for PWI

03/22/2013 08:16 martmor#391
Already done. Please ignore. I just keep it for others that are interested

Quote:
Originally Posted by Interest07 View Post
[Only registered and activated users can see links. Click Here To Register...]

4)

FlyGear: 0x069144B0
TransportMode: 0x06914568

We know the offset for transportmode is 0x608, so to get the offset for FlyGear we simply to the following calculation:

offset = FlyGearAddress - TransportModeAddress + 0x608 =
0x069144B0 - 0x06914568 + 0x608 = 0x550

Thank you very much for the much useful descriptions.

I searched now some hours :p and have a question to your calculation. How do you calculate:

I have now
0x1E8D7F90 (Flygear) - 0x1E8D7590 (transportmethod) + 0x688 (transportmethod offset)
If I enter this into the calculator programmer mode I come to 1088 but this seems to much different from the old offset 0x598.... :rolleyes: And I don't know how to calculate this

For all interested: Li Mengpai ID is 2148550618

Update: It is correct. I converted your too. and this way I come this way to the same amount as you. So thank you very much and it seems to be correct xD
03/22/2013 12:38 Mc_D#392
still crashing ...any new update..
03/23/2013 11:56 martmor#393
Quote:
still crashing ...any new update..
The CE Offsets are no problem as Interest07 wrote it here.

The problem is the IDA. I don't know why, but I do not find the thinks with IDA that Interest07 wrote. Maybe you can find them?
03/23/2013 14:31 AlainProvist#394
I gave a fast look into the code to get the part that makes pw crash but I'm completly lost with what happens. From what I get into the logs, pw crashes after we read the position of the player with getMoveMethod(). The coords given by the function seem correct but for some unknown reason pw crashes just after before the app reaches the next iteration of the main loop (for example trying to fly to the npc)...

I hate this language and more likely I hate the fact that I can't debug properly with breakpoints. So I won't loose a single minute on this again (last time made me really sick believe me TT). Good luck to the one that will try to fix the code. It could have been different if it was written in C or C++ but this crap language is totally brain drain when someone else than the original coder tries to understand the behavior of the code. Sorry guys :( ...
03/23/2013 14:39 Sᴡoosh#395
Another autoit hater? Finally :D Autoit seems to be something like a religion on these forums. I think Interest even told people to go C# over autoit a while back... or was that dumbfck?

Anyhow, a memoryread isn't going to crash anything - injections cause crashes. Everything that uses createremotethread in this case. I'd guess isQuestAvaliable injection.
03/23/2013 14:51 AlainProvist#396
OMG did'nt watched this part of the code x_x was supposing checkQuestPresent() call was just reading memory, not injecting anything... I was supposing the function was searching for a wq quest into the available quests list. Any offset wrong in the injection methode or the whole methode to get the quest has changed ?

from my ini:
questFunctionOffset=0x1130
questFunctionAddress=0x00778160

code injection:
func =
func = %func%60 ;PUSHAD
func = %func%B8%revQuestFunctionAddress% ;MOV EAX, questFunction
func = %func%8B0D%revBaseAddress% ;MOV ECX, DWORD PTR [baseAddress]
func = %func%8B491C ;MOV ECX, DWORD PTR [ECX+1C]
func = %func%8B49%revPlayerOffSet% ;MOV ECX, DWORD PTR [ECX+playerOffSet]
func = %func%8B89%revQuestFunctionOffset% ;MOV ECX, DWORD PTR [ECX+questFuncOffset]
func = %func%68%revQuestId% ;PUSH questId
func = %func%FFD0 ;CALL NEAR EAX
func = %func%A3%revReturnAddress% ;MOV DWORD PTR [returnAddress], EAX
func = %func%61 ;POPAD
func = %func%C3 ;RET
03/23/2013 15:36 Sᴡoosh#397
No clue, I don't use this injection. I'd guess address changed though.
03/23/2013 16:48 Interest07#398
Quote:
Originally Posted by Sᴡoosh View Post
Another autoit hater? Finally :D Autoit seems to be something like a religion on these forums. I think Interest even told people to go C# over autoit a while back... or was that dumbfck?

Anyhow, a memoryread isn't going to crash anything - injections cause crashes. Everything that uses createremotethread in this case. I'd guess isQuestAvaliable injection.
I'm very much in favour of C# over this horrible language ;)

C++ is also a lot better although I tend to get pissed off with cyclic header inclusions.
03/23/2013 16:56 AlainProvist#399
I hate all languages that have non defined types and more likely non declared variables. Ahk has both + non case sensitive variable names. So when taking a code from someone else you have to guess what variable is already declared at a given step of the programm and what is still non declared and assigned. Simply for this you get a brain implosion after 30min of code reading...

About the original topic, I should have a fix for the soft in about 30min... I've replaced the code injection to get the quest id by my code that simply read the quest items and convert them to quest ids and then to npc ids (I was already using it in the previous version but only for the new npcs (31 to 36).


edit :
Damned inventory offsets seem to have changed :

local baseAddress := ReadMemory(realBaseAddress, theId)
local structurePointer := ReadMemory(baseAddress + baseOffset, theId) ;+0x1C
local playerPointer := ReadMemory(structurePointer + playerOffset, theId) ;+0x34
local inventoryPointer := ReadMemory(playerPointer + 0xD8C, theId) ;+0xD8C
local inventoryBase := ReadMemory(inventoryPointer + 0xC, theId) ;+0xC
local itemSlot := ReadMemory(inventoryBase + (slotIndex*4), theId)

playerPointer seems to be ok since player's position read through this pointer is correct. But hard coded offsets used here seem to be wrong. I'll expose them in the ini file later but I need the new offsets for now. Can anyone find them for me (I'm a noob in using CE :p) ?
03/23/2013 19:28 Interest07#400
I'm very sorry what I'm putting you guys through. Would you prefer an excel sheet with a WQ bot in VBA code? I do still have that version around as well ;)
03/23/2013 20:05 AlainProvist#401
lol sry if I hurt you with my last comments about the code cause it was not my intention :(. You did a great job by writing this bot and I wouldn't be capable to do the same prom scratch sincerely. What I told was about the language ahk and all those look alike.

About the fix, I'm still stuck at the inventory offset and probably the others under. I tried to find the offsets from the end by taking the quest object id of my own character at slot X and searching with CE this id in the memory. Found a lot of adresses that I offseted of -8 to try to get the address of the item slot. But I didn't found any valid slot...

edit : Nevermind finaly found the inventory base address :p
03/23/2013 20:43 Sᴡoosh#402
Interest, do post that excel bot, just for shits and giggles :D When you told me about this back then I already found that to be a very funny idea :D
03/23/2013 21:30 AlainProvist#403
Finally found the offset and fixed this bot :awesome:
Enjoy !

(If someone could have told me that I would have lost another day for fixing this while I don't even play this game anymore I would have say bullshit. Seems my heart of programmer overtook my mind :D)

edit : removed dl link cause of a new version
03/23/2013 22:02 AlainProvist#404
Forgot to expose the 2 offsets in the ini... Here the version with exposed offsets.


edit : New fixed version 3.2.2 : fix the last volume depending the quest item and your level
03/24/2013 10:00 Interest07#405
Quote:
Originally Posted by AlainProvist View Post
lol sry if I hurt you with my last comments about the code cause it was not my intention :(. You did a great job by writing this bot and I wouldn't be capable to do the same prom scratch sincerely. What I told was about the language ahk and all those look alike.

About the fix, I'm still stuck at the inventory offset and probably the others under. I tried to find the offsets from the end by taking the quest object id of my own character at slot X and searching with CE this id in the memory. Found a lot of adresses that I offseted of -8 to try to get the address of the item slot. But I didn't found any valid slot...

edit : Nevermind finaly found the inventory base address :p
Nono, you're not hurting me with my comments. I completely agree that ahk is a horrible language and I think I admitted in the second post in this thread that the code was a mess. I'm actually quite amazed that people are fixing it still and admire the effort being put in.

I did find an old version of my excel bot, here's a screeny :p

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

I'm already ashamed of the other code I've been posting in this thread so I'm not gonna actually post all of this horrible mess, sadly it would be too much of an effort to make it work again as I'd actually have to download pwi patches n stuff :P

VBA is really an interesting language, as you can randomly choose to declare some variables and others you don't, it's case insensitive, but it does convert all variables of a certain name into the same case as they were declared the first time, even if they're in a completely different scope (and unrelated). Instead of returning a value from a function you actually set the function name equal to your return value. You call functions with brackets and methods without brackets to get that awesome consistency.

You do have a debugger though, which do in theory exist for ahk as well, so I'm not sure yet which is a 'better' (I should say less horrible) language to do anything non trivial in. I've attempted to write some OCR type program in ahk before, doing the heavy lifting in a c++ dll, but slowly all my code migrated into the dll because it was just easier that way. Ended up with some basic code for calling the dll and that was about it in the ahk file :p

I just have a soft spot for ahk because I wrote my first useful program in it (a ragnarok bot) and VBA is also special because for some reason non software companies LOVE excel tools, even things that really shouldn't be in excel.

Also my 'memory reader' in excel: (setting a variable type to pointer would automatically open up a new tab reading the memory that pointer points to)
[Only registered and activated users can see links. Click Here To Register...]


sorry for hijacking my thread, just know a certain person loves fail ideas/code in programs :D