Complete noob coder attempting to code interchangeable Nick bot

03/16/2023 00:10 dboston#1
Hi there

I wanted to create a skeleton-like bot that had the basic structure of a bot, but each week could be changed very easily to farm the new Nick item (just change IDs of outpost/area/items/route taken). This would be done with heroes so not extremely efficient, but would be easy and would work.

I've tried adjusting code around from bots I've seen in the Nick thread and have got the bot posted here (currently, for Truffles in Melandru's Hope outside Brauer Academy).

The bot has 2 main problems which stops it from doing it's job:
1)The bot doesn't pick up Truffles
I've got the Model ID of truffles but no idea where I put this in, nor can I find anywhere within the documents where another model ID is written, or any pickup function in the main bot, so quite stumped on this one. I would eventually like to input all event items and greens too

2)The bot will fail to recognise it's in an outpost after resigning after 1 run:
So it will do 1 run, resign, go back to outpost, but then immediately start "hunting" again when it's function should be to leave the outpost.

Appreciate these are really noob questions, however I have 0 experience in this so just looking for some help

Thanks

EDIT:

These are working bots so far:
03/16/2023 03:55 ForgottenRelic#2
I will work on this tonight and see what all i can do. Shouldn't be too many changes
03/18/2023 18:41 panda231#3
The model ID was forgotten to be entered under CanPickUp.
ElseIf $m = 813 Then
Return True ;Truffle

For your MapLoading problem simply query the instance type.
Do
RndSleep(100)
Until GetMapLoading() == $INSTANCETYPE_EXPLORABLE Or TimerDiff($TimerLoad) > 20000

For your resign set after MapLoading($Outpost)
Do
RndSleep(100)
Until GetMapLoading() == $INSTANCETYPE_OUTPOST Or TimerDiff($TimerLoad) > 20000
RndSleep(2000)

Maybe this will help you
03/18/2023 23:45 dboston#4
Hey - thanks a lot for your help.

I have got it picking up Truffles (and anything else I can find the ID of!) so that's great, thanks very much.

I've tried the resigning function you wrote and I'm getting the "variable used without being declared error". Am I correct in thinking that the variable is "$INSTANCETYPE_OUTPOST"?
Is this something that is done at the start of the code, or in one of the other files?
03/19/2023 20:33 panda231#5
Edit - Global $TimerLoad - into your Truffle.au3

Put this into your AddOn.au3
Global Enum $INSTANCETYPE_OUTPOST, $INSTANCETYPE_EXPLORABLE, $INSTANCETYPE_LOADING

If you go through a gate use Move instead of Moveto

Change your While Part
SwitchMode(0) ;Normal Mode

; FastWayOut()
GoOut()
While (CountSlots() > 4)
$NumberRun = $NumberRun +1
VQ()
WEnd

_PurgeHook()
clearmemory()
into

SwitchMode(0) ;Normal Mode
VQ()
$NumberRun = $NumberRun +1
_PurgeHook()
clearmemory()

Than it should work
03/19/2023 23:59 dboston#6
Hi again, I appreciate your help on this, and have worked through your suggestions. However I think there's something missing still from preventing it working correctly.

On the issue of not recognising the outpost and going "hunting" immediately after resigning instead of "going out" of the outpost first; I implemented the change you highlighted in red and orange and with these in effect, the bot won't even leave the outpost for 1 run before erroring, it will never leave the outpost as it goes "hunting" straight away.

I've had a play around myself but still stumped - could it be something to do with:
If $NumberRun = 0 Then ;first run
and then a little bit later
SwitchMode(0) ;Normal Mode
;FastWayOut()
GoOut()
While (CountSlots() > 4)
$NumberRun = $NumberRun +1

My thought was that it was only applying the "GoOut" function on the bot's first run, whereas we want it to "GoOut" on returning to the outpost for the second run, and the third run, and the fourth run etc.

I've uploaded the current version with the changes in if you wanted to have a look - thanks again!
03/20/2023 23:01 panda231#7
try this one

not sexy but should work
03/21/2023 23:40 dboston#8
That's working! Not pretty, or efficient, but definitely working.

Thanks very much for your help on this!
03/22/2023 14:15 dboston#9
For anyone curious, here is a really messy updated version of panda231's work that will farm the current Nick item, Skelk Claws.
03/27/2023 14:45 dboston#10
Here's one for Dessicated Hydra claws.

If anyone is interested in making this work further I'd be keen to work on it, would like to be able to farm specific greens (what's the green pickup function?) would look at Urgoz/Deep but believe theres some interaction to do there (flagging heroes, opening chests) dungeons, UW/FoW too. Would also like to run through some missions too but again, not super sure how to get it to interact with NPCs or deal with cutscenes etc.
03/30/2023 10:42 Corey 1991#11
I am sending a bump.
03/30/2023 20:16 corey54321#12
maybe we could post the finished scripts in the old nick thread [Only registered and activated users can see links. Click Here To Register...] most of those work might need gwa2 update and few fixes
04/04/2023 17:13 Fracman#13
Does anyone know the ID number for Frigid Hearts? Can't seem to find that one anywhere.
04/06/2023 07:54 joeko#14
ModelID: 494
04/06/2023 13:22 dboston#15
Frigid Hearts bot

This one is extremely messy, but as always, works