help with cleaning this up
Posted: Fri Apr 30, 2004 1:49 am
here is a macro that works, (based on the fishing macro in the depot many thanks for that nice code) but only if keep the bag with the fishing poles open on screen and can someone tell me how to get the finditem working so can avoid the cludgy loop?
i was using this in cobalt scar near the othmir pup at shore so can build begging at same time hehe
(edited for various minor bugs- and edited again to avoid un-needed turnings towards the NPC before begging))
i was using this in cobalt scar near the othmir pup at shore so can build begging at same time hehe
(edited for various minor bugs- and edited again to avoid un-needed turnings towards the NPC before begging))
Code: Select all
| - Fisher.mac -
| MQ2Data and MQ2DataVars ready
| Use with regular poles or a fisherman's companion in an inventory slot for this macro to work properly.
#event PrimaryHand "You need to put your fishing pole in your primary hand."
#event OutOfBait "You can't fish without fishing bait, go buy some."
#event NeedPole "You can't fish without a fishing pole, go buy one."
#event Skillup "You have become better at Begging"
Sub Main
/echo Starting up ${Macro}
/declare PoleToUse int outer
/declare DAS int outer
/declare LC int outer
/declare DA[5] string outer
/varset DA[1] "Tattered Cloth Sandal"
/varset DA[2] "Rusty Dagger"
/varset DA[3] "Fish Scales"
/varset DA[4] "Dragon Bay"
/varset DA[5] "Fresh Fish"
/varset DAS 5
/varset LC 1
/varset PoleToUse 0 | This sets macro to various sources for poles,
| Use 0 to use Fishing Pole
| Use 1 to use Fisherman's Companion
:Fish
/if (${Cursor.ID}) /call ItemSub
/if (${Me.AbilityReady[Begging]}) {
/target NPC
/if (${Target.Distance.Precision[0]}>15) {
| if the lil bugger has run off to play look at him to bring him back
/delay 2s | wait a couple second in case we just cast our line, landsharks are a pain!
/face
/delay 2s | and wait a couple seconds for him to get himself inrange
}
/doability Begging
/face heading 45 | and turn back to the water so we are ready to cast again
}
/if (${Cursor.ID}) /call ItemSub
/if (${Me.AbilityReady[Fishing]}) {
/delay 1s
/if (${Cursor.ID}) /call ItemSub
| just be sure we don't have anything on the cursor
/doability Fishing
| /delay 1s
}
/doevents
/goto :Fish
/return
Sub ItemSub
/for LC 1 to ${DAS}
/if (${Cursor.Name.Find[${DA[${LC}]}]}) {
/drop
/delay 1s
/return
}
/if (${LC}==${DAS}) {
/echo -----> ${Cursor.Name} going into inventory
/autoinv
/delay 1s
/return
}
/next LC
/return
Sub GetPole(TypeofPole)
| By end of the sub there should be a pole of some kind on the cursor
| TypeofPole - 0 for regular pole, 1 for Fisherman's companion
/declare iPack int local
/declare iSlot int local
/varset iPack 0
/varset iSlot 0
/if (${TypeofPole}==0) {
/for iPack 1 to 8
/for iSlot 1 to ${Me.Inventory[Pack${iPack}].Container}
/if (${String[${Me.Inventory[Pack${iPack}].Item[${iSlot}].Name}].Equal[Fishing Pole]}) {
/echo Found Fishing Pole in Pack ${iPack} Slot ${iSlot}
/itemnotify ${Me.Inventory[Pack${iPack}].Item[${iSlot}].InvSlot} leftmouseup
/delay 1s
/goto :FoundItem
}
/next iSlot
/next iPack
} else /if (${TypeofPole}==1) {
/cast item "Fisherman's Companion"
/delay 11s
/goto :FoundItem
}
:NotFoundItem
/echo No Way to equip a Fishing Pole
/endmacro
:FoundItem
/return
Sub Event_NeedPole
/call GetPole ${PoleToUse}
/autoinv
/return
Sub Event_PrimaryHand
/call GetPole ${PoleToUse}
/autoinv
/return
Sub Event_OutOfBait
/Echo Ran out of Bait.
/sit off
/sit on
/camp
/endmacro
/return
Sub Event_Skillup
/Echo Begging is now at ${Me.Skill[Begging]}
/return