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
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 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 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!
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
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
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
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.
;~ 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
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.
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.
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
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