|
Slugworth83 Newbie
Joined: 08 Nov 2022 Posts: 8
|
Posted: Tue Jul 11, 2023 9:00 pm
Incrementing a Loot Alias |
Appreciate the help provided on previous posts. Pretty new to really using a client and have a lot of catching up to do!
One issue I'm having is after killing a room full of mobs, it's a pain in the butt to examine 1.corpse, get coins 1.corpse, examine 2.corpse, get coins 2.corpse, etc.
I had an auto loot trigger, but it causes a lot of lag in the middle of some pretty big fights when multiple mobs die in a single round, and so I need another solution. I was talking with a buddy, and one idea he had centered around and "auto incrementing get macro" (he built his own client, so isn't much help on cmud).
The idea is that after the fight, i could type "loot" and it would send "examine 1.corpse;get coins 1.corpse". and if i entered loot a second time, it would auto increment to "examine 2.corpse;get coins 2.corpse". And ultimately, when i move rooms (n e w s d u) it would reset to 1.corpse.
I think it's a great solution, but I have no earthly idea where to even start building this out and testing it. Any direction would be appreciated! |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Wed Jul 12, 2023 2:43 am |
That would be easy enough to accomplish.
Code: |
#EVENT onRoomEnter {thisCorpse=0}
#ALIAS loot {
thisCorpse=(@thiscorpse+1)
examine %concat(@thisCorpse, ".corpse")
get coins %concat(@thisCorpse, ".corpse")
} |
This does require the mapper to be able to detect when you move from room to room. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Slugworth83 Newbie
Joined: 08 Nov 2022 Posts: 8
|
Posted: Thu Jul 13, 2023 12:04 am |
shalimar wrote: |
That would be easy enough to accomplish.
Code: |
#EVENT onRoomEnter {thisCorpse=0}
#ALIAS loot {
thisCorpse=(@thiscorpse+1)
examine %concat(@thisCorpse, ".corpse")
get coins %concat(@thisCorpse, ".corpse")
} |
This does require the mapper to be able to detect when you move from room to room. |
Wow, super helpful. I don't currently utilize the mapper... in that case, I'm assuming i could just substitute some trigger on room movement "You follow %w *"? |
|
|
|
chaossdragon Apprentice
Joined: 09 Apr 2008 Posts: 168
|
Posted: Thu Jul 13, 2023 12:37 am |
I'd look for something more like "Obvious exit(s): east, north, etc, etc"
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Thu Jul 13, 2023 12:44 am |
#TR {Obvious exit{s|}:} {thiscorpse=0)
would also work |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Slugworth83 Newbie
Joined: 08 Nov 2022 Posts: 8
|
Posted: Thu Jul 13, 2023 2:12 am |
okay, building on this (if that's alright)....
What if instead of simply executing "get coins", I wanted to reference a String List where i had populated specific items I wanted to loot? For example, the game loads dozens of spell components on random mobs, but I generally only want 5 or 6 that are relevant for my character. So I'd like to create a list called @comps, enter in the 5 or 6 components (in addition to coins), and then only loot if there are those items on @comps.
thisCorpse=(@thiscorpse+1)
examine %concat(@thisCorpse, ".corpse")
#forall @comps {
#IF (xxxxxxxxxxxxxx)
get xxxxx %concat(@thisCorpse, ".corpse")
}
#TR {You Follow *} {thisCorpse=0}
-----------------
I'm not realizing this is merging into my previous post that you answered, and I haven't had a chance to play with yet. I'll give that a shot and see if I can merge the two theories.
Does something like this work? How do you build the IF statement against whatever the output from a particular line is? |
|
|
|
Slugworth83 Newbie
Joined: 08 Nov 2022 Posts: 8
|
Posted: Thu Jul 13, 2023 2:59 am |
Thinking about this some moreā¦ what if I built in a trigger state that activated on examine corpse, and then I just had simple triggers like
#Condition {a pinch of gold dust} {get pinch corpse)
#Condition {a big sword} {get sword corpse)
Ect.
That would only make those triggers active while in the state that would shut off after looting. That should prevent causing issues if I examine my chest, for example, and trying to loot stuff out of there. What do you think? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Thu Jul 13, 2023 3:33 am |
Thee issue here lies in the order of the various components in the corpse.
I would instead just reference %concat(@thisCorpse, ".corpse") in the grabber part of the stated trigger in the other thread.
It is already testing all the contents of the corpse. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
|
|