Ghetto Fletching Macro

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

Mry0y0
decaying skeleton
decaying skeleton
Posts: 5
Joined: Sun Sep 28, 2003 6:28 pm

Ghetto Fletching Macro

Post by Mry0y0 » Sun Sep 28, 2003 8:01 pm

This is a good script for basic combines that I found for Heady Kiolas
that had been adapted from yet something else. I then changed it for Skull Ale and it worked great again. Now I'd like to do it with fletching and obviously as you can read below adjusting for different components will not be hard but Fletching uses a kit and not a stationary object like a brewing barrel. I can't get it work using my Kit from inventory it keeps trying to click at something that isn't there and get stuck. What can I do to edit this or add to this to make it want to use my fletching kit? Instead of a brewing barrell or something similiar that it's trying to use.

Code: Select all

| 
| Created by Wassup / reworded for Kiolas by OnyxSkyDV 
| 
| Combines a water flask, Bottle, and two kiola sap packets. 
| 
| 

#define DelayValue v95 
#define FailedWait v50 

Sub Main 

|Set the delay value 
/varset DelayValue 1 

|Set the FailedWait value 
/varset FailedWait 0 

/sendkey down ctrl 

:CombineLoop 
|Get first component 
/finditem "field point arrowheads" 
/delay $DelayValue 
/if $cursor()!=True /goto :Endit 

:ReClick 
|Place water flask in Brew Barrel 
/click left enviro 0 
/delay $DelayValue 
/if "$cursor(name)"=="field point arrowheads" /goto :ReClick 

|Get second component 
/finditem "bundled wooden arrow shafts" 
/delay $DelayValue 
/if $cursor()!=True /goto :Endit 

:ReClick2 
|Place ore in Brew Barrel 
/click left enviro 1 
/delay $DelayValue 
/if "$cursor(name)"=="bundled wooden arrow shafts" /goto :ReClick2 

|Get file 
/finditem "medium groove nocks" 
/delay $DelayValue 
/if $cursor()!=True /goto :Endit 

:ReClick3 
|Place file in Brew Barrel 
/click left enviro 2 
/delay $DelayValue 
/if "$cursor(name)"=="medium groove nocks" /goto :ReClick3 

|Get file 
/finditem "several shield cut fletchings" 
/delay $DelayValue 
/if $cursor()!=True /goto :Endit 

:ReClick4 
|Place file in Brew Barrel 
/click left enviro 3 
/delay $DelayValue 
/if "$cursor(name)"=="several shield cut fletchings" /goto :ReClick4 


|Click the Combine button 
/click left enviro combine 
:WaitCombine 
/delay 1 
/varadd FailedWait 1 

/if n $FailedWait>2 /goto :AutoDrop 

/if $cursor()==True { 
/goto :AutoDrop 
} else /goto :WaitCombine 

|Drop everything in auto equip 
:AutoDrop 
/if $cursor()==True { 
/click left auto 
/delay 1 
/goto :AutoDrop 
} 
/varset FailedWait 0 
|Start a new Combine 
/goto :CombineLoop 

:EndIt 
/zapvars 
/sendkey up ctrl 
/endmacro 

/return
EDIT: Valerian LOOVES code brackets.

insanitywiz
a hill giant
a hill giant
Posts: 250
Joined: Mon Jul 08, 2002 7:50 am

Post by insanitywiz » Sun Sep 28, 2003 11:47 pm

Code: Select all

:ReClick4 
|Place file in Brew Barrel 
[b]/click left enviro 3 [/b]
/delay $DelayValue 
/if "$cursor(name)"=="several shield cut fletchings" /goto :ReClick4 
Enviro 3 would be the brew barrel I think.

Mry0y0
decaying skeleton
decaying skeleton
Posts: 5
Joined: Sun Sep 28, 2003 6:28 pm

Post by Mry0y0 » Mon Sep 29, 2003 4:35 am

If enviro is the word for the barrell, what would would be the word for my fletching kit in inventory slot 1?

insanitywiz
a hill giant
a hill giant
Posts: 250
Joined: Mon Jul 08, 2002 7:50 am

Post by insanitywiz » Mon Sep 29, 2003 5:52 am

Enviro isn't specifically brew barrel, it's all the enviroment items such as forges.

You may want to take a look at some of the default macro's for an idea on how best to do this, I think there is one there you might find interesting. If it still works.

MQSEQ
Hypocrite fag
Posts: 181
Joined: Fri Sep 19, 2003 5:18 pm

Post by MQSEQ » Mon Sep 29, 2003 7:23 am

You need to pickup the Fletching Kit in you hands (on the mouse pointer) then on your Telnet session type /inspect. It should give you the name of the item you are holding. Use that name in your script as the container name.

Mry0y0
decaying skeleton
decaying skeleton
Posts: 5
Joined: Sun Sep 28, 2003 6:28 pm

Post by Mry0y0 » Mon Sep 29, 2003 10:11 am

This is what I've come up with.

Code: Select all

| 
| Created by Wassup / reworded for Arrows by Mry0y0 
| 
| Combines any arrowheads, shafts, nocks, and vanes or fletchings in any Fletching Kit. 
|  Just make sure all bags and invetory are open before you start, and your kit is not in the first slot.
| 

#define DelayValue v95 
#define FailedWait v50 

Sub Main 

/call FindCombiner Fletching
/varset v80 $return
/if n $v80==99 /return

|Set the delay value 
/varset DelayValue 1 

|Set the FailedWait value 
/varset FailedWait 0 

/sendkey down ctrl 

:CombineLoop 
|Get first component 
/finditem similar "Arrowhead" 
/delay $DelayValue 
/if $cursor()!=True /goto :Endit 

:Click 
|Place first component in Fletching Kit 
/click left pack $v80 0 
/delay $DelayValue 

|Get second component 
/finditem similar "Shaft" 
/delay $DelayValue 
/if $cursor()!=True /goto :Endit 

:Click2 
|Place second component in Fletching Kit 
/click left pack $v80 1
/delay $DelayValue 

|Get third component 
/finditem similar "Nock" 
/delay $DelayValue 
/if $cursor()!=True /goto :Endit 

:Click3 
|Place third component in Fletching Kit. 
/click left pack $v80 2 
/delay $DelayValue 

|Get fourth component 
/finditem similar "Fletchings" 
/delay $DelayValue 
/if $cursor()!=True /goto :Alternate4

:Click4 
|Place fourth component in Fletching Kit 
/click left pack $v80 3 
/delay $DelayValue 

:Alternate4
|Get alternative fourth component
/finditem similar "Vanes"
/delay $DelayValue
/if $cursor()!=true /goto :Combine

:ClickAlternate4 
|Place alternative fourth in Fletching Kit 
/click left pack $v80 4 
/delay $DelayValue 

:Combine
|Click the Combine button 
/click left pack $v80 combine 
:WaitCombine 
/delay 1 
/varadd FailedWait 1 

/if n $FailedWait>2 /goto :AutoDrop 

/if $cursor()==True { 
/goto :AutoDrop 
} else /goto :WaitCombine 

|Drop everything in auto equip 
:AutoDrop 
/if $cursor()==True { 
/click left auto 
/delay 1 
/goto :AutoDrop 
} 
/varset FailedWait 0 
|Start a new Combine 
/goto :CombineLoop 

:EndIt 
/zapvars 
/sendkey up ctrl 
/endmacro 

/return

Sub FindCombiner 
   /varset p2 99 
   /for v99 0 to 7 
      /if "$pack($v99,combine)"=="$p0" /varset p2 $v99 
   /next v99 
/return $p2 


Which works ok, and since I'm using "similar", you can do any the items without having to be specific. My only problem with this script is I added an alternate4 product section because with some arrows you use "Fletchings" and with others you use "Vanes". However, with this script that creates alot of spam because if you're doing a recipe with Fletchings it says "Cannot find any Vanes" or if you're doing a recipe with Vanes is says "Cannot find any Fletchings" before every combine. Is there anything I can do to eliminate that with how the current macro is coded? If not that's fine, so far this is just for me and I didn't mind the spam while I got fletching to 180 hehe. - Mry0y0
Last edited by Mry0y0 on Mon Sep 29, 2003 1:09 pm, edited 1 time in total.

MQSEQ
Hypocrite fag
Posts: 181
Joined: Fri Sep 19, 2003 5:18 pm

Post by MQSEQ » Mon Sep 29, 2003 11:05 am

I would use a parameter switch:

/macro fletch Vanes

or

/macro fletch Fletchings

And use
/finditem similar $p0


Another way is to use a /if statement to figure out which to use:

Code: Select all

/if "$p0"=="Vanes" {
    /finditem similar "Vanes"
	
} else {
    /finditem similar "Fletchings"
}
|Place fourth component in Fletching Kit
/delay $DelayValue
/click left pack $v80 3

MacroFiend
a grimling bloodguard
a grimling bloodguard
Posts: 662
Joined: Mon Jul 28, 2003 2:47 am

Post by MacroFiend » Mon Sep 29, 2003 7:14 pm

Some of my macros actually do an item count of the specific items it needs (in inventory) for the combines. It then adjusts the recipes accordingly.

Specifically, for making sheets of folded metal, it knows that it needs 2 small bricks of ore and water. If it doesn't find 2 small bricks, it looks for 3 small pieces of ore and water to make a small brick, then goes back and checks if it has enough small bricks for the sheet.

Similarly, I have another macro that is posted in the depot that looks for particular runes to make rune scribed swatches for LoY tailoring. It does a count on the runes and if it finds them, it runs the scribing routine.

The nice part about the $count() variable is that it doesn't inundate you with "Could not find xxx" spam when you call it. The only thing I don't remember at the moment is if you can do a similar count like you can with /find. If you can't yet, it wouldn't be that hard to add.

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

Post by EqMule » Tue Sep 30, 2003 7:25 am

Code: Select all

/filter macros none
takes care of the spam, I always have that on, in case a gm decides to make use of the "show me the chatwindow" command... and yes events will still work with filtered macros...
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.