Complete noob coder attempting to code interchangeable Nick bot

04/17/2023 10:42 ARJ#16
Okay so for this week Nick set i wanna give it a try "making" the new bot. So to make sure i got it right all i have to do is:

Change Town and Arena ID, Coordinates for moving out of the town and change coordinates for the farming route? (:

And add ID for the Nick item
04/17/2023 12:34 dboston#17
That's correct, although this week's set is Phantom Residue, which is dropped by some mobs in the Underworld. Obviously to get into the underworld you either need to /kneel interact with NPC or use a scroll, I'm not too sure how to code either of those actions into the bot, so I'll likely not farm this next week's item.

Unless of course, you get into the UW, start the bot, let the bot do a run until it /resigns, close the bot, then manually re-enter the UW and start the bot again. It's only 5 drops it needs so might not take too many runs. (Although might have to edit it to remove the bot trying to zone to an outpost at the start of the run, not looked into it although should be relatively easy?)
04/18/2023 13:14 ARJ#18
oh i picked a bad week for it. But cant you just farm in "Ruins of the Tomb of the Primeval Kings" ..

Info from wiki: [Only registered and activated users can see links. Click Here To Register...]

Edit: Okay nevermind it looks complicated too xD Ill just wait for an easy nick set xD
06/06/2023 12:07 dboston#19
Intricate Grawl Necklaces
06/11/2023 01:46 Dupljakus#20
Guys, something changed in code? Like headers or what? My bots are all messed up.
06/12/2023 11:48 dboston#21
I've not changed anything in these Nick bots except the item pickup ID, outpost/explorable area ID and the coordinates for the bot to run...
06/20/2023 15:26 dboston#22
Gold Dubloon Coins

As there are some bosses here with Green drops, I wondered if anyone knew how to add a blanket "pickup all grees' line into the code somewhere? Or if anyone knows of a location that has ModelIDs of all green items that I can input manually myself?

Thanks
06/20/2023 17:25 Restia Ashdoll#23
Quote:
Originally Posted by dboston View Post
Gold Dubloon Coins

As there are some bosses here with Green drops, I wondered if anyone knew how to add a blanket "pickup all grees' line into the code somewhere? Or if anyone knows of a location that has ModelIDs of all green items that I can input manually myself?

Thanks
just pick up everything with green rarity ..

Global Const $RARITY_GREEN = 2627


Please check yourself if this is working i won't test it, but form the stuff you provided this looks fitting imo, i also shortend the function because that looked so ugly - you can just add every modelid which should be picked up in the first case statement --> if you want to keep the readability i would suggest you get a const for the Item showing the name
06/20/2023 18:03 dboston#24
I replaced my pickup function with the one you suggested but getting an error (variable used without being declared). Will have a dig into it later

Thanks for setting me on the right track!
06/20/2023 18:09 Restia Ashdoll#25
Quote:
Originally Posted by dboston View Post
I replaced my pickup function with the one you suggested but getting an error (variable used without being declared). Will have a dig into it later

Thanks for setting me on the right track!
My bad just put a Local infront of the 2 variables $r and $m - fixed it above also
06/20/2023 23:16 dboston#26
Thanks, although I'm still getting an error, further up in the code, in this function:

Code:
Func GetExtraItemInfo($aitem)
    If IsDllStruct($aitem) = 0 Then $aAgent = GetItemByItemID($aitem)
    $lItemExtraPtr = DllStructGetData($aitem, "namestring")

    DllCall($mHandle[0], 'int', 'ReadProcessMemory', 'int', $mHandle[1], 'int', $lItemExtraPtr, 'ptr', $lItemExtraStructPtr, 'int', $lItemExtraStructSize, 'int', '')
    Return $lItemExtraStruct
EndFunc   ;==>GetExtraItemInfo
The error is on the 4th line (DllCall), I've been looking at it with Google and ChatGPT but no luck so far.

EDIT. Ok, think I've fixed it, I removed some brackets from the code you sent, here's the new version:

Code:
Func CanPickUp($aitem)
    Local $r = DllStructGetData($aItem, 'rarity')
    Local $m = DllStructGetData($aitem, 'ModelID')

    Switch $m
        Case 467, 468, 37765, 933, 2511, 934, 442, 5965, 444, 921, 923, 932, 813, 22190, 22191, 27040, 454, 1660, 499, 1578
            Return True
        Case Else
            If $r = $RARITY_GREEN Then Return True
            Return False
    EndSwitch
EndFunc ;=> CanPickUp
It's not crashing anymore, will test to see if it picks up Dubloons + Greens now...
06/21/2023 08:18 Restia Ashdoll#27
Quote:
Originally Posted by dboston View Post
Thanks, although I'm still getting an error, further up in the code, in this function:

Code:
Func GetExtraItemInfo($aitem)
    If IsDllStruct($aitem) = 0 Then $aAgent = GetItemByItemID($aitem)
    $lItemExtraPtr = DllStructGetData($aitem, "namestring")

    DllCall($mHandle[0], 'int', 'ReadProcessMemory', 'int', $mHandle[1], 'int', $lItemExtraPtr, 'ptr', $lItemExtraStructPtr, 'int', $lItemExtraStructSize, 'int', '')
    Return $lItemExtraStruct
EndFunc   ;==>GetExtraItemInfo
The error is on the 4th line (DllCall), I've been looking at it with Google and ChatGPT but no luck so far.

EDIT. Ok, think I've fixed it, I removed some brackets from the code you sent, here's the new version:

Code:
Func CanPickUp($aitem)
    Local $r = DllStructGetData($aItem, 'rarity')
    Local $m = DllStructGetData($aitem, 'ModelID')

    Switch $m
        Case 467, 468, 37765, 933, 2511, 934, 442, 5965, 444, 921, 923, 932, 813, 22190, 22191, 27040, 454, 1660, 499, 1578
            Return True
        Case Else
            If $r = $RARITY_GREEN Then Return True
            Return False
    EndSwitch
EndFunc ;=> CanPickUp
It's not crashing anymore, will test to see if it picks up Dubloons + Greens now...
Just drop a Green on purpose :) if you want to quickly test it, i took the above string out of the api but i guess that was outdated than

glad it seems to work
06/21/2023 12:25 dboston#28
I've been dropping greens like there's no tomorrow but I cannot get it to pickup. I've tried slicing parts out of other bots and inserting them but if they don't pickup, they crash. If anyone knows why this may be the case, I'd love to know! Thanks
06/21/2023 13:23 Waka.Waka#29
Try this one
Code:
Global Enum $RARITY_White = 2621, $RARITY_Blue = 2623, $RARITY_Purple = 2626, $RARITY_Gold = 2624, $RARITY_Green = 2627

Func CanPickUp($aitem)
Local $m = DllStructGetData($aitem, 'ModelID')
Local $r = GetRarity($aitem)
Local $c = DllStructGetData($aitem, 'ExtraID')

    Switch $m
        Case 467, 468, 37765, 933, 2511, 934, 442, 5965, 444, 921, 923, 932, 813, 22190, 22191, 27040, 454, 1660, 499, 1578
            Return True
 EndSwitch

Switch $r
   Case $RARITY_Gold ; Gold Items
			Return True
   case $RARITY_Green
			Return True
EndSwitch

Return False

EndFunc ;=> CanPickUp
You can now also add all kind of stuff with a new switch. Either Colors or req8 or so on...
06/21/2023 14:58 dboston#30
Quote:
Originally Posted by Waka.Waka View Post
Try this one
Code:
Global Enum $RARITY_White = 2621, $RARITY_Blue = 2623, $RARITY_Purple = 2626, $RARITY_Gold = 2624, $RARITY_Green = 2627

Func CanPickUp($aitem)
Local $m = DllStructGetData($aitem, 'ModelID')
Local $r = GetRarity($aitem)
Local $c = DllStructGetData($aitem, 'ExtraID')

    Switch $m
        Case 467, 468, 37765, 933, 2511, 934, 442, 5965, 444, 921, 923, 932, 813, 22190, 22191, 27040, 454, 1660, 499, 1578
            Return True
 EndSwitch

Switch $r
   Case $RARITY_Gold ; Gold Items
			Return True
   case $RARITY_Green
			Return True
EndSwitch

Return False

EndFunc ;=> CanPickUp
You can now also add all kind of stuff with a new switch. Either Colors or req8 or so on...

Appreciate the help, but that one also doesn't pick up. It actually errors on that first line when you open it to run (error: cannot assign values to constants). I've tried moving that first bit around to get it to run, but then it doesn't pick up greens (or golds), so assuming it needs to be in the code somewhere, just not in the places I've tried