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

07/11/2019 10:06 rgegegergerg#106
Hey !

Setup a few bots so far, slowly getting used to it, so much fun !
One issue I have is that sometimes they get stuck, IE a chest perfectly on a corner that blocks the normal route.

Does anyone know of a way to incorporate a "stuck" fuction, that will if the XY coords stay relatively unchanged, or the next waypoint isn't got to after some long delay resets the run?

Ty for any help :)
07/11/2019 10:52 oneshout#107
Quote:
Originally Posted by rgegegergerg View Post
Hey !

Setup a few bots so far, slowly getting used to it, so much fun !
One issue I have is that sometimes they get stuck, IE a chest perfectly on a corner that blocks the normal route.

Does anyone know of a way to incorporate a "stuck" fuction, that will if the XY coords stay relatively unchanged, or the next waypoint isn't got to after some long delay resets the run?

Ty for any help :)
Don't know if it can help you; here a part from a bot with "stuck" function ;)

Quote:
Func MoveAggroing1($lDestX, $lDestY, $lRandom = 150)
If GetIsDead(-2) Then Return

Local $lMe, $lAgentArray
Local $lBlocked

Local $lAngle
Local $stuckTimer = TimerInit()

Move($lDestX, $lDestY, $lRandom)
Do
RndSleep(50)

$lMe = GetAgentByID(-2)

$lAgentArray = GetAgentArray(0xDB)

If GetIsDead($lMe) Then Return False

If DllStructGetData($lMe, 'MoveX') == 0 And DllStructGetData($lMe, 'MoveY') == 0 Then

$lBlocked += 1
If $lBlocked < 4 Then
Move($lDestX, $lDestY, $lRandom)
Elseif $lBlocked < 8 then
$lAngle += 40
Move(DllStructGetData($lMe, 'X')+200*sin($lAngle), DllStructGetData($lMe, 'Y')+200*cos($lAngle))
elseif $lBlocked >= 8 Then
killDerv()
EndIf


elseIf $lBlocked > 0 Then

If TimerDiff($ChatStuckTimer) > 3000 Then ; use a timer to avoid spamming /stuck
SendChat("stuck", "/")
$ChatStuckTimer = TimerInit()
EndIf
$lBlocked = 0
TargetNearestEnemy()
sleep(1000)
If GetDistance() > 1100 Then ; target is far, we probably got stuck.
If TimerDiff($ChatStuckTimer) > 3000 Then ; dont spam
SendChat("stuck", "/")
$ChatStuckTimer = TimerInit()
RndSleep(GetPing())
EndIf
EndIf
EndIf

Until ComputeDistance(DllStructGetData($lMe, 'X'), DllStructGetData($lMe, 'Y'), $lDestX, $lDestY) < $lRandom*1.5
Return True
EndFunc
07/11/2019 14:47 phat34#108
...Heres a little ditty...

Code:
Func XYDL()
	;c/p sharp coderz 2015 -> creditz phat34 n0 sharing this -> lol <-
   	;Local $_A2409958249, $_A2929794101, $_A1200970773
	If $DiagMode Then ConsoleWrite("XYD-> " & $XYDEADLOCK)
	IF $XYDEADLOCK <= 3 Then
	   If $XYDEADLOCK = 1 Then
	    Local $_A86603573 = GetAgentByID(-2)
	    $_A2929794101 = DllStructGetData($_A86603573 , 'X')
	    $_A1200970773 = DllStructGetData($_A86603573 , 'Y')
	   EndIf
	   $_A2409958249 = ComputeDistance(DllStructGetData(GetAgentByID(-2), 'X'), DllStructGetData(GetAgentByID(-2), 'Y'), $_A2929794101, $_A1200970773)
	   If $_A2409958249 > 200 Then $XYDEADLOCK = 0
	; $XYDEADLOCK = -1
	ElseIf $XYDEADLOCK < 5 Then
	$_A2409958249 = ComputeDistance(DllStructGetData(GetAgentByID(-2), 'X'), DllStructGetData(GetAgentByID(-2), 'Y'), $_A2929794101, $_A1200970773)
	   If $_A2409958249 < 200 Then
		Opt("SendKeyDelay", 500)
		If $DiagMode Then ConsoleWrite("No Movement XYD-> " & $XYDEADLOCK)
		;ControlSend("GW.exe", "", "", "{ENTER}{ENTER}{ESC}",1)
		;ControlSend("Guild Wars", "", "", "{ENTER}{ENTER}")
		ControlSend($MGWHWND, "", "", "{ESC}")
		Sleep(2000)
		ControlSend($MGWHWND, "", "", "{ENTER}{ENTER}")
		Sleep(1000)
		ControlSend(GetWindowHandle(), "", "", "{Enter}{Enter}")
		Opt("SendKeyDelay", 5)
		If GETMAPID() = 0 Or GetMapLoading() = 2 Then DISCONNECTED()
	   Else
		$XYDEADLOCK = -1
	   EndIf
	Else
		If $DiagMode Then ConsoleWrite("No Movement XYD-> " & $XYDEADLOCK & " ReBOOTING this Bia!")
		Out(" RE_LOADING! ")
		Opt("SendKeyDelay", 500)
		ReLoadGW($MGWHWND)
		Sleep(10000)
		ControlSend($MGWHWND, "", "", "{Enter}{Enter}")
		Sleep(1000)
		ControlSend(GetWindowHandle(), "", "", "{Enter}{Enter}")
		Opt("SendKeyDelay", 5)
    EndIf
EndFunc
You need a global $xydeadlock = 0 towards the top of the code and you need to setup a timer to jump to this function every so often like:

Code:
AdlibRegister("XYDL", 1000)
oh and $mGWHwnd = $mGWWindowHandle
07/11/2019 19:40 TheOldy#109
Does anyone have a solution for buying mats? Seems like the Traderequest-Funktion is not working as it should
07/12/2019 11:28 rgegegergerg#110
Similar question, trying to create a bot that returns the value of a mat (here ecto, 930) & prints it to the GUI (it's just a little subpart of a much larger project).

Code:
Out("Checking Buy Price")
	TraderRequest(930)
	$BuyLabel = GetTraderCostValue(930)
The idea is that $BuyLabel, declared at the top of the code, will be filled into the GUI. In the GUI build function, the label is show as such :

Code:
GUICtrlCreateLabel("Buy Price:", 8, 88, 40, 15)
	$BuyLabel = GUICtrlCreateLabel("0", 55, 88, 25, 15)
I'm having a few issues understanding the two functions TraderRequest and GetTraderCostValue though

My understanding was TraderRequest request's a quote from the vendor of said item and returns true or false depending on if it get's it or not (planning on adding an if false to prevent the script running if it doesn't get the fresh quote).

GetTraderCostValue should return the price of said item. But i'm getting the error :

Code:
$BuyLabel = GetTraderCostValue(930)
$BuyLabel = ^ERROR

Error : Incorrect number of parameters in function call.
Where am I going wrong? How can I debug this issue?
Can't find any info on the GetTraderCostValue function so not sure what variables it's expecting..
Tried it without the "930" and it doesn't show the error but also returns nothing to my label..

Any help is appreciated thanks :)
07/12/2019 13:53 mhaendler#111
Quote:
Originally Posted by rgegegergerg View Post
Code:
$BuyLabel = GetTraderCostValue(930)
$BuyLabel = ^ERROR

Error : Incorrect number of parameters in function call.
Where am I going wrong? How can I debug this issue?
Your Call of the function GetTraderCostValue is wrong, as your AutoIt Error States you, there are no parameter on GetTraderCostValue...

First you have to call

Code:
TraderRequest(930)
then you can get the returns price

Code:
GetTraderCostValue()
I would put a little SleepTime in between
Code:
sleep(100+GetPing())
Quote:
Originally Posted by rgegegergerg View Post
Similar question, trying to create a bot that returns the value of a mat (here ecto, 930) & prints it to the GUI (it's just a little subpart of a much larger project).

Code:
Out("Checking Buy Price")
	TraderRequest(930)
	$BuyLabel = GetTraderCostValue(930)
The idea is that $BuyLabel, declared at the top of the code, will be filled into the GUI. In the GUI build function, the label is show as such :

Code:
GUICtrlCreateLabel("Buy Price:", 8, 88, 40, 15)
	$BuyLabel = GUICtrlCreateLabel("0", 55, 88, 25, 15)
I'm having a few issues understanding the two functions TraderRequest and GetTraderCostValue though

My understanding was TraderRequest request's a quote from the vendor of said item and returns true or false depending on if it get's it or not (planning on adding an if false to prevent the script running if it doesn't get the fresh quote).

GetTraderCostValue should return the price of said item. But i'm getting the error :

Can't find any info on the GetTraderCostValue function so not sure what variables it's expecting..
Tried it without the "930" and it doesn't show the error but also returns nothing to my label..

Any help is appreciated thanks :)
With the latest updates, a pattern changed wich is handling the TraderSection (Buying, Selling) stuff, without updating these patterns you probably wont get any return from GetTraderCostValue()

Code:
 _('ScanTraderFunction:')
    AddPattern('????')
    _('ScanTraderHook:')
    AddPattern('????')
I am not an expert in this pattern stuff, but if some1 has fixed this issue HMU via PM, i also need a fix for this one :D

Greetings
mhaendler
07/12/2019 20:30 rgegegergerg#112
Yeah simplified the script to the max with just a simple text output to see what GetTraderCostValue() was outputting & it's not working at all !

Any knowlege on how I could either update these myself or find an updated list?

Thanks for the pointers though :)
07/13/2019 23:30 RiflemanX#113
Quote:
Originally Posted by spartanfbj View Post
Hey all, I’m a full-time software developer and recently got back into Guild Wars to start making bots as a hobby. This forum has been an awesome resource and props to all of the main contributors around here making/updating bots and helping out everyone. Some people seem unappreciative of the few folk that are really doing a lot to support this community and I want to say thank you to those guys.

I’ve started editing a Vaettir bot with success but I’d like to make it more intelligent when it comes to handling items. Things like salvaging certain Mods, saving r9 items of specific attributes, salvaging Highly Salvagable items, and salvaging items for specific materials.

My idea was to make a script that bots could require in their script that would act as a module to handle these different scenarios with a GUI to select and prioritize what inscriptions/mods you’d like to salvage/store, items and requirements you’d like to store, materials you’d aim to salvage from items that don’t meet any of the other criteria, etc.

My question is, is this something that’s already done or attempted? Is this more work than I assume? I’ve laid out a decent sized framework of GUI, functions and workflow. But I haven’t developed a bot start to finish yet and I’m not sure if it’s even possible to make a ‘module’ like this that can be essentially plugged in to existing bots to handle their item/inventory logic.
Yes, someone has created a very extensive inventory manager like this. I think there are several that I know of and yes, this is an extensive project. It may be your best course to get an example to modify and upgrade as its quite an effort to develop from start to finish on your own.

I would also suggest collecting some development tools from this site and others to assist you in your efforts.

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

[Only registered and activated users can see links. Click Here To Register...]
07/29/2019 23:21 1328™#114
Hey Mates,

my EsnureEnglish func didnt work since some updates. can someone help me pls?
in my script i wrote "EnsureEnglish(True)"
07/30/2019 02:13 phat34#115
The Func EnsureEnglish() is hooked through the $mLabels array in Windows 10 along with $mCharname and other important Kernel and Windows handle data and should work normally as this is not a header or pattern value. Most likely the problem is that someone altered your gwa2.au3 and destroyed the Initialize routine... I would try a different gwa2.au3 or you can upload yours on another thread and I can take a look.... another option is to just change your game to English in the regular game menu.
08/12/2019 13:41 oneshout#116
Hi guys,
i was wondering if somebody have thought or done something about margonite or titan gemstones farm in DOA ? seem it doesn't exist but i can be wrong

Ex: Margonite Gemstone Farm, Solo HM with 1 Hero
Quote:
[Only registered and activated users can see links. Click Here To Register...]
Cheers
08/13/2019 15:21 Bibopp#117
Hi try that I did it quick missed some regulation but it works

Player: OgcTcZ/8ZiHRn5AKukmE35uU4AA , Hero: OwIU0wHDFrGyTkOMepEAAA6A
08/13/2019 15:45 oneshout#118
Quote:
Originally Posted by Bibopp View Post
Hi try that I did it quick missed some regulation but it works

Player: OgcTcZ/8ZiHRn5AKuk ; Hero: OwIU0wHDFrGyTkOMepEAAA6A
I'm going to test it right now ;)
Tks a lot
08/17/2019 08:14 phat34#119
Ok well... it has been almost since I started this thread that I myself has asked for help... but, I have ran into a strange problem that no one seems to know about. For some reason, my client crashes when running a bot, when I try to flag my heroes??????? Is anyone else having this problem... Or is it just me?

Let me know if anyone has a solution, or has any idea what might be causing this?

Here you go Andy! I see you asked for heroes... I am going to check for that... but, I will leave this.

Code:
FUNC USESKILLEX($ASKILLSLOT, $ATARGET = -2)
	IF GETISDEAD(-2) OR NOT $BOT_RUNNING THEN RETURN FALSE
	$TDEADLOCK = TIMERINIT()
	USESKILL($ASKILLSLOT, $ATARGET)
	DO
		SLEEP(250)
		IF NOT $BOT_RUNNING OR GETISDEAD(-2) THEN RETURN FALSE
		IF GETMAPLOADING() == 2 THEN
		        DISCONNECTED()
			RETURN FALSE
		ENDIF
	UNTIL GETSKILLBARSKILLRECHARGE($ASKILLSLOT) <> 0 OR TIMERDIFF($TDEADLOCK) > 5000
	RETURN 1
ENDFUNC
08/17/2019 10:35 oneshout#120
Quote:
Originally Posted by phat34 View Post
Ok well... it has been almost since I started this thread that I myself has asked for help... but, I have ran into a strange problem that no one seems to know about. For some reason, my client crashes when running a bot, when I try to flag my heroes??????? Is anyone else having this problem... Or is it just me?

Let me know if anyone has a solution, or has any idea what might be causing this?
What bot or function are you using to flag a hero / heroes ? maybe the sendPacket adress is wrong...i have try a kabob farmer with a 1 hero flag and it don't crash...

GWA2 :
Quote:
;~ Description: Place a hero's position flag.
Func CommandHero($aHeroNumber, $aX, $aY)
Return SendPacket(0x14, $HEADER_HERO_PLACE_FLAG, GetHeroID($aHeroNumber), FloatToInt($aX), FloatToInt($aY), 0)
EndFunc ;==>CommandHero

;~ Description: Place the full-party position flag.
Func CommandAll($aX, $aY)
Return SendPacket(0x10, $HEADER_PARTY_PLACE_FLAG, FloatToInt($aX), FloatToInt($aY), 0)
EndFunc ;==>CommandAll
Exemple from Kabob farmer to flag 1 hero but with use the CommandAll (full-party position flag) :

Quote:
Func KabobFarm()
logFile("Kabob Farm Checked")
If GetMapId() <> 425 Then
RndTravel(425)
WaitMapLoading(425)
logFile("Setting Build")
LoadSkillTemplate($templateKabob)
logFile("Adding Koss")
endif
AddHero(6)
logFile("Exit town")
MoveTo(-15421, 9298)
Move(-15300, 9000)
WaitMapLoading(384)
CommandAll(-13500, 2000)
UseHeroSkill(1, 1, -2)
UseSkillEx(1,-2)
logFile("First Point")
MoveKill(-14614, 8009)
MoveKill(-13545, 8396)
MoveKill(-11612, 10283)
logFile("Killing Drake")
Kill()
logFile("Drake Dead")
PickUpLoot()
logFile("Second Point")
MoveKill(-10270, 11077)
MoveKill(-6942, 11754)
logFile("Killing Drake")
Kill()
logFile("Drake Dead")
PickUpLoot()
sleep (100)
If GetIsDead(-2) Then
$nbFails += 1
logFile("I'm dead.")
Else
$nbRuns += 1
EndIf
logFile("Start Again")
RndTravel(425)
EndFunc