[GWA2] Killroy bot rework

05/05/2018 15:23 purownage#1
Hello guys,

I'm pretty new to bot coding in GWA2 and I would request your help for a project about last killroy bot. I wanna made this bot to only pickup golds item and id them and to open chest if lockpick is found in inventory! I'll post my current rework I have no credit for this at all only want to push this bot to a new horizon! :) tyvm guys!

PS: If someone know lockpicks item Id's it would be awsome! :)
05/05/2018 16:20 rheek#2
Quote:
Originally Posted by purownage View Post
Hello guys,

PS: If someone know lockpicks item Id's it would be awsome! :)
I attached a file that contains most item ids.
05/05/2018 16:32 Jamamon#3
Edit: nvm
05/06/2018 01:53 purownage#4
thanks alot Rheek for supporting me i'll post what i've done tomorrow!
05/10/2018 19:18 phat34#5
...as you see its easier said then done...

---> c'mon bro and step up to my level!!!

The reward outweighs the effort... I know Newton was wrong!
05/11/2018 01:10 purownage#6
no time atm due to work im in busness but ill take some time too add chest function + added consumable festival item ill be back soon
05/12/2018 04:44 ayyy_lmao#7
This was public one if you want to work from it
05/12/2018 07:07 savsuds#8
Quote:
Originally Posted by ayyy_lmao View Post
This was public one if you want to work from it
I removed most of what the OP is seeking out of that bot long ago.

Also, I am glad to see my GlobalItems list is still getting around.
05/12/2018 15:52 ayyy_lmao#9
Code:
Func Cheest()
;	Out("IS THERE A CHEST???")
	Local $ChestSpawn = 0
;	If GetIsDead(-2) Then Mainloop()

	rndsleep(250)

	For $i = 0 To 4
;	If GetIsDead(-2) Then Mainloop()
		TargetNextItem()
		Sleep(50)
		$Target = GetCurrentTarget()
		Sleep(50)
		$Name = GetIsStatic($Target)
		Sleep(50)
;~ 		If GetIsDead(-2) = True Then Mainloop(
		If $Name = True Then
			$ChestSpawn = $ChestSpawn + 1
		;	Out("YEAH!!! THERE IS!")

			$ChestX = DllStructGetData($Target, 'X')
			$ChestY = DllStructGetData($Target, 'Y')

		;	Out("BADABOUM!! OPENING")
		;	Global $oStats_Lockpicks = DllStructGetData(GetItemByModelID(22751), 'Quantity')
			GoSignpost($Target);go to chest
			OpenChest();open chest

		;	Sleep(350)
		;	GUICtrlSetData($lblchests, GUICtrlRead($lblchests) + 1)

		;	$nStats_Lockpicks = DllStructGetData(GetItemByModelID(22751), 'Quantity')


		;	If $nStats_Lockpicks = $oStats_Lockpicks Then
		;		Out("Lockpick Not broken!!")
		;		GUICtrlSetData($lblretained, GUICtrlRead($lblretained) + 1)
		;	EndIf

		;	If $nStats_Lockpicks <> $oStats_Lockpicks Then
		;		Out("Argh! Broken..")
		;		GUICtrlSetData($lblbroken, GUICtrlRead($lblbroken) + 1)
		;	EndIf

		;	$nStats_LuckyPoints = GetLuckyTitle() - $oStats_LuckyPoints
		;	GUICtrlSetData($lbllucky, $nStats_LuckyPoints)
		;	$nStats_UnLuckyPoints = GetUnLuckyTitle() - $oStats_UnLuckyPoints
		;	GUICtrlSetData($lblunlucky, $nStats_UnLuckyPoints)

		EndIf
	Next
;add drop handling here or let drop handing of fight func pick it up
	If $ChestSpawn > 0 Then
		;Out("Is it gold?")
		DropHandling()
	Else
		GUICtrlSetData($lblnochest, GUICtrlRead($lblnochest) + 1)
		;Out("Oh, no chest!")
	EndIf
EndFunc   ;==>Cheest
this from pongmei think I used this back in the day to add chest opening to mqsc bot should help?
05/12/2018 17:13 Underavelvetmoon#10
Quote:
Originally Posted by ayyy_lmao View Post
Code:
Func Cheest()
;	Out("IS THERE A CHEST???")
	Local $ChestSpawn = 0
;	If GetIsDead(-2) Then Mainloop()

	rndsleep(250)

	For $i = 0 To 4
;	If GetIsDead(-2) Then Mainloop()
		TargetNextItem()
		Sleep(50)
		$Target = GetCurrentTarget()
		Sleep(50)
		$Name = GetIsStatic($Target)
		Sleep(50)
;~ 		If GetIsDead(-2) = True Then Mainloop(
		If $Name = True Then
			$ChestSpawn = $ChestSpawn + 1
		;	Out("YEAH!!! THERE IS!")

			$ChestX = DllStructGetData($Target, 'X')
			$ChestY = DllStructGetData($Target, 'Y')

		;	Out("BADABOUM!! OPENING")
		;	Global $oStats_Lockpicks = DllStructGetData(GetItemByModelID(22751), 'Quantity')
			GoSignpost($Target);go to chest
			OpenChest();open chest

		;	Sleep(350)
		;	GUICtrlSetData($lblchests, GUICtrlRead($lblchests) + 1)

		;	$nStats_Lockpicks = DllStructGetData(GetItemByModelID(22751), 'Quantity')


		;	If $nStats_Lockpicks = $oStats_Lockpicks Then
		;		Out("Lockpick Not broken!!")
		;		GUICtrlSetData($lblretained, GUICtrlRead($lblretained) + 1)
		;	EndIf

		;	If $nStats_Lockpicks <> $oStats_Lockpicks Then
		;		Out("Argh! Broken..")
		;		GUICtrlSetData($lblbroken, GUICtrlRead($lblbroken) + 1)
		;	EndIf

		;	$nStats_LuckyPoints = GetLuckyTitle() - $oStats_LuckyPoints
		;	GUICtrlSetData($lbllucky, $nStats_LuckyPoints)
		;	$nStats_UnLuckyPoints = GetUnLuckyTitle() - $oStats_UnLuckyPoints
		;	GUICtrlSetData($lblunlucky, $nStats_UnLuckyPoints)

		EndIf
	Next
;add drop handling here or let drop handing of fight func pick it up
	If $ChestSpawn > 0 Then
		;Out("Is it gold?")
		DropHandling()
	Else
		GUICtrlSetData($lblnochest, GUICtrlRead($lblnochest) + 1)
		;Out("Oh, no chest!")
	EndIf
EndFunc   ;==>Cheest
this from pongmei think I used this back in the day to add chest opening to mqsc bot should help?
You'll throw a million errors if you just drop that into any other script.

Code:
 Func FindChest()
	Local $ChestSpawn = 0
	If GetIsDead(-2) Then Return

	rndsleep(250)

	For $i = 0 To 4
	If GetIsDead(-2) Then Return
		TargetNextItem()
		Sleep(50)
		$Target = GetCurrentTarget()
		Sleep(50)
		$Name = GetIsStatic($Target)
		Sleep(50)
		If $Name = True Then
			$ChestSpawn = $ChestSpawn + 1

			$ChestX = DllStructGetData($Target, 'X')
			$ChestY = DllStructGetData($Target, 'Y')

			GoSignpost($Target)
			Sleep(50)
			OpenChest()
		EndIf
	Next

	If $ChestSpawn > 0 Then
		PickUpLoot()
	Else
		Return False
	EndIf
 EndFunc
05/12/2018 23:38 ayyy_lmao#11
Code:
Local $lChests = GetAgArray()
Local $lPickUp = False

	For $i = 1 To $lChests[0]
		If (MemoryRead($lChests[$i] + 156, 'long') = 0x200) Then
			GoSignpost($lChests[$i])
			OpenChest()
			Sleep(GetPing() * 2)
			$lPickUp = True
		EndIf
	Next

	Sleep(GetPing() * 3 + 500)

	If $lPickUp Then PickShitUp()
think this is another way of doing chest?
05/13/2018 07:41 DerMoench14#12
A Chest isn't the only Agent with Agent Type 0x200.
05/13/2018 14:54 purownage#13
I get an disconnect error each time I zone in the dungeon when I try to fix the scroll function any idea?
05/17/2018 18:41 ayyy_lmao#14
uhh post the code? cuz rn we can only grasp at straws, might be header might be badly worded func ect
05/18/2018 03:15 afmart#15
try this
Code:
	
        Local $aChestName = "Xunlai Chest"
	Local $lChest = GetAgentByName($aChestName)
	If IsDllStruct($lChest) Then
		Out("Going to " & $aChestName)
		GoToNPC($lChest)
		RndSleep(Random(3000, 4200))
	EndIf

Quote:
Originally Posted by ayyy_lmao View Post
Code:
Local $lChests = GetAgArray()
Local $lPickUp = False

	For $i = 1 To $lChests[0]
		If (MemoryRead($lChests[$i] + 156, 'long') = 0x200) Then
			GoSignpost($lChests[$i])
			OpenChest()
			Sleep(GetPing() * 2)
			$lPickUp = True
		EndIf
	Next

	Sleep(GetPing() * 3 + 500)

	If $lPickUp Then PickShitUp()
think this is another way of doing chest?