Welcome, Guest. Please login or register.
Did you miss your activation email?
November 25, 2024, 09:25:57 am *

Login with username, password and session length
Pages: [1]
Print
Author Topic: Combine all resist augs in bags  (Read 4461 times)
Natedog
Master
******
Posts: 830


View Profile
« on: May 19, 2020, 01:43:56 pm »

Make a file called something like... resist_augs.inc and paste this code into it.

Doing it this way allows you to attach this code to any existing macro and can be /call 'ed from any other macro Smiley

I use a commander macro like E3 that I made 100% around my own group that allows me to just send commands like  /nb lootall Paldail

will tell Paldail to loot the corpses and combine any augs he finds if he has multiple of the same type Smiley



Code:
#turbo
|Magic Box required

Sub DoResistAugs
/if (!${Defined[MagicBoxSlot]}) /declare MagicBoxSlot string outer
||Lets open all bags!
/if (!${Defined[bag]}) /declare bag int local 0
/if (!${Defined[packnum]}) /declare packnum int 1

/for packnum 1 to 10
/if (${InvSlot[pack${packnum}].Item.Name.Equal[A Magic Box]}) {
/varset MagicBoxSlot pack${packnum}
}
/next packnum


/if (!${Defined[T]}) /declare T int 1
/if (!${Defined[CurrentID]}) /declare CurrentID int outer
/if (!${Defined[AugmentItemCount]}) /declare AugmentItemCount int outer

/for bag 1 to 10
/if (!${Window[pack${bag}].Open} && ${InvSlot[pack${bag}].Item.Container}) /nomodkey /itemnotify pack${bag} rightmouseup
/next bag

| Stone of Heroic Resistance
| 130501 - 130520

/for packnum 1 to 10
/if (!${Window[pack${packnum}].Open} && ${InvSlot[pack${packnum}].Item.Container}) {
/itemnotify pack${packnum} rightmouseup
/delay 6
}

/if (${Window[pack${packnum}].Open} && ${InvSlot[pack${packnum}].Item.Container}) {
/for T 1 to 10
|See if the name is similar.. and if we have more than 1 of this ITEM
/if (${InvSlot[pack${packnum}].Item.Item[${T}].Name.Find[Stone of Heroic Resistance]}) {
/varset CurrentID ${InvSlot[pack${packnum}].Item.Item[${T}].ID}

|We must skip XX.. as that is the final stage!
/if (${CurrentID} > 130519) {
|/echo Skipping ID.. ${CurrentID} - ${InvSlot[pack${packnum}].Item.Item[${T}].Name}
/goto :dont_upgrade
/echo Item skipped.. if we got here.. something is WRONG
}

/call FindBaggedItems
|Find # of items...
/if (${AugmentItemCount} > 1) {
/itemnotify in pack${packnum} ${T} leftmouseup
/delay 9
/call CombineResistAugs
/call FindNext
}
}
:dont_upgrade
/next T
}
/next packnum

|Close our bags back up...
/for bag 1 to 10
/if (${Window[pack${bag}].Open} && ${InvSlot[pack${bag}].Item.Container}) /nomodkey /itemnotify pack${bag} rightmouseup
/next bag

/return

sub OpenAllBags
/if (!${Defined[bag]}) /declare bag int local 0
|Open our bags up...
/for bag 1 to 10
/if (!${Window[pack${bag}].Open} && ${InvSlot[pack${bag}].Item.Container}) /nomodkey /itemnotify pack${bag} rightmouseup
/next bag
/return

sub CloseAllBags
/if (!${Defined[bag]}) /declare bag int local 0
|Close our bags back up...
/for bag 1 to 10
/if (${Window[pack${bag}].Open} && ${InvSlot[pack${bag}].Item.Container}) /nomodkey /itemnotify pack${bag} rightmouseup
/next bag
/return

sub FindNext
|This is for next Item ID...
/if (!${Defined[P]}) /declare P int 1
/if (!${Defined[packnum2]}) /declare packnum2 int 1
/for packnum2 1 to 10
/if (!${Window[pack${packnum2}].Open} && ${InvSlot[pack${packnum2}].Item.Container}) {
/itemnotify pack${packnum2} rightmouseup
/delay 6
}

/if (${Window[pack${packnum2}].Open} && ${InvSlot[pack${packnum2}].Item.Container}) {
/for P 1 to 10
|See if the name is similar.. and if we have more than 1 of this ITEM
/if (${InvSlot[pack${packnum2}].Item.Item[${P}].Name.Find[Stone of Heroic Resistance]} && ${InvSlot[pack${packnum2}].Item.Item[${P}].ID} == ${CurrentID}) {
/itemnotify in pack${packnum2} ${P} leftmouseup
/delay 9
/call CombineResistAugs
/return
}
/next P
}
/next packnum2

/return

Sub FindBaggedItems
/varset AugmentItemCount 0
/if (!${Defined[P]}) /declare P int 1
/if (!${Defined[packnum3]}) /declare packnum3 int 1
/for packnum3 1 to 10
/if (!${Window[pack${packnum3}].Open} && ${InvSlot[pack${packnum3}].Item.Container}) {
/itemnotify pack${packnum3} rightmouseup
/delay 6
}

/if (${Window[pack${packnum3}].Open} && ${InvSlot[pack${packnum3}].Item.Container}) {
/for P 1 to 10
|See if the name is similar.. and if we have more than 1 of this ITEM
/if (${InvSlot[pack${packnum3}].Item.Item[${P}].Name.Find[Stone of Heroic Resistance]} && ${InvSlot[pack${packnum3}].Item.Item[${P}].ID} == ${CurrentID}) {
/varset AugmentItemCount ${Math.Calc[${AugmentItemCount}+1]}
}
/next P
}
/next packnum3
/return

Sub CombineResistAugs
|Make sure bag is open.. (it should be...)
/if (!${Window[${MagicBoxSlot}].Open} && ${InvSlot[${MagicBoxSlot}].Item.Container}) /nomodkey /itemnotify ${MagicBoxSlot} rightmouseup
/if (!${Defined[slot]}) /declare slot int 0
/varset slot ${Math.Calc[${FindItem[A Magic Box].Items}+1]}
/itemnotify in ${MagicBoxSlot} ${slot} leftmouseup
/delay 15

/if (${slot} == 2) {
/combine ${MagicBoxSlot}
/delay 2s
/autoinventory
/delay 3s
}
/return



Calling it from a macro is very simple too...

I suggest putting the Magic box in the 10th slot so autoinventory doesn't start filling your magic box with junk lol

So with this example... if the file is called.... augs.mac

You just type /macro augs  .... and it will combine anything you have in your inventory till it can't combine anymore Smiley

Code:
#include resist_augs.inc

sub Main
/call DoResistAugs
/return
Logged

gnonim
Jr. Member
**
Posts: 74


View Profile
« Reply #1 on: May 20, 2020, 05:17:44 pm »

got it working, very cool, thanks!
« Last Edit: May 21, 2020, 03:58:27 pm by gnonim » Logged
Rakharth
Full Member
***
Posts: 141


View Profile
« Reply #2 on: September 20, 2020, 08:20:29 am »

Can you make this into its own Macro? either way i can get it to work....
Logged

Pages: [1]
Print
Jump to:  

Recent

Stats

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