<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

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

Post by Kaitain » Sat Dec 06, 2003 7:15 am

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

User avatar
MDewHead
orc pawn
orc pawn
Posts: 28
Joined: Fri Oct 31, 2003 4:08 am

Post by MDewHead » Wed Dec 10, 2003 5:23 am

Ok, I've never had much problem with this macro before. I've always been able to fix what I did, but this time, I can't figure it out.

I made a recipie called Yarrow:

Code: Select all

[yarrow] 
Cont=enviro 
Comp0=#yarrow
Comp1=#soda
Except instead of #soda, it should be water flask (it's late, not thinking), so no problem, I go to my recipie file and change it what it should be:

Code: Select all

[yarrow] 
Cont=enviro 
Comp0=#yarrow
Comp1=water flask
I SAVE the recipies.ini and redo the macro. It's still comming up #soda instead of water flask. I go make sure I saved it, blah blah blah, then try again, no go. I try another recipie, then go back to this one. Still not seeing the corrections. So I just admit I'm going to have to restart MQ2 and EQ. I do so, and it's still looking for #soda. Going to restart computer now, but why isn't it reloading the recipe.ini everytime you run the macro?

Edit: OK restarting computer did absolutely nothing. The Macro is still trying to find the #soda. This is so strange.

Rat_Bastard
decaying skeleton
decaying skeleton
Posts: 6
Joined: Wed Dec 10, 2003 12:35 pm

Post by Rat_Bastard » Wed Dec 10, 2003 1:04 pm

I'm new here (just registered) but I look foward to learning a lot. This looks like a lot of fun to learn and implement..

MDewHead...

It's a guess on my part and I am probably way off base but can it be that you have 2 recipes for yarrow in your .ini file?

User avatar
Elric
Cheese Whore
Cheese Whore
Posts: 466
Joined: Sun Nov 23, 2003 12:31 am
Location: Tampa, Fl
Contact:

Post by Elric » Wed Dec 10, 2003 3:45 pm

Have we figured out a way to save our tool? I'd hate to be making skull ale and lose my friend's cyclops skull (he'd keel me.).
-Elric

natus
decaying skeleton
decaying skeleton
Posts: 3
Joined: Thu Dec 11, 2003 4:31 am

Post by natus » Fri Dec 12, 2003 4:24 pm

Im having abit a trouble geting this to work anytime i try to run it i get the following

Ending macro subroutine main wasnt found
Cleared the following:Timers Vars Arrays
the current macro has ended


Anyone able to help me out with this please

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

...

Post by gn0m3 » Mon Dec 29, 2003 11:36 am

I fixed this so that it no longer destroys tools. The change is in tradeskill.inc. Use it as option dontdestroy (i.e. dontdestroy=xyz).

Code: Select all

| TradeSkills.inc 

#event SkillTrivial "You can no longer advance your skill from making this item" 
#event SkillUp "You have become better at" 
#event SkillFailure "You lacked the skills" 
#event SkillSuccess "You have fashioned the items together to create something new" 
#event FullInventory "There was no place to put that" 
#event CombineError "You cannot combine these items in this container type!" 
#chat tell 

Sub tradeSkills 
    /declare ShowStats global 
    /declare EndOnTrivial global 
    /declare dly global 
    /declare abt global 
    /declare FinishedProduct global 
    /declare DesiredSuccesses global 
    /declare ErrorAtCombine global 
    /declare CombineErrorCounter global 
    /declare SkillTrivialCounter global 
    /declare SkillFailCounter global 
    /declare SkillSuccessCounter global 
    /declare SuccessRate global 
    /declare TotalAttempts global 
    /declare SkillUpRate global 
    /declare SkillUpCounter global 
    /declare CombInt global 
    /declare CombStr global 
    /declare TotalComp global 
    /declare DontDestroy global
  
    /declare l0 local 
    /declare a array 

    /call SetDefaults 
    /if $defined(Param0)==false /call ExecError 
    /if "@Param0"=="help" /call ShowHelp 
    /call ParseArgs "@Param0" 

    /varset ErrorAtCombine 0 
    /varset CombineErrorCounter 0 
    /varset SkillTrivialCounter 0 
    /varset SkillFailCounter 0 
    /varset SkillSuccessCounter 0 
    /varset SuccessRate 0 
    /varset TotalAttempts 0 
    /varset SkillUpRate 0 
    /varset SkillUpCounter 0 
      

    /call CombFind "@Param1" 
    /if n @CombInt<=7 /varset CombStr "pack @CombInt" 
    /if @CombInt==8 { 
        /varset CombInt e 
        /varset CombStr enviro 
    } 
    /if @CombInt>=98 /if @CombInt<=99 { 
        /if n @CombInt==99 /echo Cannot find container << @Param1 >> 
        /if n @CombInt==98 /echo Too far away from << @Param1 >> 
        /endmacro 
    } 

    /varset TotalComp 0 
    /call ClearCursor @FinishedProduct 
    :CountComponents 
        /varset a(@TotalComp) "@Param$int($calc(@TotalComp+2))" 
        /varadd TotalComp 1 
        /if n $int(@TotalComp)>10 /call ExecError 
        /echo Component $int(@TotalComp): @Param$int($calc(@TotalComp+1)) 
        /if "@Param$int($calc(@TotalComp+2))"~~"@" { 
            /goto :DestroyCheck 
        } else /if "@Param$int($calc(@TotalComp+2))"=="" { 
            /goto :DestroyCheck 
        } else { 
            /goto :CountComponents 
        } 

    :DestroyCheck        
    /if @FinishedProduct=="DESTROY" { 
        /beep 
        /press F1 
        /echo This macro is currently set to destroy successful combines!!!! 
    } 

    :Begin 
        /call ClearCursor @FinishedProduct 
        /doevents 

        /if "$target(name,clean)"=="$char(name)" { 
            /echo Pausing!! To resume, type /target clear or target something else. 
            :HoldingPattern 
                /delay 2s 
                /if "$target(name,clean)"=="$char(name)" /goto :HoldingPattern 
        } 
        /if n @DesiredSuccesses!=0 /if n @DesiredSuccesses<=@SkillSuccessCounter { 
            /echo Created $int(@DesiredSuccesses) items as requested! 
            /call EndCombines 
        } 
        /for l0 0 to $int($calc(@TotalComp-1)) 
            |/echo calling AddComp "@a(@l0)" @l0 
            /call AddComp "@a(@l0)" @l0 
        /next l0 

    :Combine 
        /doevents 
        /call DoCombine 

    :ClearCursor 
        /doevents 
        /call ClearCursor @FinishedProduct 
    }      
    /goto :Begin 
/return 

Sub SetDefaults 
    /varset ShowStats 1 
    /varset EndOnTrivial 0 
    /varset dly 2 
    /varset abt 0 
    /varset FinishedProduct "keep" 
    /varset DesiredSuccesses 0 
/return 

Sub CheckOptions 
    /if "@Param1"=="" { 
        /echo Syntax: /call CheckOptions "option" "value" 
        /endmacro 
    } 
    /if "@Param0"=="combines" { 
     /varset DesiredSuccesses $int(@Param1) 
     /return 
    } 
    [b]/if "@Param0"=="dontdestroy" {
    /varset DontDestroy $UCASE(@Param1)
    /return
    }[/b]
    /if "@Param0"=="cursor-delay" { 
     /varset dly $int(@Param1) 
     /return 
    } 
    /if "@Param0"=="end-on-trivial" { 
     /varset EndOnTrivial $int(@Param1) 
     /return 
    } 
    /if "@Param0"=="abort-on-tell" { 
     /varset abt $int(@Param1) 
     /return 
    } 
    /if "@Param0"=="destroy" { 
     /if n @Param1==1 /varset FinishedProduct "destroy" 
     /return 
    } 
    /if "@Param0"=="show-stats" { 
     /varset ShowStats $int(@Param1) 
     /return 
    } 
    /echo unknown option @Param0 

/return 

Sub ParseArgs 
/declare l0 local 
/declare l1 local 
/declare l2 local 
/declare l3 local 
/declare l4 local 

    /if $defined(Param0)==false { 
        /echo Syntax: /call ParseArgs "space seperated string of arguments" 
        /endmacro 
    } 
    /if "@Param0"~~"default" { 
        /call SetDefaults 
        /goto :EndOptions 
    } 
    /varset l0 "@Param0" 
    /call CountArgs "@l0" 
    /varset l1 $int($return) 
    /for l2 1 to @l1 
        /if n @l1>1 /varset l0 "$arg($int(@l2),"@Param0")" 
        /varset l3 $left($instr("=","@l0"),"@l0") 
        /varset l4 $right($calc($strlen("@l0")-$instr("=","@l0")-1),"@l0") 
        /call CheckOptions "@l3" "@l4" 
    /next l2 
    :EndOptions 
/return 

Sub CountArgs 
/declare l0 local 
/declare l1 local 
    /if $defined(Param0)==false { 
        /echo Syntax: /call CountArgs "space seperated string of arguments" 
        /endmacro 
    } 
    /varset l0 1 
    /varset l1 1 
    :Loop 
        /if "$mid($int(@l1),1,"@Param0")"==" " /varadd l0 1 
        /varadd l1 1 
    /if n @l1<$strLen("@Param0") /goto :Loop 
/return $int(@l0) 

Sub ExecError 
    /echo Syntax error. 
    /echo Type the following for more help: 
    /echo /macro sits "help" 
    /endmacro 
/return 

Sub ShowHelp 
    /echo Syntax: /macro ts <options> <CombinerName> <Component> [Component]... 
    /echo Example: /macro ts "show-stats=0 destroy=0 abort-on-tell=0 end-on-trivial=0" "Sewing Kit" "Spider Silk" "Spider Silk" 
    /echo - 
    /echo MAKE SURE THAT: 
    /echo * Inventory is open. 
    /echo * All your containers are open. 
    /echo * Nothing crosses over each other, all windows (bags, inventory, buttons) must be free. 
    /echo * Your windos positions are saved (by closing them and opening them again after they have been moved). 
    /echo - 
    /echo Options: 
    /echo -------- 
    /echo * show-stats 
    /echo -- Syntax: show-stats=1|0 
    /echo -- Example: show-stats=0 
    /echo -- Shows combine statistics. 
    /echo -- Set to 1 for show showing stats, 0 to leave out the stats. 
    /echo -- Default set to 1 (show stats). 
    /echo - 
    /echo * destroy 
    /echo -- Syntax: destroy=1|0 
    /echo -- Example: destroy=1 
    /echo -- Tells the macro wether end-result is destroyed or kept. 
    /echo -- Set to 1 for destroying end-result, 1 to keep end-result. 
    /echo -- Default set to 0 (keep end-result). 
    /echo - 
    /echo * abort-on-tell 
    /echo -- Syntax: abort-on-tell=1|0 
    /echo -- Example: abort-on-tell=1 
    /echo -- Tell the macro wether it should /endmacro when recieving a tell. 
    /echo -- Set to 1 for ending macro on tells, 0 to ignore tells. 
    /echo -- Default set to 0 (ignore tells). 
    /echo - 
    /echo * end-on-trivial 
    /echo -- Syntax: end-on-trivial=1|0 
    /echo -- Example: end-on-trivial=1 
    /echo -- Tell the macro wether it should stop combines when recieving a trivial message. 
    /echo -- Set to 1 for ending macro on trivial, 0 to ignore trivial. 
    /echo -- Default set to 0 (ignore trivial). 
    /echo - 
    /echo * cursor-delay 
    /echo -- Syntax: cursor-delay=# 
    /echo -- Example: cursor-delay=4 
    /echo -- The delay between mouse commands in the macro. 
    /echo -- Increase this number to make the macro combine slower, but more safely. Decrease the number to combine faster, but more prone to errors. 
    /echo -- Default set to 2 (this is as fast as it has been tested to be able to go) 
    /echo - 
    /echo * combines 
    /echo -- Syntax: combine=# 
    /echo -- Example: combine=100 
    /echo -- The number of successfull combines you want made (or till no more components are available). 
    /echo -- Set to 0 for unlimited combines (or till no more components are available), or to the wanted amount. 
    /echo -- Default set to 0 (unlimited). 
    /echo - 
    /echo * default 
    /echo -- Syntax: default 
    /echo -- Tell the macro to use all default settings, any other options set will be ignored and defaults will be used. 
    /endmacro 
/return 

Sub CleanPack 
/declare l0 local 
/declare l1 local 
    /press ctrl 
    /sendkey down shift 
    /if "@CombStr"=="enviro" { 
        /varset l0 10 
    } else { 
        /varcalc l0 $pack(@CombInt,slots)-1 
    } 

    /for l1 0 to @l0 
        /click left @CombStr @l1 
        /delay @dly 
        /click left auto 
        /delay @dly 
    /next l1 
    /sendkey up shift 
    /press shift 
/return 

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" { 
                        /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 
                        } else { 
                            [b]/if "$UCASE($cursor(name))"~~"@DontDestroy" {
                              /autoinv
                              /delay @dly
                             } else {
                            /click left destroy 
                            /delay @dly 
                        } [/b]
                    } 
            } else { 
                /click left auto 
                /delay @dly 
            } 
        } 
        /if $cursor()!=NULL /goto :Loop 
/return 

sub DoCombine 
    :Loop 
        /click left @CombStr combine 
        /doevents 
        /delay @dly 
        /delay @dly 
        /delay @dly 
        | careful here, this seems to take a long time 
        /if $pack(@CombInt,empty)==FALSE /goto :Loop 
/return 

sub AddComp 
    /press shift 
    /sendkey down ctrl 
    /if "@Param0"~~# { 
        /finditem similar "$right($calc($strlen("@Param0")-1),"@Param0")" 
    } else { 
        /finditem "@Param0" 
    } 
    /if $find()==FALSE /goto :NoComp 
    /delay @dly 
    /click left @CombStr @Param1 
    /goto :End 
    :NoComp 
        /echo Could not find << @Param0 >> 
        /call EndCombines 
    :End 
        /sendkey up ctrl 
        /press ctrl 
/return 

Sub CombFind 
/declare l0 local 
/declare l1 local 
/declare l2 local 
/declare l3 local 

    /varset CombInt 99 
    /if "@Param0"~~"#" { 
        /varset l1 "$right($calc($strlen("@Param0")-1),"@Param0")" 
        /varset l2 0 
    } else { 
        /varset l1 "@Param0" 
        /varset l2 1 
    } 
    /for l3 0 to 7 
        /if n @l2==0 /if "$pack(@l3,name)"~~"@l1" /varset CombInt @l3 
        /if n @l2==1 /if "$pack(@l3,name)"=="@l1" /varset CombInt @l3 
    /next l3 

    /if n @CombInt==99 { 
        /if "@l1"=="enviro" /varset CombInt 8 
        /if n @CombInt!=8 /itemtarget @Param0      
        /if n @CombInt!=8 /if n $ground(id)==0 /varset CombInt 99 
        /if n @CombInt!=8 /if n $distance(item)>20 /varset CombInt 98 
        /if n @CombInt!=8 /if n $ground(id)>0 /if n $distance(item)<=20 /varset CombInt 8 
    } 
/return @CombInt 

Sub DisplayStats 
    /echo Combine Statistics - Successes: $int(@SkillSuccessCounter), Failures: $int(@SkillFailCounter), Trivial: $int(@SkillTrivialCounter) 
    /varcalc TotalAttempts @SkillFailCounter + @SkillSuccessCounter 
    /if n @TotalAttempts>0 { 
    /varcalc SuccessRate @SkillSuccessCounter / @TotalAttempts * 100 
    /varcalc SkillUpRate @SkillUpCounter / @TotalAttempts * 100 
    /echo Successes Rate: $int(@SuccessRate) % out of $int(@TotalAttempts) attempts 
    } else { 
        /echo Unable to complete a combine.  No Stats to report 
    } 
    /if n @SkillUpCounter>0 /echo Skill Ups: $int(@SkillUpCounter) , Skill Rate: $int(@SkillUpRate) % out of $int(@TotalAttempts) attempts 
    /if n @SkillTrivialCounter>0 /echo THIS ITEM IS OR HAS GONE TRIVIAL! 
/return 

Sub EndCombines 
    /call CleanPack 
    /if n @ShowStats==1 /call DisplayStats 
    /endmacro 
/return 

Sub Event_Chat 
    /if "@abt"=="TRUE" { 
        /echo Got a tell, pausing. 
        /press F1 
    } 
/return 

Sub Event_CombineError 
    /varcalc ErrorAtCombine @SkillFailCounter + @SkillSuccessCounter 
    /varadd CombineErrorCounter 1 
    /if n @CombineErrorCounter<=1 { 
        /echo Attempting to recover from failed combine! 
        /call CleanPack 
    } else { 
        /echo Failed to recover from failed combine! 
        /call EndCombines 
    } 
/return 

Sub Event_FullInventory 
    /echo Your inventory is full, ending macro. 
    /call EndCombines 
/return 

Sub Event_SkillFailure 
    /varadd SkillFailCounter 1 
    /if n @CombineErrorCounter>=1 /varset CombineErrorCounter 0      
/return 

Sub Event_SkillSuccess 
    /echo Event_SkillSuccess 
    /varadd SkillSuccessCounter 1 
    /if n @CombineErrorCounter>=1 /varset CombineErrorCounter 0 
/return 

Sub Event_SkillUp 
    /varadd SkillUpCounter 1 
    /echo $int(@SkillUpCounter) skill ups in $int($calc(@SkillFailCounter+@SkillSuccessCounter)) attempts! 
/return 

Sub Event_SkillTrivial 
    /call ClearCursor @FinishedProduct 
    /varadd SkillTrivialCounter 1 
    /if n @ShowStats==1 /if n @SkillTrivialCounter==1 /echo THIS ITEM IS OR HAS GONE TRIVIAL! 
    /if n @EndOnTrivial==1 /if n @SkillTrivialCounter==1 /call EndCombines 
/return 

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

Post by Kaitain » Mon Dec 29, 2003 12:25 pm

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

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

...

Post by gn0m3 » Mon Dec 29, 2003 12:51 pm

Nah, dude, thank YOU and everyone else who has worked on these sweet macros. I'm working on tradeskills right now and having these pre-existing is saving me an insane amount of time. I made 600 celestial essences last night while reading =).

FYI, a better fix might be nicer to be able to designate a "tool" in your ini with a special char -- like prepending * means it is a tool. Then we could leave out dontdestroy=xyz and just have it check for the * in the component name. This would be a bit more complicated (involves parsing out the '*' when searching for the component name), but is more general since it's POSSIBLE (though I can't think of anything offhand) that something will have more than one tool.

User avatar
ieatacid
Developer
Developer
Posts: 2727
Joined: Wed Sep 03, 2003 7:44 pm

Post by ieatacid » Mon Dec 29, 2003 1:11 pm

I found that the only way I could get the "abort on tell" to work was to change

Code: Select all

Sub Event_Chat
    /if "@abt"=="[color=red]TRUE[/color]" {
        /echo Got a tell, pausing.
        /press F1
    }
to this

Code: Select all

Sub Event_Chat
    /if "@abt"=="[color=red]1[/color]" {
        /echo Got a tell, pausing.
        /press F1
    }

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

Post by Kaitain » Mon Dec 29, 2003 1:24 pm

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

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

Re: How about this...

Post by gn0m3 » Mon Dec 29, 2003 2:00 pm

Kaitain wrote:Can anyone think of a reason we couldn't use the recipe list itself to check what not to destroy? I think that would be the easiest way to do it.
Yeah, that's what I meant -- if you prepend * to any component in recipies.ini, it won't be destroyed if it's a result of the combine. I can code this change up if you'd like, no need for you to do all the work. It would be pretty easy (though that is the ugliest part of your macro :wink: ).

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

Post by Kaitain » Mon Dec 29, 2003 4:47 pm

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

User avatar
Elric
Cheese Whore
Cheese Whore
Posts: 466
Joined: Sun Nov 23, 2003 12:31 am
Location: Tampa, Fl
Contact:

Post by Elric » Mon Dec 29, 2003 9:12 pm

Then I'll be waiting to give it a shot on my Skull Ale. :wink:
-Elric

gambitrls
decaying skeleton
decaying skeleton
Posts: 5
Joined: Sun Dec 28, 2003 5:55 am

same problem as booger

Post by gambitrls » Tue Dec 30, 2003 1:31 am

ok 1st off..yes im new so I am still in learning phase.
Ok right now i am using MQ2 and have no custom UI.

I am getting same problem (couldn't open include file: C:\MQ2\release\Macros\Tradeskill.inc)
This is what I did...
1st I coppied the khiTS.mac listed on the 1st page of this post
2nd i pasted to notepad and saved to C:\MQ2\release\Macros as a *allfile*
3rd I coppied nad pasted the Tradeskill.inc and saved to same spot
Can someone explain to me what I am doing wrong?

When I look at my macros folder the KhiTS.ac looks like all the other macros...however the Tradeskill.ini lkeeps getting saved as a text file could this be the problem and if so how do i fix it? I kept trying to delete it and resave but the same thing keeps hapening. Thanks much

gambitrls
decaying skeleton
decaying skeleton
Posts: 5
Joined: Sun Dec 28, 2003 5:55 am

Post by gambitrls » Tue Dec 30, 2003 1:48 am

Ok after some messing around i got one thing fixed I think...I was able to Save Tradeskills.inc to an actuall ini.file in the release/macros folder so i got all excited..haha but when i started to do macro i got the formerly stated error so im back to crying