Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Guild Wars > GW Bots
You last visited: Today at 13:56

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

Advertisement



Need Help with salvage function

Discussion on Need Help with salvage function within the GW Bots forum part of the Guild Wars category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2008
Posts: 54
Received Thanks: 3
Need Help with salvage function

Hello people,

first of all. I'm a big noob. Im just cooking some copy pasta out of all the bots i got to get them to do whatever i want So far it worked alright. Until now.

I try to add the ability to salvage runes and sell them to the runes merchant to my feather bots.... but well, i dont get it to work.

My main problem for now is the function SalvageMod() does nothing. It is part of the GWA2.au3 collection

Code:
Func SalvageMod($aModIndex)
	Return SendPacket(0x8, $HEADER_SALVAGE_MODS, $aModIndex)
EndFunc   ;==>SalvageMod
I hope you can tell me what i do wrong ... Isn't Runes Index 0 and Insignias Index 1 ?

Code:
Func CI_Salvage($BAGINDEX)
	Local $bag
	Local $I
	Local $AITEM
	$BAG = GETBAG($BAGINDEX)
	For $I = 1 To DllStructGetData($BAG, "slots") ;von 1 bis X slots von Bags
		If FindSalvageKit() = 0 Then
			If GETGOLDCHARACTER() < 500 And GETGOLDSTORAGE() > 499 Then
				WITHDRAWGOLD(500)
				Sleep(GetPing()+500)
			EndIf
			Local $J = 0
			Do
				BuyItem(3, 1, 400) ;buy 3th position
				Sleep(GetPing()+500)
				$J = $J + 1
			Until FindSalvageKit() <> 0 Or $J = 3
			If $J = 3 Then ExitLoop
			Sleep(GetPing()+500)
		EndIf
		$AITEM = GETITEMBYSLOT($Bagindex, $I)
		If DllStructGetData($AITEM, "ID") = 0 Then ContinueLoop ;this is a skip
	  If CheckCustomTopRunes_Array Then
		   SalvageMod(1)
	  ElseIf CheckCustomTopInsignias_Array Then
		   SalvageMod(0)
	  ElseIf CheckCustomMidRunes_Array Then
		   SalvageMod(1)
	  ElseIf CheckCustomMidInsignias_Array Then
		   SalvageMod(0)
	  ElseIf CheckCustomLowRunes_Array Then
		   SalvageMod(1)
	  ElseIf CheckCustomLowInsignias_Array Then
		   SalvageMod(0)
EndIf
		Sleep(GetPing()+500)
	Next
EndFunc
PS: It would be awesome if you tell me how to sell those runes to the rune merchant (request price -> sell). Would save me a lot of time since im a total noob :P
lasse1993 is offline  
Old 11/09/2018, 19:08   #2
 
elite*gold: 0
Join Date: Mar 2008
Posts: 54
Received Thanks: 3
Thanks a lot mate !
Gonna edit my stuff and hope it turns my shit into gold

Edit:

You provided me a huge step further and i can now salvage runes out of armors and sell them YEY

But if i'm going to loop through my inventory the bot tries to salvage the already salvaged mods again which result in a dc/error.

To prevent that im trying to combine my If statement with the model ID of an array. But if i add the AND part it wont salvage any mod anymore...

Can someone tell me where my mistake is?

Code:
If CheckCustomTopRunes_Array($aItem) AND CheckCustom_PickUp_ArmorPieces_Array($lModelID) Then
		   $aIndex = 1 ;0 = insignia | 1 = rune
			   StartSalvage($aItem)
			   Sleep(GetPing() + 800)
			   SalvageMod($aIndex)
		  Sleep(GetPing() + 800)


;~ ==== ArmorPieces ====
Global $Custom_PickUp_ArmorPieces_Array[5] = [1154, 1156, 1159, 1166, 1167]

Func CheckCustom_PickUp_ArmorPieces_Array($lModelID)
For $p = 0 To (UBound($Custom_PickUp_ArmorPieces_Array) -1)
If ($lModelID == $Custom_PickUp_ArmorPieces_Array[$p]) Then Return True
Next
EndFunc
I found a work around but its suuuuuuuper slow so i still would love to find the solution to it!

Right now the bot has to sell the rune right after he salvaged it. But im using some "messy" code which makes it really slow. (Loop to check for propper runes and salvage them, if one is salvaged another loop starts to find the rune and sell it to the rune merchant. After that salvaging continues ...)

Question: Do i need all the sleep commands? And should they be that long? Or could i lower them to ~150-250ms instead of 500-800 ?

Code:
If CheckCustomTopRunes_Array($aItem) Then
		   $aIndex = 1 ;0 = insignia | 1 = rune
			   StartSalvage($aItem)
			   Sleep(GetPing() + 800)
			   SalvageMod($aIndex)
			   SellRunes($BagIndex)
		  Sleep(GetPing() + 800)

Func SellRunes($BAGINDEX)
	Local $AITEM
	Local $BAG = GETBAG($BAGINDEX)
	Local $NUMOFSLOTS = DllStructGetData($BAG, "slots")
	$runemerchant = GetNearestNPCToCoords(16471, 12577)
	GoToNPC($runemerchant)
	For $I = 1 To $NUMOFSLOTS
		$AITEM = GETITEMBYSLOT($BAGINDEX, $I)
		If DllStructGetData($AITEM, "ID") = 0 Then ContinueLoop
		If CheckcustomRunes_Array ($AITEM) Then
			TraderRequestSell($AITEM)
			TraderSell()
		EndIf
		Sleep(GetPing()+250)
	Next
EndFunc
Full Function if it helps or smth...
lasse1993 is offline  
Reply


Similar Threads Similar Threads
[GWA2] How to close salvage window AFTER salvage session is complete?
05/08/2018 - GW Bots - 5 Replies
Hi all, I'm making a bot to manage my inventory for me in-game. 1. StartSalvage() on an item I want a mod for. 2. SalvageMod() for the mod I'm after 3. Close Salvage window (without GW kicking me out!) Can't figure out how to do step 3. Looks like when I close the salvage window in-game, it sends a packet to the GS to "cancel" the session. The GS panics when it sees that the session has already completed, and the client gets kicked from the server.
std::function of a function returning an std::function
11/11/2013 - C/C++ - 19 Replies
Nun muss ich nach langer Zeit auch mal wieder einen Thread erstellen, weil mir Google nicht mehr weiterhelfen kann. Ich verzweifle an Folgendem Vorhaben: #include <Windows.h> #include <string> #include <iostream> using namespace std;
Running Function 2 after Function 1 finished
09/15/2013 - AutoIt - 3 Replies
Hey, its me again. Im stuck on a problem since yesterday and as much as i hate to ask for help, i really dont know what else to try. I want Function 2 to run after Function 1 has finished. I tried GuiCtrlSetOnEvent and MsgLoop, but i dont really understand it. I tried to read tutorials but they didnt help at all. The line that are underline is what im talking about. I want gamestart() to run first and when its finished, i want iniviteteam() to run. #AutoIt3Wrapper_UseX64=n...
My Katana & CS mod footage that I was able to salvage
09/10/2011 - S4 League - 11 Replies
Modding character models have always been a hobby of mine with MMOs and it was S4's turn this time. I hope you like it. Unfortunately these 2 are the only ones I have footage off, old footage at that. The CS mod isn't even finished on this one and the katana mods needed a bit more tweaking with the .ogg files. The video just showcases what I changed, attacks, added some sounds, etc. Didn't have time to take the weapons to a test run with other players so yeah. There's also that green...
[VIP-function] ToxicSYS [VIP-function]
08/14/2010 - WarRock Hacks, Bots, Cheats & Exploits - 1 Replies
heeeey E-pvpers :pimp: this is a new hack by TSYS Status : UNDETECTED Functions (VIDEO) : YouTube - WarRock - Bikini event VIP hack



All times are GMT +2. The time now is 13:56.


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.