Augments with FindItemBankCount

Third party software discussion goes here.
Tristhan
Posts: 293

Augments with FindItemBankCount

Post#1 » Mon Jul 21, 2014 9:04 pm

Hiya,

if i use the command ${FindItemBankCount[ItemName]} to count the items/augments in bank, i get wrong numbers.
It seems the command dont count augments ON items lying in the bank.

Anyone have an idea to resolve that or know any solution to count augments in bank ?
Thank you

User avatar
wormeye
Posts: 27

Re: Augments with FindItemBankCount

Post#2 » Mon Jul 21, 2014 10:34 pm

+++ NOT A MACROQUEST SOLUTION +++
+++ WORKAROUND TO COUNT/LIST ITEMS WITH WINDOWS POWERSHELL +++



Start, Run, type powershell and paste this line into the (ps)-commandprompt (Win7)
Search "Powershell" (Win8)
(I know, Chrom is using Windows 8+ -> Powershell is installed on Windows 8/8.1).

1. How many "A Fabulous Stone" id=120744 has Chrom in his inventory/bank/aug'ed in items (= AC100-Aug from HoH)

Code: Select all

(Invoke-WebRequest -Uri http://www.thehiddenforest.org/webtools/magelo/character.php?char=Chrom).Links.href  | select-string 120744

OUTPUT:
http://www.thehiddenforest.org/webtools/items.php?id=120744
http://www.thehiddenforest.org/webtools/items.php?id=120744
http://www.thehiddenforest.org/webtools/items.php?id=120744
http://www.thehiddenforest.org/webtools/items.php?id=120744
http://www.thehiddenforest.org/webtools/items.php?id=120744
http://www.thehiddenforest.org/webtools/items.php?id=120744


Code: Select all

(Invoke-WebRequest -Uri http://www.thehiddenforest.org/webtools/magelo/character.php?char=Chrom).Links.href  | select-string 120744 | measure

Count    : 6
Average  :
Sum      :
Maximum  :
Minimum  :
Property :


-> He has 6 AC100-Augs.



2. Which AC50/55-Augs has Chrom ?
Item-ids:
Aviaks=120148,120149,120150
Kodiak=121483,121484,121485
Sharks=121508,121509,121510

Code: Select all

(Invoke-WebRequest -Uri http://www.thehiddenforest.org/webtools/magelo/character.php?char=Chrom).Links.href  | select-string -pattern 120149,120150,120151,121483,121484,121485,121508,121509,121510 | sort

OUTPUT:
http://www.thehiddenforest.org/webtools/items.php?id=120149
http://www.thehiddenforest.org/webtools/items.php?id=120150
http://www.thehiddenforest.org/webtools/items.php?id=121483
http://www.thehiddenforest.org/webtools/items.php?id=121484
http://www.thehiddenforest.org/webtools/items.php?id=121485
http://www.thehiddenforest.org/webtools/items.php?id=121508
http://www.thehiddenforest.org/webtools/items.php?id=121509
http://www.thehiddenforest.org/webtools/items.php?id=121510


-> He got all.

And Sinaette ?

Code: Select all

(Invoke-WebRequest -Uri http://www.thehiddenforest.org/webtools/magelo/character.php?char=Sianette).Links.href  | select-string -pattern 120149,120150,120151,121483,121484,121485,121508,121509,121510 | sort

OUTPUT:
http://www.thehiddenforest.org/webtools/items.php?id=120149
http://www.thehiddenforest.org/webtools/items.php?id=120150
http://www.thehiddenforest.org/webtools/items.php?id=121483
http://www.thehiddenforest.org/webtools/items.php?id=121485
http://www.thehiddenforest.org/webtools/items.php?id=121508


-> only 5 ! (Slackness...)


For a better performance with multiple selects, you can save the result of the web-request in a variable.

Load the webrequest into Variable $toon:

Code: Select all

$toon = Invoke-WebRequest -Uri http://www.thehiddenforest.org/webtools/magelo/character.php?char=Chrom


And use the variable to search for item-ids:

$toon.Links
$toon.Links.href
$toon.Links.href | select-string 120744
$toon.Links.href | select-string 121000



Scripting-Experts can fill an excel-spreadsheet for each character and check which important augs/items an alt is missing.


--
Nemen

User avatar
Sian
Posts: 1369

Re: Augments with FindItemBankCount

Post#3 » Mon Jul 21, 2014 11:53 pm

So many lies ! I got more than 5 !!!... Ok I got 5 only....*cries*
Too many things to do, so little time to do them ! Thing is that not only do I need to camp them, but I then have to augment my stuff, which is a pain when there are 11 other toons to do !!

Noren
Posts: 1053

Re: Augments with FindItemBankCount

Post#4 » Tue Jul 22, 2014 5:05 am

First of all, Nemen: that's really cool.

Secondly, I've never dabbled with MQ2 source code until this post. I just poked my head around with the idea that the FindItemBankCount function is not scanning deeper than the name of the item within a bag slot of the bank and I've just dipped my toes into it. In case someone else wants to pursue this with me, I've found something promising within MQ2Main/MQ2Data.cpp line #1048.

Lastly, if anyone is curious of a new way to use this Top Level Object to manage their player(s) on THF, then you may certainly try my way:

This handles item links for the Underfoot client. It, for sure, will not work with Titanium. It is a chat event that responds to "who has <item link>" and "nolink who has <item name>". Feel free to modify/use it to meet your needs.

Code: Select all

#Event WhoHas "#1# #*#'who has #2#"
#Event WhoIsMissing "#1# #*#'who is missing #2#"

#Event NoLinkWhoHas "#1# #*#'nolink who has #2#"
#Event NoLinkWhoIsMissing "#1# #*#'nolink who is missing #2#"

Sub Event_WhoHas
  /declare CleanedLink string local ${Param2.Right[-51].Left[-2]}
  /if (${FindItemCount[${CleanedLink}]}>0 || ${FindItemBankCount[${CleanedLink}]}>0) {
    /echo [${Time.Time24}] I have ${Param2.Left[-1]}. ${FindItemCount[${CleanedLink}]} on me. ${FindItemBankCount[${CleanedLink}]} in the bank.
    /bc I have ${Param2.Left[-1]}. ${FindItemCount[${CleanedLink}]} on me. ${FindItemBankCount[${CleanedLink}]} in the bank.
  } else {
    /echo [${Time.Time24}] Missing ${CleanedLink}.
  }
/return

Sub Event_WhoIsMissing
  /declare CleanedLink string local ${Param2.Right[-51].Left[-2]}
  /if (${FindItemCount[${CleanedLink}]}==0 && ${FindItemBankCount[${CleanedLink}]}==0) {
    /echo [${Time.Time24}] I have ${Param2.Left[-1]}. ${FindItemCount[${CleanedLink}]} on me. ${FindItemBankCount[${CleanedLink}]} in the bank.
    /bc I am missing ${Param2.Left[-1]}
  }
/return

Sub Event_NoLinkWhoHas
  /declare CleanedName string local ${Param2.Left[-1]}
  /if (${FindItemCount[${CleanedName}]}>0 || ${FindItemBankCount[${CleanedName}]}>0) {
    /echo [${Time.Time24}] I have ${CleanedName}. ${FindItemCount[${CleanedName}]} on me. ${FindItemBankCount[${CleanedName}]} in the bank.
    /bc I have ${CleanedName}. ${FindItemCount[${CleanedName}]} on me. ${FindItemBankCount[${CleanedName}]} in the bank.
  } else { /echo [${Time.Time24}] Missing ${CleanedName}.
  }
/return

Sub Event_NoLinkWhoIsMissing
  /declare CleanedName string local ${Param2.Left[-1]}
  /if (${FindItemCount[${CleanedName}]}==0 && ${FindItemBankCount[${CleanedName}]}==0) {
    /echo [${Time.Time24}] I have ${CleanedName}. ${FindItemCount[${CleanedName}]} on me. ${FindItemBankCount[${CleanedName}]} in the bank.
    /bc I am missing ${CleanedName}
  }
/return

peterigz
Posts: 594

Re: Augments with FindItemBankCount

Post#5 » Thu Jul 24, 2014 11:48 pm

Here's another way still, this will tell you how many it finds in the bank, and how many it finds that are auged in the bank. This is on Underfoot with 24 bank slots and 2 shared bank slots, but it might just work anyway on titanium.

Code: Select all

sub Main(string Aug)
   /declare i int local
   /declare c int local
   /declare a int local
   /declare count int local 0
   /declare augedcount int local
   
   /echo Searching... please wait :)
   
   /for i 1 to 26
      /if (${Me.Bank[${i}].Name.Equal[${Aug}]}) /varcalc count + 1
      /if (${Me.Bank[${i}].Container}) {
         
         /for c 1 to ${Me.Bank[${i}].Container}
            /if (${Me.Bank[${i}].Item[${c}].Name.Equal[${Aug}]}) /varcalc count + 1

            /for a 1 to 5
               /if (${Me.Bank[${i}].Item[${c}].AugSlot${a}}) {
                  /if (${Me.Bank[${i}].Item[${c}].Item[${a}].Name.Equal[${Aug}]}) /varcalc augedcount + 1
               }
            /next a
         /next c
      } else {
         /for a 1 to 5
            /if (${Me.Bank[${i}].AugSlot${a}}) {
               /if (${Me.Bank[${i}].Item[${a}].Name.Equal[${Aug}]}) /varcalc augedcount + 1
            }
         /next a
      }
   /next i
   
   /echo ${count} in bank, ${augedcount} auged in bank
/return


Usage: /mac findaugs "Aug Name"

Bear in mind it's case sensitive, and it does take a couple of seconds to run.

Tristhan
Posts: 293

Re: Augments with FindItemBankCount

Post#6 » Fri Jul 25, 2014 9:58 am

Thank you for all the feedback.

I will test/play a bit with the macros.


@wormeye: Das ist echt zu hoch fĂĽr mich :roll: trotzdem danke ...

Return to “Third party software”

Who is online

Users browsing this forum: No registered users and 1 guest