OK to ask for exploit/Scripting help here...

05/12/2018 06:39 phat34#1
I started a thread back in the day like this else where and it went pretty well, so trying again here...

I will start off the convo with this:

Working on an exploit/script etc.. and I get this error because I closed my first gui and I am trying to run another one... Can someone explain why this happened and maybe suggest a work around?

...always eager to learn a thing or two!
05/12/2018 08:49 Walles/TEŽ/In_Zombiac#2
(edit: watch out with multiple client hacks)
Unsure, but most likely not caused by UI. Anyway I'll save you a Saturday, hopefully.

[Quick]
If lower function is almost similar (structure and construction) to that in your API...

Code:
Func ModifyMemory()
	$mASMSize = 0
	$mASMCodeOffset = 0
	$mASMString = ''
	CreateData()
	CreateMain()
	CreateTargetLog()
	CreateSkillLog()
	CreateSkillCancelLog()
	CreateSkillCompleteLog()
	CreateChatRev()
	CreateChatLog()
	CreateTraderHook()
	CreateDialogHook()
	CreateKREISCHRec()
	CreateLoadFinished()
	CreateStringLog()
	CreateStringFilter1()
	CreateStringFilter2()
	CreateRenderingMod()
	CreateCommands()
	$mMemory = MemoryRead(MemoryRead($mBase), 'ptr')
	Switch $mMemory
		Case 0
			$mMemory = DllCall($mKernelHandle, 'ptr', 'VirtualAllocEx', 'handle', $mGWProcHandle, 'ptr', 0, 'ulong_ptr', $mASMSize, 'dword', 0x1000, 'dword', 64)
			$mMemory = $mMemory[0]
			MemoryWrite(MemoryRead($mBase), $mMemory)
			CompleteASMCode()
			WriteBinary($mASMString, $mMemory + $mASMCodeOffset)
			WriteBinary('83F8009090', GetValue('ClickToMoveFix'))
			MemoryWrite(GetValue('QueuePtr'), GetValue('QueueBase'))
			MemoryWrite(GetValue('SkillLogPtr'), GetValue('SkillLogBase'))
			MemoryWrite(GetValue('ChatRevAdr'), GetValue('ChatRevBase'))
			MemoryWrite(GetValue('ChatLogPtr'), GetValue('ChatLogBase'))
			MemoryWrite(GetValue('StringLogPtr'), GetValue('StringLogBase'))
		Case Else
			CompleteASMCode()
	EndSwitch
	WriteDetour('MainStart', 'MainProc')
	WriteDetour('TargetLogStart', 'TargetLogProc')
	WriteDetour('TraderHookStart', 'TraderHookProc')
	WriteDetour('DialogStart', 'DialogHookProc')
	WriteDetour('DialogRec', 'DialogRecProc')
	WriteDetour('LoadFinishedStart', 'LoadFinishedProc')
	WriteDetour('RenderingMod', 'RenderingModProc')
	WriteDetour('StringLogStart', 'StringLogProc')
	WriteDetour('StringFilter1Start', 'StringFilter1Proc')
	WriteDetour('StringFilter2Start', 'StringFilter2Proc')
EndFunc

[Dirty]
Continue changing...

Code:
Func GetLabelInfo($aLab)
	Local Const $lVal = GetValue($aLab)
	If $lVal <> -1 Then Return $lVal
	Exit MsgBox(0x10, 'Error', 'Label "' & $aLab & '" tries faq.')
EndFunc
to...

Code:
Func GetLabelInfo($aLab)
	Local Const $lVal = GetValue($aLab)
	Return $lVal
EndFunc
... for now.

CHEERS
05/12/2018 20:19 phat34#3
Great... so we are actually crashing into a open thread by doing this...?

What would be the clean way>??

and what are the repercussions of doing it the quick/easy way since my main goal is stability?
05/13/2018 22:18 DerMoench14#4
[Only registered and activated users can see links. Click Here To Register...]
05/13/2018 23:22 phat34#5
Going to read that thread... thanks DerMoench14... and thanks for the original quick method, but I have had not desired results so far with the quick-dirty fix, such as: Smart Cast getting knock out on a bot restart and secondary included auto-it files no longer working.
05/14/2018 18:37 MrBigBones#6
Walles, why don't you say nothing instead of giving the single worst "solution" ?
If it tell you that there is an error, it's not by removing the message box that the error will be fix.
05/15/2018 00:09 4D1#7
its walles tho
05/15/2018 01:36 phat34#8
ok... issue # 2

I have a party spread out in the underworld that all die in different parts of a map...or maps (sub zone wise only). I find the GetPartyDead() via Getisdead($mAgentID) becomes in-effective - - as a remedy I have tried many solutions, but to no avail... Only know , improper solution is timer after so many iterations of the getpartydead() loop.
Have tried accessing agent directly doing geteffect() method as well as %hp * maxhp method as well... both without any merit.
05/15/2018 16:15 zoidberg1337#9
Hey sushitech, I can't help but i have the same problem with a bot I have, the moveto func doesn't even work properly in disabled rendering mode.
It just stops on half way or it doesn't walk to the spot it should.
I add the file, maybe it is the same problem with your bot.

E: I know that it isn't updated :)
05/17/2018 04:18 phat34#10
Sushitech and zoidberg ---- try implementing this fix... It made my bot work more like a bot, and cleaned up the ("getting lost") and ("non responsive") issues quite a bit... it also fixed rendering...

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

well, for issue #2, I have a partial fix with the returntooutpost() function but still not 100% ideal...

I would like to keep track of my party which distance is far from me better if possible... perhaps the memory location where the red health bars are read from.

Issue #3 --- After a successful or failed run and back at the outpost... with my Initialize(ProcessExists("gw.exe"), True, True, True) = False command towards the beginning of my script... therefore making string logs and the event system accessible. So on my first run, my bot has no problem finding the merchant and xunial chance. However, on future iterations, the script can not find the merchant or xunial...? What gives... any hints would be appreciated.?
05/18/2018 19:52 phat34#11
Actually using event system to locate them and go to them (sorta like holding down alternate and matching the text "Merchant"), then using dllstruct get data to get x.y then move to them.... some of the prior issues were caused by the headers being changed...so after checking my bots today I will update here if there are still things causing me trouble.

Seems like the header change hit me gradually as it ran up to the full change of headers... most likely because I was running the un-updated .exe file... which was somewhat affected by some server side changes but not 100% on how it works.
05/19/2018 03:16 I mystogan I#12
meh update messed up the ferry bot i was given.
06/15/2018 04:43 phat34#13
* bump *
06/15/2018 15:19 DerMoench14#14
Quote:
Originally Posted by phat34 View Post
ok... issue # 2

I have a party spread out in the underworld that all die in different parts of a map...or maps (sub zone wise only). I find the GetPartyDead() via Getisdead($mAgentID) becomes in-effective - - as a remedy I have tried many solutions, but to no avail... Only know , improper solution is timer after so many iterations of the getpartydead() loop.
Have tried accessing agent directly doing geteffect() method as well as %hp * maxhp method as well... both without any merit.
Why don't you do it with the MapAgentStruct?
Code:
Func GetIsDeadEx($aAgentID)
	Local $lMapAgentPtr = GetMapAgentPtr($aAgentID)
	Return MemoryRead($lMapAgentPtr + 48, 'long') = 0x10 ? True : False
EndFunc

Func GetMapAgentPtr($aAgentID)
	Local $lOffset[5] = [0, 0x18, 0x2C, 0x7C, 0x34 * $aAgentID]
	Local $lMapAgentPtr = MemoryReadPtr($mBasePointer, $lOffset, 'ptr')
	Return $lMapAgentPtr[0]
EndFunc
06/15/2018 19:54 phat34#15
Quote:
Originally Posted by DerMoench14 View Post
Why don't you do it with the MapAgentStruct?
Code:
Func GetIsDeadEx($aAgentID)
	Local $lMapAgentPtr = GetMapAgentPtr($aAgentID)
	Return MemoryRead($lMapAgentPtr + 48, 'long') = 0x10 ? True : False
EndFunc

Func GetMapAgentPtr($aAgentID)
	Local $lOffset[5] = [0, 0x18, 0x2C, 0x7C, 0x34 * $aAgentID]
	Local $lMapAgentPtr = MemoryReadPtr($mBasePointer, $lOffset, 'ptr')
	Return $lMapAgentPtr[0]
EndFunc
nah that's not working at all for me...returning false no matter what?

Code:
[13:31] Going for a Hero Rez!
[13:31] HP: 0.00
[13:31] MaxHP: 0
[13:31] 62 False 0 1
[13:31] **2 False*EX
[13:32] HP: 1.00
[13:32] MaxHP: 500
[13:32] 63 False 0 1
[13:32] **3 False*EX
[13:32] HP: 0.31
[13:32] MaxHP: 480
[13:32] 64 False 0 1
[13:32] **4 False*EX
[13:32] HP: 0.00
[13:32] MaxHP: 0
[13:32] 65 False 0 1
[13:32] **5 False*EX
[13:32] HP: 0.50
[13:32] MaxHP: 550
[13:32] 66 False 0 1
[13:32] **6 False*EX
[13:32] HP: 0.00
[13:32] MaxHP: 0
[13:32] 67 False 0 1
[13:32] **7 False*EX
[13:32] HP: 0.00
[13:32] MaxHP: 0
[13:32] 68 False 0 1
[13:32] **8 False*EX
Code:
; Test if more than 6 heros are dead
Func _CheckPartyDead()
	If Not GetIsDead(-2) Then Return False
	If GetMapID() <> $uwMapID Or GetMapLoading() = 2 Then
		Out("Not In UnderWorld?")
		Sleep(6000)
		$PartyDead = False
		Boucles()
	EndIf
	Local $lDeadParty = 0
	Local $GHC = GetHeroCount()
		$GlbGetAry +=1
	For $i = 2 To $GHC+1
		Local $iPlayer = GETAGENTBYID(GetHeroID($i))
		TARGETPARTYMEMBER($i)
		sleep(750)
		If Getisdead($iPlayer) Then
			$lDeadParty += 1
		EndIf
		Out(StringFormat("HP: %3.2f", DllStructGetData($iPlayer, 'HP')))
		Out("MaxHP: " & DllStructGetData($iPlayer, 'MaxHP'))
		Out($GHC-1 & $i & " " & Getisdead($iPlayer) & " " & $lDeadParty & " " & $GlbGetAry)
		Out("**" & $i & " " & Getisdeadex($iPlayer) & "*EX")
	Next
	If $lDeadParty > ($GHC-2) or $GlbGetAry > 12 Then
		ReturnToOutpost()
		Sleep(3000)
		If GetMapLoading() <> 1 or $PartyDead Then
			$PartyDead = True
			Out("Hero's are all dead bro,")
			Out("let's start again !")
			Return True
		EndIf
	EndIf
	$PartyDead = False
EndFunc   ;==>_CheckPartyDead