<deleted>

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

Laind
decaying skeleton
decaying skeleton
Posts: 3
Joined: Sun Jan 11, 2004 11:42 pm

Tool

Post by Laind » Sun Jan 11, 2004 11:44 pm

Still destroying tools =/

I attempted to use the fix proposed earlier, but the var came up invalid and, well im some what of a noob, didnt see where the problem was, i was wondering if anyone else had a fix for it, or if i just implemented the earlier fix incorrectly.

Thanks, great macro here compiled of a bunch of old ones and some great new ideas :)

gn0m3
a lesser mummy
a lesser mummy
Posts: 39
Joined: Sat Dec 13, 2003 10:43 am

Post by gn0m3 » Mon Jan 12, 2004 2:43 pm

PM me with your files (or post them here) and I'll fix it for you.

Maestro
orc pawn
orc pawn
Posts: 12
Joined: Fri Jan 16, 2004 12:53 am

Post by Maestro » Fri Jan 16, 2004 2:07 am

Code: Select all

                          /if "$UCASE($cursor(name))"~~"@DontDestroy" { 
                              /autoinv 
                              /delay @dly 
                             } else { 
                            /click left destroy 
                            /delay @dly 
                        } 
That part of gn0m3's code dropped a }. After adding that in, it ran, but still destroyed my item. I added "/echo Not Destroying @DontDestroy" just before that and @DontDestroy parsed as UNDEFINED-GLOBAL. Was there any change I needed to make to the .mac file so that would be defined?

Also, some combines have multiple tools... the DontDestroy method won't let you specify more than one, will it? As soon as I'm a little more familiar with the scripting, I'll try to hack up something that checks for the item on cursor in the component list, as was mentioned.

Maestro
orc pawn
orc pawn
Posts: 12
Joined: Fri Jan 16, 2004 12:53 am

Post by Maestro » Fri Jan 16, 2004 5:33 am

Many sculpting tools later, I think I have a fix.

In the .mac, change recipeName to global, then add

Code: Select all

#define INIPATH "recipes.ini"
to tradeskills.inc

And replace ClearCursor with:

Code: Select all

sub ClearCursor
| Maestro: I left the original code intact since I'm a noob and don't quite grok it.
| In looking at it, I wonder if it might already be trying to save tools
| I inserted a check before the destroy to see if the item is on the component list
| If so, it auto's it instead.
/declare loop local | loop counter
/declare keep local | when set to 1 will not destroy item on cursor
/declare curse local | item on cursor
/declare comp local | item to compare against
/declare l0 local 
/declare l1 local 
/declare l2 local
    :Loop 
        /delay @dly 
        /if $cursor()!=NULL { 
        | /echo cursor is $cursor() 
            /if "@Param0"=="DESTROY" { 
                /varset l0 0 
                :SubLoop | Maestro: Don't know what this does so leaving it
                  /if "@a(@l0)"~~"#" { 
                        /varset l1 "$right($calc($strlen("@a(@l0)")-1),"@a(@l0)")" 
                        /varset l2 0 
                    } else { 
                        /varset l1 "@a(@l0)" 
                        /varset l2 1 
                    } 
                    /if n @l2==0 /if "$cursor(name)"~~"@l1" { 
                        /click left auto 
                        /delay @dly 
                    } else /if n @l2==1 /if "$cursor(name)"=="@l1" { 
                        /click left auto 
                        /delay @dly 
                    } 
                    /if "$cursor()"!="NULL" { 
                        /if n @l0< $calc(@TotalComp-1) { 
                            /varadd l0 1 
                            /goto :SubLoop | Maestro: end of something
                        } else { | Maestro: Set flag to 0, Loop through ini, set keep to 1 if item found
                            /varset keep 0
                            /for loop 0 to 9
                            /varset comp "$ucase("$ini("INIPATH","@recipeName","Comp@loop")")"
                            /varset curse "$cursor(name)"
                            /varset curse "$ucase("@curse")"
                            /if "@comp"~~"@curse" {
                            /echo Saving $cursor(name)
                            /varset keep 1
                        }
                        /if "@currentComp"=="NOTFOUND" {
                            /goto :forBreak
                        }
                        /next loop
                        :forBreak
                        /if n @keep==0 {
                            /click left destroy
                            /delay @dly
                        } else {
                            /click left auto
                            /delay @dly
                        }
                    }
                } 
            } else {
                /click left auto 
                /delay @dly 
            }
        }
        /if $cursor()!=NULL /goto :Loop 
/return

gn0m3
a lesser mummy
a lesser mummy
Posts: 39
Joined: Sat Dec 13, 2003 10:43 am

Post by gn0m3 » Sun Jan 18, 2004 4:58 pm

Oh, I see... you're saving anything that's part of the recipe.

That's interesting, but it's not terribly flexible. The way you've implemented it is also somewhat inefficient, since you're checking the ini file multiple times per combine.

You're right, my method only allows for one saved item, but that's easily amended by simply parsing out a delimeter:

e.g.

Code: Select all

dontdestroy="x,y,z"
and creating an array of items not to destroy.

The advantage of my method is:

1) It's faster
2) If you want to destroy one thing that was a component (not sure why you'd want to do this), you can.
3) You can choose to save/not-save non-components.

If you want to keep your method, I'd suggest you set variables/arrays with the components instead of re-parsing the ini every combine (multiple times).

Maestro
orc pawn
orc pawn
Posts: 12
Joined: Fri Jan 16, 2004 12:53 am

Post by Maestro » Sun Jan 18, 2004 8:06 pm

Yah, since the tradeskill window is getting an overhaul, I made a design decision to make it work as quick and dirty as possible, rather than create a bunch of new code to make it run pretty. As is, while I'm sure he computer is grumbling about parsing the file over and over, there's no noticable slowdown in execution. Can't think of any recipies that return an item not in the recipe that I'd want to keep, unless I got really strapped for cash and needed those bottles from the mino brew.

Kaitain
a ghoul
a ghoul
Posts: 109
Joined: Fri Oct 10, 2003 1:49 pm

Post by Kaitain » Thu Jan 22, 2004 2:59 pm

<deleted>
Last edited by Kaitain on Thu Apr 15, 2004 5:00 pm, edited 1 time in total.

Scary_Penguin
a lesser mummy
a lesser mummy
Posts: 76
Joined: Sun Nov 16, 2003 11:45 am

Post by Scary_Penguin » Wed Jan 28, 2004 3:01 am

Fix for gn0m3's code. He's bad with {} Pairing it seems :p. This should work great now, no errors.

Code: Select all

sub ClearCursor 
/declare l0 local 
/declare l1 local 
/declare l2 local 
    :Loop 
        /delay @dly 
        /if $cursor()!=NULL { 
            | /echo cursor is $cursor() 
            /if "@Param0"=="DESTROY" { 
                /varset l0 0 
                :SubLoop 
                  /if "@a(@l0)"~~"#" { 
                        /varset l1 "$right($calc($strlen("@a(@l0)")-1),"@a(@l0)")" 
                        /varset l2 0 
                    } else { 
                        /varset l1 "@a(@l0)" 
                        /varset l2 1 
                    } 
                    /if n @l2==0 /if "$cursor(name)"~~"@l1" { 
                        /autoinv
                        /delay @dly 
                    } else /if n @l2==1 /if "$cursor(name)"=="@l1" { 
                        /autoinv
                        /delay @dly 
                    } 
                    /if "$cursor()"!="NULL" { 
                        /if n @l0< $calc(@TotalComp-1) { 
                            /varadd l0 1 
                            /goto :SubLoop 
                        } else /if "$UCASE($cursor(name))"~~"@DontDestroy" { 
                            /autoinv 
                            /delay @dly 
                        } else { 
                            /destroy
                            /delay @dly 
                        } 
                    } 
            } else { 
                /autoinv
                /delay @dly 
            } 
        } 
        /if $cursor()!=NULL /goto :Loop 
/return

Scary_Penguin
a lesser mummy
a lesser mummy
Posts: 76
Joined: Sun Nov 16, 2003 11:45 am

Post by Scary_Penguin » Fri Jan 30, 2004 4:55 am

I'm eager to see the new release of this, and wonder if it will run any faster or bog down less on my slow ass pc :)

/poke Kaitain
Scary:.

No, Really.

Kaitain
a ghoul
a ghoul
Posts: 109
Joined: Fri Oct 10, 2003 1:49 pm

Post by Kaitain » Fri Jan 30, 2004 8:57 am

<deleted>
Last edited by Kaitain on Thu Apr 15, 2004 4:59 pm, edited 1 time in total.

LamahHerder
a hill giant
a hill giant
Posts: 299
Joined: Sat Jun 29, 2002 2:37 am

Post by LamahHerder » Sat Feb 07, 2004 2:37 am

where is the new re-written one?

Kaitain
a ghoul
a ghoul
Posts: 109
Joined: Fri Oct 10, 2003 1:49 pm

Post by Kaitain » Sun Feb 08, 2004 9:09 pm

<deleted>
Last edited by Kaitain on Thu Apr 15, 2004 4:58 pm, edited 1 time in total.

shuttle
a lesser mummy
a lesser mummy
Posts: 62
Joined: Mon Nov 11, 2002 6:08 am

Post by shuttle » Sun Mar 14, 2004 1:31 pm

ready yet?

/tease Kaitain

shuttle

crisdan
a ghoul
a ghoul
Posts: 126
Joined: Mon Mar 24, 2003 1:56 pm

Post by crisdan » Tue Mar 30, 2004 2:08 pm

Kaitain are you going to take the Phase 1 and Phase 2 of MQ2 parameter changes coming into account?

Just wondering cause your macro is in my top 3 favorites that i use currently :>

Kaitain
a ghoul
a ghoul
Posts: 109
Joined: Fri Oct 10, 2003 1:49 pm

Yeah....

Post by Kaitain » Tue Mar 30, 2004 6:25 pm

<deleted>