GW Working Bots 2020

04/24/2021 10:19 The Sav3r#1846
hi guys, im not new here i just changed account cause my old one was closed age ago, someone can help me?
im making some bot but im stuck at one point, i need that when it find a determinate ally the bot can continue the loop if not resign and start.
at this point i tried with getagentname() and getagentid() but not working

$lAname = ("assassin")
$lposition = GetNearestNPCToCoords(x, y)
$lName = GetAgentname($lposition)

If $lName = $lAame Then
04/24/2021 15:06 OneStrangeGuy#1847
If i remember well that function is broken.
If that ally has a unique "PlayerNumber" you can use something like this:
Code:
	  $lAname = GetNearestNPCToCoords(x, y)
	  If DllStructGetData($lAname, "PlayerNumber") = xxxx Then

	  Else

	  EndIf
Now if you ask me how to get that number i can't help, because i always used the tool "Bot Developer Helper" made by DerMoench14 to dig those values, unlucky with the last update it's broken.

Another idea could be to use the Func:
GetNumberOfAlliesInRangeOfAgent($aAgent = -2, $fMaxDistance = xxxx)

If you know how many should be there or not.

Hope this helps.
04/24/2021 15:13 Scythe_Farmer#1848
Quote:
Originally Posted by OneStrangeGuy View Post
If i remember well that function is broken.
If that ally has a unique "PlayerNumber" you can use something like this:
Code:
	  $lAname = GetNearestNPCToCoords(x, y)
	  If DllStructGetData($lAname, "PlayerNumber") = xxxx Then

	  Else

	  EndIf
Now if you ask me how to get that number i can't help, because i always used the tool "Bot Developer Helper" made by DerMoench14 to dig those values, unlucky with the last update it's broken.

Another idea could be to use the Func:
GetNumberOfAlliesInRangeOfAgent($aAgent = -2, $fMaxDistance = xxxx)

If you know how many should be there or not.

Hope this helps.


You can use GWToolbox for this purpose
04/24/2021 18:06 The Sav3r#1849
Quote:
Originally Posted by OneStrangeGuy View Post
If i remember well that function is broken.
If that ally has a unique "PlayerNumber" you can use something like this:
Code:
	  $lAname = GetNearestNPCToCoords(x, y)
	  If DllStructGetData($lAname, "PlayerNumber") = xxxx Then

	  Else

	  EndIf
Now if you ask me how to get that number i can't help, because i always used the tool "Bot Developer Helper" made by DerMoench14 to dig those values, unlucky with the last update it's broken.

Another idea could be to use the Func:
GetNumberOfAlliesInRangeOfAgent($aAgent = -2, $fMaxDistance = xxxx)

If you know how many should be there or not.

Hope this helps.
ty alot for help guys, been some age i dont code bots. You can send the full Func OF GetNumberOfAlliesInRangeOfAgent()? will work very good for my bot!
04/24/2021 18:36 Scythe_Farmer#1850
Change the Allegiance in your GetNumberOfFoesInRangeOfAgent() from 0x3 to 0x1 and you get the number of Allies in range of agent.
04/24/2021 20:42 Restia Ashdoll#1851
Quote:
Originally Posted by micbar24 View Post
Anyone maybe have headers for dialog?

I mean i try to repair ministry farm bot, but have problem with
all headers you could think off can be found in the toolbox github - link has been published several times in this post already.

Quote:
Originally Posted by The Sav3r View Post
hi guys, im not new here i just changed account cause my old one was closed age ago, someone can help me?
im making some bot but im stuck at one point, i need that when it find a determinate ally the bot can continue the loop if not resign and start.
at this point i tried with getagentname() and getagentid() but not working

$lAname = ("assassin")
$lposition = GetNearestNPCToCoords(x, y)
$lName = GetAgentname($lposition)

If $lName = $lAame Then
If it's a nonmoving NPC you try to get - i'd say the easiest is to go by cords - if not the playernumber + cords (area npc could be in) could work?
04/24/2021 21:39 uK Cooki3#1852
Quote:
Originally Posted by FriendlyFarmer View Post
There isn't just 1 gwa2 floating around here. A lot of people have their own, with their own modifications and names. Thats why sometimes you are missing functions or variables when you switch your gwa2.

Now read what Waka.Waka wrote, he literally provided a solution.
Hey i was having the same issue so i declared them in the gwa and now the bot deosn't fire up an error but GW itself crashes xD, what would cause this or is it a multiple of reasons.
Guess im just not meant to code haha
04/25/2021 13:39 Restia Ashdoll#1853
Quote:
Originally Posted by uK Cooki3 View Post
Hey i was having the same issue so i declared them in the gwa and now the bot deosn't fire up an error but GW itself crashes xD, what would cause this or is it a multiple of reasons.
Guess im just not meant to code haha
well your func or const are just bad if you recive a crash now.
04/25/2021 18:32 OneStrangeGuy#1854
Does the UseItem Func run or is still broken?
04/25/2021 21:06 Ac900#1855
Quote:
Originally Posted by OneStrangeGuy View Post
Does the UseItem Func run or is still broken?
my useitem func is fine

Quote:
Originally Posted by OneStrangeGuy View Post
Does the UseItem Func run or is still broken?
HTML Code:
;~ Description: Uses an item.
Func UseItem($aItem)
	Local $lItemID

	If IsDllStruct($aItem) = 0 Then
		$lItemID = $aItem
	Else
		$lItemID = DllStructGetData($aItem, 'ID')
	EndIf

	Return SendPacket(0x8, $HEADER_ITEM_USE, $lItemID)
EndFunc   ;==>UseItem
HTML Code:
Func Useparty() 
   Local $aBag
   Local $aItem
   Sleep(20)
   For $i = 1 To 4
	  $aBag = GetBag($i)
	  For $j = 1 To DllStructGetData($aBag, "Slots")
		 $aItem = GetItemBySlot($aBag, $j)
		 If DllStructGetData($aItem, "ModelID") == 21809 Then
			UseItem($aItem)
			Return True
		 EndIf
	  Next
   Next
EndFunc
HTML Code:
;GAME_CMSG_ITEM_USE
Global Const $HEADER_ITEM_USE = 0x7C	;Uses item from inventory/chest
04/25/2021 23:11 OneStrangeGuy#1856
Thank you, i messed up with my GWA2 but thanks to your confirm i was able to resolve it.
04/26/2021 09:56 FriendlyFarmer#1857
Quote:
Originally Posted by uK Cooki3 View Post
Hey i was having the same issue so i declared them in the gwa and now the bot deosn't fire up an error but GW itself crashes xD, what would cause this or is it a multiple of reasons.
Guess im just not meant to code haha
If GW crashes then something is broken in your bot. Likely a broken pattern or wrong headers. Or maybe you're trying to do stuff like moving while you're still loading the map etc.
Just disable everything and then enable one by one, so you can figure out whats broken. Or read through the last couple of pages here, to figure out which actions are still broken.
04/28/2021 19:57 alex.gw_only#1858
Has anyone managed to fix the salvage patterns? If yes, could they please share the updated lines?

Thank you very much in advance!
04/28/2021 21:19 list comprehension#1859
Quote:
Originally Posted by alex.gw_only View Post
Has anyone managed to fix the salvage patterns? If yes, could they please share the updated lines?

Thank you very much in advance!
The patterns for everything have been fixed for a while in private apis. Unless it is a major overhaul like jumping 10 compiler versions it is usually a few minutes to fix them.

Example: Patch yesterday broke my material trader pattern and it took 5 minutes to fix.

The reason I mention this is because this would be a great opportunity to learn more about these botting systems to fix on your own. A lot of the time it is possible to fix the issue faster than posting asking for it, much less getting the solution. Just some food for thought.
04/28/2021 22:07 epvp_dragon#1860
Quote:
Originally Posted by Yoshikawa91 View Post
Here is the fix.
* On the left (red) what I suppose you have
* On the right (green) what you need to change to fix it

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



Personaly, I didn't encounter any issue with picking up loots recently.

Can you post your PickupLoot function so we can see what could be wrong with it (even if it should be the same that the rest of us) ?
I went in and modified my GWA2 file with the corrections you had posted but my dude is still not buying ectos. He runs up to the rare mat trader, opens up buy window, withdrawals gold like he is going to buy but doesnt. No error message pops up, could this be an issue with the actual function at this point?

I have attached the function I am trying to use. Any help would be appreciated!!

FUNC BUYECTOS()
IF GETGOLDSTORAGE() > 900000 THEN ;900k
LOCAL $RAREMATTRADER = GETNEARESTNPCTOCOORDS(-2079, 1046)
OUT("Going to Rare Material Trader")
GOTONPC($RAREMATTRADER)
RNDSLEEP(1000)
LOCAL $MAXINVGOLDS
LOCAL $TRADERPRICE
Out("Buying Ectos")
WHILE GETGOLDSTORAGE() > 900000 ;900k
DO
WITHDRAWGOLD()
GUICTRLSETDATA($STCHESTGOLD, GETGOLDSTORAGE())
TRADERREQUEST(930)
SLEEP(GETPING()+500)
$TRADERPRICE = GETTRADERCOSTVALUE()
TRADERBUY()
SLEEP(GETPING()+500)
GUICTRLSETDATA($STCHESTGOLD, GETGOLDSTORAGE())
SLEEP(GETPING()+500)
Until GETGOLDSTORAGE() < 800000 ;800k

WEND
Out("Buy Ectos Complete")
Sleep(500)
Out("Depositing Platinum")
DEPOSITGOLD()
ENDIF
ENDFUNC