Welcome, Guest. Please login or register.
Did you miss your activation email?
November 28, 2024, 10:12:58 pm *

Login with username, password and session length
Pages: 1 2 [3] 4 5 6 7 8
Print
Author Topic: Loot Macro  (Read 57408 times)
Dimur
Hero Member
Hero Member
*****
Posts: 699


View Profile
« Reply #30 on: March 29, 2020, 11:30:15 pm »

Hey Dimur, do you know if there would be a way to reliably randomize where in the corpse id list they start looting from? For example - on a halloween Zone pull, there is what 460ish? corpses, and if you run the macro on a group of toons they'll all start from the same corpse, or very close to the same corpse and run into each other a lot, i've tried spreading them out around the pile before running it but they never really make it through the whole pile because they keep bumping. if they could some how randomly start part way through the list instead of all at 0 it'd really get through the body piles faster Smiley

Excellent question, I know mq2 does have access to random with the math datatype.  Just spitballing here, but without boring people with the details on how to do it,  it should be pretty easy to set up an extra step once your corpselist is compiled to randomize it.  Added this to the to do list

1. Add relay loot logic
2. Randomize corpse list order
3. Add an echo command, use this command to check the value of the item on your cursor.  All this does is read the name of the item on your cursor and check your ini file to see if there is a listing and setting for this item, if so it reads it back to you.  Someone asked for this to be added so they don't have to open ini file to check values of an item they weren't sure was in their ini

« Last Edit: March 30, 2020, 10:29:08 pm by Dimur » Logged
Knorgar
Newbie
*
Posts: 11


View Profile
« Reply #31 on: March 30, 2020, 01:31:50 pm »

Random will still result in the same issue.

You need to create a list of all corpses in range, put them in an array, and then divide that array of corpse IDs by however many toons are looting. Then you can have each toon loot through their division of the array.
Logged
Dimur
Hero Member
Hero Member
*****
Posts: 699


View Profile
« Reply #32 on: March 30, 2020, 10:24:29 pm »

I don't understand why randomizing the list would not work, is Math.Rand broken in mq2?  Without devoting any time to this other than jumping on long enough to zonepull ToFS to produce enough corpses to test randomizing a compiled corpse list, I haven't had much time to mess with it, but initial results of randomizing a list of corpse id's with 250 corpse ID numbers seems to return random results consistently.

I'm also not sure what the point would be in changing the datatype from a string to array?  Is there a benefit to making an array and iterating through that as opposed to just iterating through the string?  At the very least, if you don't want to use random, you can easily split a string into 4 segments of the string based on the size of the count of the delimiter between corpse ID values and do the same thing.  I hope this isn't dismissive at all, I love that someone is offering feedback, I am just trying to qualify the feedback and see if it might be a better approach than I had considered.
« Last Edit: March 30, 2020, 10:34:54 pm by Dimur » Logged
Dimur
Hero Member
Hero Member
*****
Posts: 699


View Profile
« Reply #33 on: March 30, 2020, 11:45:40 pm »

Updated the EZLoot.inc file

1. Updated to add a command to check the value of a cursor item and see if it is in the EZLoot.ini file for the character issuing the command, if so it will read the value you have it set to in the ini
2. Updated to add a setting to randomize the loot list, the setting is named Randomize Loot List.  The default setting will remain Off but you can edit this setting one of 2 ways
    A. You can manually edit the ini file and change the Off setting to On. Open your MQ2 directory and navigate to the Macros folder, find the file named EZLoot_CharacterNameThatYouWant.ini and open it in a text editor.  Look under [Settings] and change the value for Randomize Loot List from =Off to =On
    B. You can use the build in command to update from in game, /echo ezloot settings Randomize Loot List setto On!    <-- You need to put the ! at the end, the macro expects this to update from in game

Anyone that wants to beta test it, I'd suggest backing up your existing EZLoot.inc file somewhere so if this updated version doesn't work the way you want it, you can just delete it and drop your backup back in
Logged
Knorgar
Newbie
*
Posts: 11


View Profile
« Reply #34 on: March 31, 2020, 12:17:19 am »

No, random works as well as it does on any computer.

If all toons are working off a random sorting of the same list, they are going to have duplicates and try to loot a corpse ID that is gone and also have the chance of trying to loot the same ID at the same time. Chances will diminish the more corpses you have.

Creating an array allows you to divvy up the list of all corpse IDs to each toon without two toons being assigned to loot the same corpse. The array makes it easy to give each toon the ability to cycle through their portion of the array.

As for how to divvy up the list, I believe an array would be the cleanest/easiest method. If you've got another method you think is better to divvy up, by all means.

Not at all! Love the conversation.
Logged
Dimur
Hero Member
Hero Member
*****
Posts: 699


View Profile
« Reply #35 on: March 31, 2020, 12:40:30 am »

The string already exists as a character array, in mq2 I have found an array and string to share the same limitations of 2054?ish characters total. The string .Arg works the same way as elements in an array, just wondering if I am missing a benefit to adding an additional cast.

The random assignment should work better than default since we are dealing with corpse piles of 250+ corpses, it's an optional toggle defaulted to off so people would have to enable it to use it, but for those particular scenarios like Halloween zone it should have relevant merit.
Logged
Knorgar
Newbie
*
Posts: 11


View Profile
« Reply #36 on: March 31, 2020, 01:20:30 am »

Ah I see. You're creating a string array with the "-" separator. Nope, as long as you have an array and know the number of entries, you've achieved the same thing! Just a different array method Smiley.

Random will definitely work better than default, but the optimal will still be to divvy up the array you created based on the number of toons looting.

So you've got the number of corpses from ${SpawnCount[corpse radius ${LootRadius}]}, you'd need a new value for how many toons are doing the looting, say call it ${numLooting}.

Divide the num corpses by ${numLooting}, and then assign each toon to cycle through the array starting at the low+1 and ending at high.

For examples sake, 60 corpses and 6 toons looting. Array all the corpses, then divide by the numLooting of 6 = 10, assign a grouping to each toon. Toon 1 loots 0+1-10, Toon 2 loots 10+1-20 etc.

It's the optimal way, but definitely a lot more work on coding than randomizing.
Logged
Fecs
Jr. Member
**
Posts: 81


View Profile
« Reply #37 on: March 31, 2020, 01:21:41 am »

Updated the EZLoot.inc file

1. Updated to add a command to check the value of a cursor item and see if it is in the EZLoot.ini file for the character issuing the command, if so it will read the value you have it set to in the ini
2. Updated to add a setting to randomize the loot list, the setting is named Randomize Loot List.  The default setting will remain Off but you can edit this setting one of 2 ways
    A. You can manually edit the ini file and change the Off setting to On. Open your MQ2 directory and navigate to the Macros folder, find the file named EZLoot_CharacterNameThatYouWant.ini and open it in a text editor.  Look under [Settings] and change the value for Randomize Loot List from =Off to =On
    B. You can use the build in command to update from in game, /echo ezloot settings Randomize Loot List setto On!    <-- You need to put the ! at the end, the macro expects this to update from in game

Anyone that wants to beta test it, I'd suggest backing up your existing EZLoot.inc file somewhere so if this updated version doesn't work the way you want it, you can just delete it and drop your backup back in

Excited to try, off the bat when I use the " /echo ezloot settings Randomize Loot List setto On! " is just gives error pause needs a value between 1 and 10, but the setting did appear in the characters options so i'll manually change it to check, but other than that it sounds perfect - and personally, i'd prefer random rather than array.
Logged
Fecs
Jr. Member
**
Posts: 81


View Profile
« Reply #38 on: March 31, 2020, 01:40:58 am »

When I ran ezloot with the new ezloot file, after updating all characters to randomize loot list, they all got stuck on a single corpse and none moved past it.
Logged
Dimur
Hero Member
Hero Member
*****
Posts: 699


View Profile
« Reply #39 on: March 31, 2020, 12:12:45 pm »

I'll hop on tonight to look at it Fecs, hoping I can add the relay loot logic as well.
Logged
Dimur
Hero Member
Hero Member
*****
Posts: 699


View Profile
« Reply #40 on: March 31, 2020, 05:49:51 pm »

Ah I see. You're creating a string array with the "-" separator. Nope, as long as you have an array and know the number of entries, you've achieved the same thing! Just a different array method Smiley.

Random will definitely work better than default, but the optimal will still be to divvy up the array you created based on the number of toons looting.

So you've got the number of corpses from ${SpawnCount[corpse radius ${LootRadius}]}, you'd need a new value for how many toons are doing the looting, say call it ${numLooting}.

Divide the num corpses by ${numLooting}, and then assign each toon to cycle through the array starting at the low+1 and ending at high.

For examples sake, 60 corpses and 6 toons looting. Array all the corpses, then divide by the numLooting of 6 = 10, assign a grouping to each toon. Toon 1 loots 0+1-10, Toon 2 loots 10+1-20 etc.

It's the optimal way, but definitely a lot more work on coding than randomizing.

I beg to differ that totaling a string count up, separating the string into X number of values based off of the number of looters and assigning each character a unique list to loot is going to be quantifiably more efficient in looting with multiple toons.  I guess if you had 6 toons looting a pile of 60 corpses you could assign 10 to each, but the specific instance the randomization is dealing with is a zone that leaves 452-462 npc corpses to loot that before they decay.  You would have to tell the loot macro how many looters are looting so it could divide the string into equal(+1) sizes and feed those 6 new strings to each toon who will do the looting.  If we have overlap on corpses, it's not that big of a deal because mostly what the looters are doing is checking corpses for tradeable items...they can loot any quest coins they come across but we're more concerned with checking for essences/sls than we are equally distributing the loot across toon.
Logged
Knorgar
Newbie
*
Posts: 11


View Profile
« Reply #41 on: March 31, 2020, 06:17:12 pm »

I totally agree, given the number of corpses randomization is certainly good enough. Divvying up will still be "optimal" but the gains probably aren't worth the effort.
Logged
Fecs
Jr. Member
**
Posts: 81


View Profile
« Reply #42 on: April 01, 2020, 02:28:40 am »

I'll hop on tonight to look at it Fecs, hoping I can add the relay loot logic as well.

It works now, nothing changed, thanks computers, I guess the full computer just wanted a longer break before it'd work right haha
Logged
Chieftan
Hero Member
Sr. Member
*****
Posts: 262



View Profile
« Reply #43 on: April 02, 2020, 01:49:50 am »

Hi

Awsome work on this, been using a lot and works very well -) - Just a couple things i have noticed
Now and again i get an error saying
unable to parse command /fix  - assume this is an alias for #corpsefix or similar - not much, but seen on occasion

The other one i see a fair amount, screen grab attached, seems to target corpse but not in range so cant loot but dosen't move closer, can get quite a few in a row, manually moving char gets him looting again
He does run around a lot to loot, so maybe just a range to target issue

No other probs i have come accross
Nothing major and perfectly usable as is, thanks for all the hard work put in to this
Logged

Dimur
Hero Member
Hero Member
*****
Posts: 699


View Profile
« Reply #44 on: April 04, 2020, 05:06:01 pm »

Flattery will get you everywhere Chieftan, thanks for the kind words.  Yes indeed, I have an alias set for /fix, it executes the /say #corpsefix command and I thought I had the macro write it for you.  There's really no benefit to using it in the macro over just typing out the command so I'll do a search and replace for /fix and use the native command.  The out of range thing I can look into as well if it's an annoyance, I just wanted to push the remote loot logic for now.

New feature update, added a new file and will have a share link with the other 2 files on the first post of this forum.  This new file adds logic for when you loot macro finds and item marked as Announce.  In the case that your macro finds an item marked announce, it will still announce it in raid (or whatever channel you saved it to in settings), but it will also check another INI file for a designated looter. 

To illustrate this a bit, in T10 there are HP augs that randomly drop that allow you to combine them with previous ranks of said aug up to rank 10.  It's not bad when you're looting with the ezmac logic and have it set to loot, it'll just loot to the character's inventory.  But if you no longer need to loot those items and some alt character does, you can designate that character as the looter for the item.  There will be a separate INI file that the loot logic can check when it's an item flagged as announce and if the item is listed in there with a designated looter, the designated looter is sent a tell and targets the corpse that the item is on, moves to loot it, opens up the corpse and checks for the item and loots it.  The INI file will be editable from in game or you can open it up to do manual edits, items will be alphabetized and associated with the designated looter. 

The INI file will also just be a single INI file, all characters will access the same one so if Toon4 is designated to loot a blue diamond, Toon 1, Toon 2 and Toon 3 have their blue diamond set to Announce, when any of them find a blue diamond, they'll send the loot command to Toon 4. 

The EZRLoot.inc file is completely optional and won't interfere in any way with the current loot logic, it's just an added feature that further improves QOL.  Download it and put it in the Macros folder of you MQ2 directory just like the EZMac.mac file and EZLoot.inc file.  Back up the existing ones just in case, this is a constant beta test after all, but I'd suggest grabbing all 3 files because the previous 2 have been modified to add the new features.
Logged
Pages: 1 2 [3] 4 5 6 7 8
Print
Jump to:  

Recent

Stats

Members
  • Total Members: 6156
  • Latest: Rin1
Stats
  • Total Posts: 65127
  • Total Topics: 5066
  • Online Today: 333
  • Online Ever: 8678
  • (December 19, 2022, 02:32:09 pm)
Users Online
Users: 1
Guests: 253
Total: 254
TinyPortal v1.0 beta 4 © Bloc