Page 4 of 5

Posted: Sat Sep 23, 2006 9:33 pm
by Infinite monkeys
same results JJ. casts then just leaves things where they are with out putting them back.

Posted: Sat Sep 23, 2006 9:54 pm
by Infinite monkeys
This is what i get when I use it to cast my DS clicky. BTW im typing this out cause im bored and raiding =)

Code: Select all

[color=red]Unparsable in Calculation: 'B'[/color]
swapcast.mac@67 (CastItem(Slot)): /delay 3s ${Me.Casting}
swapcast.mac@53 (SwapCast(item,equipslot)): /call CastItem ${equipslot}
swapcast.mac@2 (Main(p0,p1)): /call SwapCast "${p0}" "{p1}"
The current macro has ended.
[color=red]Failed to parse /delay condition 'Bramblecoat'. non-numeric encountered[/color]

Posted: Sat Sep 23, 2006 10:00 pm
by JimJohnson
Suppose to be

Code: Select all

/delay 3s ${Me.Casting.ID}
Is it leaving the item you cast in the slot? or picking it back up, just not putting it back into your bag?

Posted: Sat Sep 23, 2006 10:03 pm
by Infinite monkeys
Leaving it in the slot

Posted: Sat Sep 23, 2006 10:05 pm
by Infinite monkeys
Ok that worked. the only thing i changed was the Wait. to 1s which should be long enough to notify server.

Thanks JJ your the man.

Code: Select all

Sub Main(p0,p1) 
   /call SwapCast "${p0}" "${p1}" 
/endmacro 

Sub SwapCast(item,equipslot) 
   /declare inventoryslot int local 
   /declare pack local 
   /declare packslot int local 
   /declare leaveopen int local 1 
   /declare packnumber int local 0 
   /declare leavetwisting int local 0 

   /if (!${Defined[item]}) /goto :end 
   /if (${Twist}) { 
      /twist stop 
      /varset leavetwisting 1 
   } 
   :stopsingingdelay 
   /if (${Me.Casting.ID}>0) { 
      /stopsong 
      /goto :stopsingingdelay 
      } 
   /varset inventoryslot ${FindItem[${item}].InvSlot} 
   /if (!${inventoryslot}) /goto :notfound 
   :packcountloop 
   /if (${inventoryslot}>250 && ${inventoryslot}<331) { 
      /varset packnumber ${Math.Calc[${packnumber}+1]} 
      /varset inventoryslot ${Math.Calc[${inventoryslot}-10]} 
      /goto :packcountloop 
      } 
   /if (${packnumber} > 0) { 
      /varset pack pack${packnumber} 
      /varset packslot ${Math.Calc[${inventoryslot}-240]} 
      /goto :foundit 
      } 
   :notinpack 
      /call CastItem ${inventoryslot} 
      /goto :end 
   :foundit 
      /if (!${Window[${pack}].Open}) { 
         /nomod /itemnotify ${pack} rightmouseup 
         /varset leaveopen 0 
         } 
      /call WaitCursor ${packslot} ${pack} 
      /if (${equipslot.Find[null]}) { 
         /if (${Cursor.WornSlots}>0) { 
            /varset equipslot ${Cursor.WornSlot[1]} 
         } else { 
               /varset equipslot pack1 
         } 
      } 
      /call WaitCursor ${equipslot} 
      /call CastItem ${equipslot} 
      /call WaitCursor ${equipslot} 
      /call WaitCursor ${packslot} ${pack} 
      /if (${leaveopen} == 0) /nomod /itemnotify ${pack} rightmouseup 
      /goto :end 
   :notfound 
      /echo ${item} not found in inventory. 
   :end 
   /if (${leavetwisting} == 1) /twist start 
/return 

Sub CastItem(slot) 
   /nomod /itemnotify ${slot} rightmouseup 
  /echo Waiting 3seconds for server or untill I start to cast 
  /delay 1s ${Me.Casting.ID}
   /echo Swapcast::Casting the effect on your ${InvSlot[${slot}].Item.Name} 
   :castloop 
|| special case composer greaves don't ever stop casting 
      /if (${InvSlot[${slot}].Item.Name.Find["Composers Greaves"]}) { 
         /delay 12 
         /stopsong 
      } 
|| special cases for epics and other items that don't seem to cast proper with default cast times 
       /if (${InvSlot[${slot}].Item.Name.Find["Blade of Vesagran"]}) { 
         /delay 10 
         /stopsong 
      } 
      /if (${InvSlot[${slot}].Item.Name.Find["Prismatic Dragon Blade"]}) { 
         /delay 10 
         /stopsong 
      } 
      /if (${Me.Casting.ID}) /goto :castloop 
/return 

Sub WaitCursor(slot, pack) 
   /declare item local 
   /declare timeout timer 30 
   /varset item ${Cursor.ID} 
   /if (${Defined[pack]}) /goto :waitloop2 
   :waitloop1 
      /nomod /itemnotify ${slot} leftmouseup 
   /if ((${item} == ${Cursor.ID}) && (${timeout} > 0)) /goto :waitloop1 
   /goto :donewaiting 
   :waitloop2 
      /nomod /itemnotify in ${pack} ${slot} leftmouseup 
   /if ((${item} == ${Cursor.ID}) && (${timeout} > 0)) /goto :waitloop2 
   :donewaiting 
/return

Posted: Sat Sep 23, 2006 10:10 pm
by JimJohnson
If you ever have server lag 1 second wont always be enough, putting at at 3 will wait MAX of 3 seconds, but once you start to cast it will move on and stop the delay.

basicaly its /delay 3s OR Until ${Me.Casting.ID}

3 seconds wont ever get meet unless your in a high lag zone or your isp almost drops you what not. its your call tho

Posted: Wed Jan 17, 2007 10:02 pm
by Infinite monkeys
blah broke again for me. now it doesnt seem to find items =)

was there or is there a change in the structs for item?

or actually would it be inventory.

The only time it would fire is if it were in a slot (if it must be equiped)

Im lost =)

Posted: Thu Jan 18, 2007 7:44 am
by jimbo123
Yeah, FindItemCount will not count items in bags either. It seems to be related.

--jimbo

Posted: Sat Feb 17, 2007 10:11 am
by sedyei
fixed my macro for this latest expansion (buried sea)

be aware that this does necessarily not include any customizations or other patches in this thread... i've only fixed it to work with the latest bagslot changes.

Code: Select all

Sub Main(p0,p1) 
   /call SwapCast "${p0}" "${p1}" 
/endmacro 

Sub SwapCast(item,equipslot) 
   /declare inventoryslot int local 
   /declare pack local 
   /declare packslot int local 
   /declare leaveopen int local 1 
   /declare packnumber int local 0 
   /declare leavetwisting int local 0 

   /if (!${Defined[item]}) /goto :end 
   /if (${Twist}) { 
      /twist stop 
      /varset leavetwisting 1 
   } 
   :stopsingingdelay 
   /if (${Me.Casting.ID}>0) { 
      /stopsong 
      /goto :stopsingingdelay 
      } 
   /varset inventoryslot ${FindItem[${item}].InvSlot} 
   /if (!${inventoryslot}) /goto :notfound 
   :packcountloop 
   /if (${inventoryslot}>261 && ${inventoryslot}<342) { 
      /varset packnumber ${Math.Calc[${packnumber}+1]} 
      /varset inventoryslot ${Math.Calc[${inventoryslot}-10]} 
      /goto :packcountloop 
      } 
   /if (${packnumber} > 0) { 
      /varset pack pack${packnumber} 
      /varset packslot ${Math.Calc[${inventoryslot}-251]} 
      /goto :foundit 
      } 
   :notinpack 
      /call CastItem ${inventoryslot} 
      /goto :end 
   :foundit 
      /if (!${Window[${pack}].Open}) { 
         /nomod /itemnotify ${pack} rightmouseup 
         /varset leaveopen 0 
         } 
      /call WaitCursor ${packslot} ${pack} 
      /if (${equipslot.Find[null]}) { 
         /if (${Cursor.WornSlots}>0) { 
            /varset equipslot ${Cursor.WornSlot[1]} 
         } else { 
               /varset equipslot pack1 
         } 
      } 
      /call WaitCursor ${equipslot} 
      /call CastItem ${equipslot} 
      /call WaitCursor ${equipslot} 
      /call WaitCursor ${packslot} ${pack} 
      /if (${leaveopen} == 0) /nomod /itemnotify ${pack} rightmouseup 
      /goto :end 
   :notfound 
      /echo ${item} not found in inventory. 
   :end 
   /if (${leavetwisting} == 1) /twist start 
/return 

Sub CastItem(slot) 
   /nomod /itemnotify ${slot} rightmouseup 
  /echo Waiting 3seconds for server or untill I start to cast 
  /delay 1s ${Me.Casting.ID} 
   /echo Swapcast::Casting the effect on your ${InvSlot[${slot}].Item.Name} 
   :castloop 
|| special case composer greaves don't ever stop casting 
      /if (${InvSlot[${slot}].Item.Name.Find["Composers Greaves"]}) { 
         /delay 12 
         /stopsong 
      } 
|| special cases for epics and other items that don't seem to cast proper with default cast times 
       /if (${InvSlot[${slot}].Item.Name.Find["Blade of Vesagran"]}) { 
         /delay 10 
         /stopsong 
      } 
      /if (${InvSlot[${slot}].Item.Name.Find["Prismatic Dragon Blade"]}) { 
         /delay 10 
         /stopsong 
      } 
      /if (${Me.Casting.ID}) /goto :castloop 
/return 

Sub WaitCursor(slot, pack) 
   /declare item local 
   /declare timeout timer 30 
   /varset item ${Cursor.ID} 
   /if (${Defined[pack]}) /goto :waitloop2 
   :waitloop1 
      /nomod /itemnotify ${slot} leftmouseup 
   /if ((${item} == ${Cursor.ID}) && (${timeout} > 0)) /goto :waitloop1 
   /goto :donewaiting 
   :waitloop2 
      /nomod /itemnotify in ${pack} ${slot} leftmouseup 
   /if ((${item} == ${Cursor.ID}) && (${timeout} > 0)) /goto :waitloop2 
   :donewaiting 
/return

Posted: Tue Feb 20, 2007 8:16 pm
by Winterskulk
i tested your mac and not wortk for me ;

Posted: Sat Oct 06, 2007 3:34 am
by DEDruid
Changed the 'item' variable to 'loot' to make this macro work with the 'item' variable changes. This works with the 2007/10/6 zip.

Code: Select all

Sub Main(p0,p1) 
   /call SwapCast "${p0}" "${p1}" 
/endmacro 

Sub SwapCast(loot,equipslot) 
   /declare inventoryslot int local 
   /declare pack local 
   /declare packslot int local 
   /declare leaveopen int local 1 
   /declare packnumber int local 0 
   /declare leavetwisting int local 0 

   /if (!${Defined[loot]}) /goto :end 
   /if (${Twist}) { 
      /twist stop 
      /varset leavetwisting 1 
   } 
   :stopsingingdelay 
   /if (${Me.Casting.ID}>0) { 
      /stopsong 
      /goto :stopsingingdelay 
      } 
   /varset inventoryslot ${FindItem[${loot}].InvSlot} 
   /if (!${inventoryslot}) /goto :notfound 
   :packcountloop 
   /if (${inventoryslot}>261 && ${inventoryslot}<342) { 
      /varset packnumber ${Math.Calc[${packnumber}+1]} 
      /varset inventoryslot ${Math.Calc[${inventoryslot}-10]} 
      /goto :packcountloop 
      } 
   /if (${packnumber} > 0) { 
      /varset pack pack${packnumber} 
      /varset packslot ${Math.Calc[${inventoryslot}-251]} 
      /goto :foundit 
      } 
   :notinpack 
      /call CastItem ${inventoryslot} 
      /goto :end 
   :foundit 
      /if (!${Window[${pack}].Open}) { 
         /nomod /itemnotify ${pack} rightmouseup 
         /varset leaveopen 0 
         } 
      /call WaitCursor ${packslot} ${pack} 
      /if (${equipslot.Find[null]}) { 
         /if (${Cursor.WornSlots}>0) { 
            /varset equipslot ${Cursor.WornSlot[1]} 
         } else { 
               /varset equipslot pack1 
         } 
      } 
      /call WaitCursor ${equipslot} 
      /call CastItem ${equipslot} 
      /call WaitCursor ${equipslot} 
      /call WaitCursor ${packslot} ${pack} 
      /if (${leaveopen} == 0) /nomod /itemnotify ${pack} rightmouseup 
      /goto :end 
   :notfound 
      /echo ${loot} not found in inventory. 
   :end 
   /if (${leavetwisting} == 1) /twist start 
/return 

Sub CastItem(slot) 
   /nomod /itemnotify ${slot} rightmouseup 
  /echo Waiting 3seconds for server or untill I start to cast 
  /delay 1s ${Me.Casting.ID} 
   /echo Swapcast::Casting the effect on your ${InvSlot[${slot}].Item.Name} 
   :castloop 
|| special case composer greaves don't ever stop casting 
      /if (${InvSlot[${slot}].Item.Name.Find["Composers Greaves"]}) { 
         /delay 12 
         /stopsong 
      } 
|| special cases for epics and other items that don't seem to cast proper with default cast times 
       /if (${InvSlot[${slot}].Item.Name.Find["Blade of Vesagran"]}) { 
         /delay 10 
         /stopsong 
      } 
      /if (${InvSlot[${slot}].Item.Name.Find["Prismatic Dragon Blade"]}) { 
         /delay 10 
         /stopsong 
      } 
      /if (${Me.Casting.ID}) /goto :castloop 
/return 

Sub WaitCursor(slot, pack) 
   /declare loot local 
   /declare timeout timer 30 
   /varset loot ${Cursor.ID} 
   /if (${Defined[pack]}) /goto :waitloop2 
   :waitloop1 
      /nomod /itemnotify ${slot} leftmouseup 
   /if ((${loot} == ${Cursor.ID}) && (${timeout} > 0)) /goto :waitloop1 
   /goto :donewaiting 
   :waitloop2 
      /nomod /itemnotify in ${pack} ${slot} leftmouseup 
   /if ((${loot} == ${Cursor.ID}) && (${timeout} > 0)) /goto :waitloop2 
   :donewaiting 
/return 

great macro

Posted: Sat Nov 24, 2007 3:01 am
by chikiko
I just wanted to say that this is a great macro. I was hesitant to buy a new item recently cuz the one that i was wearing had a clicky i really liked and i didn't want to switch cuz i knew i was likely to be lazy or forgetful and not swap it out to cast. so this is a beautiful. The only thing it seems to lack the ability to do is make a swap a swap and cast on a 2h clicky item, like the lost staff of the scorned. nevertheless great macro!

Re: swapcast.mac a swap item and cast it macro (updated 7-2-5)

Posted: Wed Jul 06, 2011 7:23 pm
by Mangilagat
Anyone have an updated macro for this? It doesn't work atm -- doesn't swap items, just tries to cast them from inventory.

Re: swapcast.mac a swap item and cast it macro (updated 7-2-5)

Posted: Wed Jul 06, 2011 9:15 pm
by Gomer
Mangilagat wrote:Anyone have an updated macro for this? It doesn't work atm -- doesn't swap items, just tries to cast them from inventory.
I recommend you try "spell_routines.inc", it's current and works well for both spells and clickies. You'll probably want to also get bagwindow etc.
I a recent version is here: viewtopic.php?p=147975#p147975

Re: swapcast.mac a swap item and cast it macro (updated 7-2-5)

Posted: Thu Jul 07, 2011 8:19 am
by Mangilagat
I don't have access to VIP =(