Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Guild Wars > GW Bots
You last visited: Today at 00:38

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Func TraderRequest + TraderBuy

Discussion on Func TraderRequest + TraderBuy within the GW Bots forum part of the Guild Wars category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Oct 2022
Posts: 8
Received Thanks: 0
Func TraderRequest + TraderBuy

Hello everybody,

I have been trying to get the Function TraderRequest work.
But it doesn't work.

Code:
While GetGoldCharacter() > 20*1000
		TraderRequest(930)
		TraderBuy()
		Sleep(500 + 3 * GetPing())
	WEnd
The problem is, it goes to the trader, talks to it, but it doesn't buy anything.

Here is the TraderRequest and TraderBuy code.

Code:
Func TraderRequest($aModelID, $aExtraID = -1)
	Local $lItemStruct = DllStructCreate('long Id;long AgentId;byte Unknown1[4];ptr Bag;ptr ModStruct;long ModStructSize;ptr Customized;byte unknown2[4];byte Type;byte unknown4;short ExtraId;short Value;byte unknown4[2];short Interaction;long ModelId;ptr ModString;byte unknown5[4];ptr NameString;ptr SingleItemName;byte Unknown4[10];byte IsSalvageable;byte Unknown6;byte Quantity;byte Equiped;byte Profession;byte Type2;byte Slot')

	Local $lOffset[4] = [0, 0x18, 0x40, 0xC0]
	Local $lItemArraySize = MemoryReadPtr($mBasePointer, $lOffset)
	Local $lOffset[5] = [0, 0x18, 0x40, 0xB8, 0]
	Local $lItemPtr, $lItemID
	Local $lFound = False
	Local $lQuoteID = MemoryRead($mTraderQuoteID)

	For $lItemID = 1 To $lItemArraySize[1]
		$lOffset[4] = 0x4 * $lItemID
		$lItemPtr = MemoryReadPtr($mBasePointer, $lOffset)
		If $lItemPtr[1] = 0 Then ContinueLoop

		DllCall($mKernelHandle, 'int', 'ReadProcessMemory', 'int', $mGWProcHandle, 'int', $lItemPtr[1], 'ptr', DllStructGetPtr($lItemStruct), 'int', DllStructGetSize($lItemStruct), 'int', '')
		If DllStructGetData($lItemStruct, 'ModelID') = $aModelID And DllStructGetData($lItemStruct, 'bag') = 0 And DllStructGetData($lItemStruct, 'AgentID') == 0 Then
			If $aExtraID = -1 Or DllStructGetData($lItemStruct, 'ExtraID') = $aExtraID Then
				$lFound = True
				ExitLoop
			EndIf
		EndIf
	Next
	If Not $lFound Then Return False

	DllStructSetData($mRequestQuote, 2, DllStructGetData($lItemStruct, 'ID'))
	Enqueue($mRequestQuotePtr, 8)

	Local $lDeadlock = TimerInit()
	$lFound = False
	Do
		Sleep(20)
		$lFound = MemoryRead($mTraderQuoteID) <> $lQuoteID
	Until $lFound Or TimerDiff($lDeadlock) > GetPing() + 5000
	Return $lFound
EndFunc   ;==>TraderRequest

;~ Description: Buy the requested item.
Func TraderBuy()
	If Not GetTraderCostID() Or Not GetTraderCostValue() Then Return False
	Enqueue($mTraderBuyPtr, 4)
	Return True
EndFunc   ;==>TraderBuy
Does anyone have a working function? Or updated one?
BigBoyEnergy is offline  
Old 11/14/2022, 08:57   #2
 
elite*gold: 0
Join Date: Jan 2014
Posts: 2
Received Thanks: 0
I am running into this also. Did you ever figure it out?
In my testing it seems GETTRADERCOSTVALUE() is coming back as 0, which I believe is causing TraderRequest() and TraderBuy() to return false, which is why it isn't buying anything.
jrad99 is offline  
Old 12/19/2022, 21:42   #3
 
elite*gold: 0
Join Date: Oct 2022
Posts: 8
Received Thanks: 0
I managed to get a gwa2 file that contained way more code. I replaced some stuff and that one is working. No idea what is different :')
BigBoyEnergy is offline  
Old 01/30/2023, 12:58   #4
 
elite*gold: 0
Join Date: Apr 2021
Posts: 2
Received Thanks: 0
Quote:
Originally Posted by BigBoyEnergy View Post
I managed to get a gwa2 file that contained way more code. I replaced some stuff and that one is working. No idea what is different :')
Can you please share the gwa2 file you found?
SneakyJoe is offline  
Old 01/30/2023, 13:03   #5
 
elite*gold: 0
Join Date: Oct 2022
Posts: 8
Received Thanks: 0
Quote:
Originally Posted by SneakyJoe View Post
Can you please share the gwa2 file you found?
https://github.com/Greg-76/Gwa2_by_Greg76


Here you go

Some things are renamed, but I'm sure you can work with it
BigBoyEnergy is offline  
Old 03/15/2023, 21:39   #6
 
xnx's Avatar
 
elite*gold: 85
Join Date: Sep 2009
Posts: 284
Received Thanks: 9
hey mates, still having trouble to fix my gwa2 for traderrequest and traderbuy function for material.

can anyone help me get around or offer me a function gwa2 for that?

the greg-76 gwa2 is broken


might be an adressing issue? fix via cheat engine but i cant figure out how to get the right hex adressing

any help is appreciated!
xnx is offline  
Old 08/09/2023, 16:26   #7
 
elite*gold: 0
Join Date: Oct 2022
Posts: 8
Received Thanks: 0
Quote:
Originally Posted by xnx View Post
hey mates, still having trouble to fix my gwa2 for traderrequest and traderbuy function for material.

can anyone help me get around or offer me a function gwa2 for that?

the greg-76 gwa2 is broken


might be an adressing issue? fix via cheat engine but i cant figure out how to get the right hex adressing

any help is appreciated!
I can send you my GWA2 File, and the code to make it buy ecto's.


Code:
Func BUYECTOS()

	Do
        RndSleep(Random(250,500))
		Local $Me = GetAgentByID(-2)
        Local $guy = GetNearestNPCToCoords(DllStructGetData($Me, 'X'), DllStructGetData($Me, 'Y'))
    Until DllStructGetData($guy, 'Id') <> 0
    ChangeTarget($guy)
    RndSleep(Random(250,500))
    GoToNPC($guy)
    RndSleep(Random(250,500))
    Do
        MoveTo(DllStructGetData($guy, 'X'), DllStructGetData($guy, 'Y'), 40)
        RndSleep(Random(500,750))
        GoToNPC($guy)
        RndSleep(Random(250,500))
        Local $Me = GetAgentByID(-2)
    Until ComputeDistance(DllStructGetData($Me, 'X'), DllStructGetData($Me, 'Y'), DllStructGetData($guy, 'X'), DllStructGetData($guy, 'Y')) < 250
    RndSleep(Random(1000,1500))
	;~This section does the buying
    While GetGoldCharacter() > 20 * 1000
	If GetGoldStorage() > 10000 Then
	WithdrawGold(10000)
	CheckGold()
	EndIf
        TraderRequest(930)
        Sleep(500 + 3 * GetPing())
        TraderBuy()
    WEnd
 EndFunc   ;~ Rare Material trader
Attached Files
File Type: rar GWA2.rar (1.8 KB, 17 views)
BigBoyEnergy is offline  
Reply


Similar Threads Similar Threads
TraderRequest Function
08/17/2020 - GW Bots - 3 Replies
Hi, I'm trying to improve some bots atm but i can't figure this function out. It doesnt do anything, character just stands near the rare-trader but doesn't do anything : I tested with that : TraderRequest(930) TraderBuy()
Func nach der func ausführen problem
08/15/2011 - AutoIt - 6 Replies
Hi, ich hab hier mal nen code schnipel der nicht funktioniert.. Die error Erkennung... if StringInStr($oWebTcp.body, "Du kannst nicht weitermachen...") Then GUICtrlSetData($list1, "Login failed. Please fix"&" = "&$array&" ANR: ")
Func in Func ?
02/11/2011 - AutoIt - 8 Replies
Hallo E*PvP, Ich habe eine frage , ich will ein shortcut ..ding machen ..xD also wen ich z.b F1 drücke,soll ich in ein Menü reinkommen und dan auch für F1 etwas anderes amchen also z.b F1= Begrüßungs hotkeys => Press F1 =>
[Fragen zu] Gui Hide & Show / Admin Rights / Func in Func
12/12/2010 - AutoIt - 29 Replies
Hi Leute, wie ihr oben ja bereits lesen könnt habe ich ein paar Fragen. 1. Könnte mir jmd. eine Hotkeyset-Func schreiben, womit ich mit nur einer (!) Taste die GUI verstecken und wieder anzeigen lassen kann ? 2. Gibt es etwas, dass dem gescripteten Tool von selbst Adminrechte verschafft? Ich rede NICHT von RequireAdmin, da muss man ja Administrator des PCs sein. €: Kann "#requireadmin" rausgezögert werden ?! Ich möchte, dass das passiert, aber erst, wenn ich einen Knopf gedrückt...
Mit welcher Func am besten zwischen 2 GW Fenster wechseln?
05/30/2008 - Guild Wars - 14 Replies
Hallo, Ich weiss schon wieder ein mal nich weiter (Ich kann bald n Fragen von gabba sammel Fred auf machen). Ich hab mirn Bot geschrieben der mit mehreren Accs gleichzeitig hfff läuft is auch soweit alels ganz doll nur an soner dummen Sache weiss ich wieder nicht weiter. Ich hab die Accs mit dem Multi Clienten von hier gestartet und da heißen se dann ja GW, GW1, GW2 usw. und wenn ich dem Script jetzt sag winactivate GW aktiviert er nich selten GW1 oder 2 oder sons was was halt als letztes...



All times are GMT +2. The time now is 00:38.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.