Page 1 of 2

Smithing Freebie Quest

Posted: Wed Oct 06, 2004 6:06 am
by Alexander
Ok.. The original macro for this is in another thread.. http://www.macroquest2.com/phpBB2/viewt ... =freesmith

However, It didn't work.. I spent some time fixing all of the calls to subs that didn't exist and fixing the errors that popped up, Etc.. Anyway, I have tested this with two characters and it worked for the entire quest..

the only change you may have to make is if you are lagging, there are two lines that are commented out that you will need to uncomment.. They are marked in the code.

Make sure that you have move.inc. You can get it here.. http://www.macroquest2.com/phpBB2/viewtopic.php?t=7207

If someone wants to figure out how to get it to give 4 items at a time or end when Snokin says whatever it is he says at the end of the quest so that you don't have to say "silly work" again.. feel free, It late and I'm not feeling that industrious..

anyway.. Here's the code.. Hope you find it usefull..

Code: Select all

| Smithing Freebie 
| Freesmith.mac 
| Actually Works on Abysmal Free Smithing Quest 
| Version 2.0 
| Date: 10-02-04 
| By:  Alexander 
| 
| You WILL need to in front of Snokin Breaksteel in Abysmal Sea for it to work 
| Also Make sure that you have the move.inc file in your macro directory
|
| Disclaimer: 
| Code was used from a macro created by ScubaSki.
| 
|  Snokin loc = 96.50,260.36,113.94 
|  Forge Loc = 175.08,253.02,113.94 
|  Next to Forge = 165.53,257.12,113.94 

#include move.inc 

#event CombineError "#*#There was no place to put that#*#" 
#event CombineError "#*#You cannot combine these items in this container type!#*#" 
#event CombineError "#*#did not accept these items#*#" 
#event ContUsed "#*#Someone else is using that. Try again later.#*#" 

Sub Main 

  /declare Comp[3] string outer 
  /declare ItemTurnIn string outer
  /declare VariItem string outer 
  /declare StopItem string outer
  /declare Itemset int outer
  /declare EndIt int outer
  /declare SetCount int outer
  /declare i int outer
  /varset VariItem "Simple Chisel Mold"
  /varset StopItem "NULL"
  /varset SetCount 3
  /varset Itemset 1
  /varset EndIt 1


:Start 

  /call GMCheck 
  /call GetItems 
  /if (${EndIt}!=1) {
        /Echo Quest Finished Ending Macro
        /endmacro
  }

| ** Move to Forge 

  /call MovetoLoc 165.53,257.12,113.94 
  /echo At Forge 
  /call Docombine 

| ** Move to Snokin 

  /call MovetoLoc 96.50,260.36,113.94 
  /echo At Snokin 
  /call GiveItems
  /goto :Start
  
/return 

Sub GetItems 

  
  /varset SetCount 3 

:Loop 
  /target Snokin 
  /face nolook Snokin 
  /nomodkey /say Silly Work 
  /delay 1s 
  /if (!${Window[InventoryWindow].Open}) /nomodkey /keypress inventory 
  /delay 2 

| ** Placing components in inventory

  /for i 1 to 3
  /varset Comp[${i}] ${Cursor.Name} 
  /echo Item ${i} is ${Comp[${i}]} 
  /if (${Comp[1].Equal[${StopItem}]}) {
        /varset EndIt 2
  }
  /autoinv 
  /delay 2s 
  /next i
  /if (${Comp[2].Equal[${VariItem}]}) {
        /varset SetCount 2
  }

/return 


Sub GiveItems 
  /varset Itemset 1
  /delay 1s 
  /call OpenPacks
  /target Snokin
  /face nolook

:ItemLoop 

  /ctrl /itemnotify ${FindItem[${ItemTurnIn}].InvSlot} leftmouseup 
  /click left target 
  /delay 1s
  /nomodkey /notify GiveWnd GVW_Give_Button leftmouseup 
  /delay 1s

| ** Check for more items 
  
  /if (${FindItem[${ItemTurnIn}].ID}!=NULL) {
        /goto :ItemLoop
  }
  /call ClosePacks 
/return 


Sub GMCheck 
:gmcheck 
   /if (${Spawn[gm].ID}>0) { 
         /echo "Waiting on GM to leave zone." 
         /delay 10 
         /goto :gmcheck 
   } 
/return 

Sub Event_CombineError 
  /beep 
/return 

Sub Event_ContUsed 
    /echo Container in use. Waiting 30 seconds and trying again. 
    /delay 30s 
    /itemtarget "Forge" 
    /delay 1s 
    /nomodkey /click left item 
    /delay 2s 
    /doevents 
/return 

|--------------------------------------------------- 
| SUB: Do the Comines 
|--------------------------------------------------- 
Sub DoCombine 

   /declare iSlot int local 
   /declare Counter int local 

   /doevents 

   |------------------------------------------------ 
   | Open Forge. 
   |------------------------------------------------ 
   /itemtarget Forge 
   /face item 
   /click left item 
   /delay 2s 
   /notify TradeSkillWnd ExperimentButton leftmouseup 
   |------------------------------------------------ 
   | Clear Out Brew Barrel. 
   |------------------------------------------------ 
   /echo Cleaning Out Forge... 
   /for iSlot 1 to 10 
        /shiftkey /itemnotify enviro${iSlot} leftmouseup 
        /if (${Cursor.ID}) { 
              /destroy 
        } 
   /next iSlot 

   |------------------------------------------------ 
   | Open Inventory Window. 
   |------------------------------------------------ 
   /if (!${Window[InventoryWindow].Open}) /nomodkey /keypress inventory 
   /delay 2 
   |------------------------------------------------ 
   | Open All 8 Packs. 
   |------------------------------------------------ 
   /call OpenPacks

   |------------------------------------------------ 
   | Make Recipe. 
   |------------------------------------------------ 
   /echo Making Recipe... 

   :MakeRecipe 

   /doevents 
   /call GMCheck 
   /for Counter 1 to ${SetCount}
   /if (${FindItem[${Comp[${Counter}]}].InvSlot}==NULL) /goto :Done 
   /ctrl /itemnotify ${FindItem[${Comp[${Counter}]}].InvSlot} leftmouseup 

| *** If you are lagging, uncomment the two delay lines.

|   /delay 1s 
   /itemnotify enviro${Counter} leftmouseup 
|   /delay 1
   /next Counter 
   /delay 1 
   /combine enviro
   /delay 2s
   /if (${Itemset}==1) {
         /if (!${Cursor.ID}) { 
                /echo Didn't create recipe, Trying again...
                /goto :ClearCursor
         } else {
                /varset ItemTurnIn ${Cursor.Name}
                /echo setting Item Name to ${ItemTurnIn}
                /varset Itemset 3
         }
   }
   |------------------------------------------------ 
   | Clearing the Cursor. 
   |------------------------------------------------ 
   :ClearCursor 
   /autoinventory 
   /delay 2 

   /if (!${FindItem[${Comp[1]}].InvSlot}) { 
        /goto :Done 
        } else { 
        /goto :MakeRecipe
   } 

   |------------------------------------------------ 
   | Done with Making Recipe. 
   |------------------------------------------------ 
   :Done 
   /call ClosePacks 

/return 

Sub OpenPacks 
   /declare bag int local 0 
   /declare check int local 0 
   /newif (!${Window[InventoryWindow].Open}) /nomodkey /keypress inventory 
   /delay 1s 
   /for bag 1 to 8 step 1 
      /newif (${Window[Pack${bag}].Open}==FALSE) /nomodkey /itemnotify pack${bag} rightmouseup 
   /next bag 
   /delay 1s
   /for check 1 to 9 step 1
      /if  (${Window[TradeskillWnd].Open}) {
         /nomodkey /notify TradeskillWnd ExperimentButton leftmousehold
         /nomodkey /notify TradeskillWnd ExperimentButton leftmouseup
      }
   /next check
   /delay 1s
/return 

Sub ClosePacks 
   /declare bag int local 0 
   /newif (!${Window[InventoryWindow].Open}) /nomodkey /keypress inventory 
   /delay 1s
   /for bag 1 to 8 step 1 
      /newif (${Window[Pack${bag}].Open}==TRUE) /nomodkey /itemnotify pack${bag} rightmouseup 
   /next bag 
   /delay 1s
   /newif (${Window[InventoryWindow].Open}) /nomodkey /keypress inventory 
   /delay 1s 
/return  

Posted: Sun Oct 10, 2004 5:48 pm
by Ratlav
Alexander,

I found this macro to work well, but It only goes threw once then it Ends the macro, I have to type "/macro Freesmith.mac" over and over, for me it doesn't Loop into the process again. Yes, I am a nOOb to this, and don't know how to fix the Code. Any help with this would be much appreciated. :?:

Posted: Sun Oct 10, 2004 6:48 pm
by Zornecro
Sub Main
(all these calls omitted)
/goto :Start
/return

Add the part in bold, maybe that's all it needs, assuming it leaves you standing back where you started.

Posted: Sun Oct 10, 2004 7:43 pm
by Ratlav
Thanks Zornecro,

That was it, It now runs very smooth.

Posted: Sun Oct 10, 2004 9:12 pm
by Zornecro
I didn't examine it for end conditions, like when the NPC doesn't have any more work for you to do. Remember to always have a hotkey to halt looping macros:

Code: Select all

/hot Stop /end

Posted: Wed Oct 13, 2004 3:08 pm
by DryGnome
Maybe you could look at how Handin.mac handles turning in 4 items.

http://www.macroquest2.com/phpBB2/viewt ... c&start=15

Thats the link to the newest version of it, on the second page. It's a really nice macro.

Posted: Wed Oct 13, 2004 11:07 pm
by Grumpy
Yup, I used a combination of:

EQ's shift-uparrow to bring up command history
the handin macro
the simple combine macro

After the first iteration, I just used the already typed commands and things went smoothly. Mainly because I dislike completely unattended macros, those tend to lead to serious afk macroing, which can lead to hairy palms and/or blindness. I use MQ2 to remove the tedium from EQ, not to play it for me.

Posted: Thu Oct 14, 2004 9:59 am
by ScubaSki
Thanks for finishing this up Alexander. I actually finished these quests while I was figuring out the macro so I never ended up "completing" it. I believe I had a workable copy at the end but this was never intended as a postable macro. It was more a way for me to learn more about how to code these.

Anyway, huge thanks for finishing this. =)

Posted: Thu Oct 14, 2004 10:05 am
by ScubaSki
Here's what I ended up coming up with. I never did post it because I hadn't worked out all of the bugs. Maybe you can use this if you want, or it may help someone else if they have issues with it. I know there are still a bug or two in there.

*** ONCE AGAIN, this is NOT an update of Alex's macro. This is a non tested alternate version. ***


Code: Select all

| Smithing Freebie
| Freesmith.mac
| Works on Abysmal Free Smithing Quest
| Version 1.0
| Date: 09-07-04
| By:  ScubaSki
|
| You WILL need to in front of Snokin Breaksteel in Abysmal Sea for it to work
|
| Disclaimer:
| Code was used from other programers also from the MQ Forums.
|
|  Snokin loc = 96.50,260.36,113.94
|  Forge Loc = 175.08,253.02,113.94
|  Next to Forge = 165.53,257.12,113.94

#include move.inc

#event CombineError "#*#There was no place to put that#*#" 
#event CombineError "#*#You cannot combine these items in this container type!#*#" 
#event CombineError "#*#did not accept these items#*#" 
#event ContUsed "#*#Someone else is using that. Try again later.#*#"

Sub Main

  /declare Comp[3] string outer 
  /declare ItemTurnIn string global
  /varset ItemTurnIn Start

:Start
  /call GMCheck
  /call GetItems
|  Move to Forge
  /call MovetoLoc 165.53,257.12,113.94
  /echo At Forge
  /call Docombine
|Move to Snokin
  /call MovetoLoc 96.50,260.36,113.94
  /echo At Snokin
  /call Turnin
/return

Sub GMCheck 
:gmcheck 
   /if (${Spawn[gm].ID}>0) { 
      /echo "Waiting on GM to leave zone." 
      /delay 10 
      /goto :gmcheck 
   } 
/return 

Sub Event_CombineError 
  /beep
/return 

Sub Event_ContUsed
    /echo Container in use. Waiting 30 seconds and trying again.
    /delay 30s
    /itemtarget "Forge"
    /delay 1s
    /nomodkey /click left item
    /delay 2s
    /doevents
/return 


Sub GetItems
  /declare i int outer
:Loop
  /target Snokin
  /face nolook Snokin
  /nomodkey /say Silly Work
  /delay 1s 
  /if (!${Window[InventoryWindow].Open}) /nomodkey /keypress inventory
  /delay 2
  |  Inventory Components
  /for i 1 to 3 
  /varset Comp[${i}] ${Cursor.Name} 
  /echo Item ${i} is ${Comp[${i}]}
  /autoinv
  /delay 2s
  /next i
/return


|--------------------------------------------------- 
| SUB: Do the Comines 
|--------------------------------------------------- 
Sub DoCombine

   /declare iSlot int local 
   /declare Counter int local 

   /doevents 

   |------------------------------------------------ 
   | Open Forge. 
   |------------------------------------------------ 
   /itemtarget Forge 
   /face item 
   /click left item 
   /delay 2s 
   /notify TradeSkillWnd ExperimentButton leftmouseup 
   |------------------------------------------------ 
   | Clear Out Brew Barrel. 
   |------------------------------------------------ 
   /echo Cleaning Out Forge... 
   /for iSlot 1 to 10 
      /shiftkey /itemnotify enviro${iSlot} leftmouseup 
      /if (${Cursor.ID}) { 
         /destroy 
      } 
   /next iSlot 

   |------------------------------------------------ 
   | Open Inventory Window. 
   |------------------------------------------------ 
   /if (${Window[Inventory].Open}==FALSE) { 
      /windowstate inventory open 
   } 

   |------------------------------------------------ 
   | Open All 8 Packs. 
   |------------------------------------------------ 
   /for iSlot 1 to 8 
      /if (${Window[Pack${iSlot}].Open}==FALSE) { 
         /itemnotify pack${iSlot} rightmouseup 
      } 
   /next iSlot 

   |------------------------------------------------ 
   | Make Recipe. 
   |------------------------------------------------ 
   /echo Making Recipe... 

   :MakeRecipe 

   /doevents 
   /call GMCheck 
   /for Counter 1 to 3
   /if (${FindItem[${Comp[${Counter}]}].InvSlot}==NULL) /goto :Done 
   /ctrl /itemnotify ${FindItem[=${Comp[${Counter}]}].InvSlot} leftmouseup 
   /delay 2
   /echo ${Comp[${Counter}]}
   /itemnotify enviro${Counter} leftmouseup 
   /delay 2
   /next Counter
   /delay 5 
   /combine enviro 

   |------------------------------------------------ 
   | Waiting for Combine to Finish. 
   |------------------------------------------------ 
   :WaitCombine 
   /if (!${Cursor.ID}) { 
      /goto :WaitCombine 
   } 
|   /echo Get Ready for ItemTurnIn
|   /delay 5s
   /varset ItemTurnIn ${Cursor.Name} 

   |------------------------------------------------ 
   | Clearing the Cursor. 
   |------------------------------------------------ 
   :ClearCursor 
   /autoinventory 
   } 
   /delay 2 

   /if (!${Cursor.ID}) { 
      /goto :MakeRecipe 
   } else { 
      /goto :ClearCursor 
   } 

   |------------------------------------------------ 
   | Done with Making Recipe. 
   |------------------------------------------------ 
   :Done 
   /cleanup

/return 

Sub Turnin
   /declare iSlot int local 
   /declare Counter int local 
   :button 
  /delay 1sec 
  /doevents 
    /target Snokin 
    /face nolook 
    /echo ${ItemTurnIn} Step 2
   |------------------------------------------------ 
   | Open Inventory Window. 
   |------------------------------------------------ 
   /if (${Window[Inventory].Open}==FALSE) { 
      /windowstate inventory open 
   } 

   |------------------------------------------------ 
   | Open All 8 Packs. 
   |------------------------------------------------ 
   /for iSlot 1 to 8 
      /if (${Window[Pack${iSlot}].Open}==FALSE) { 
         /itemnotify pack${iSlot} rightmouseup 
      } 
   /next iSlot 


   :Loop 
   /if (${FindItem[${ItemTurnIn}].InvSlot}==NULL) /goto :Done 
      /nomodkey /ctrl /itemnotify ${FindItem[=${ItemTurnIn}].InvSlot} leftmouseup 
      /if (!${Cursor.ID}) { 
         /delay 1 
         /goto :Loop 
      } 
    /If (${Cursor.ID}) { 
      /click left target 
      /delay 1s 
      /nomodkey /notify GiveWnd GVW_Give_Button leftmouseup 
      /delay 1s 
   } 
   /newif (${Cursor.ID}) /goto :LootIT 
   /goto :button 
  :DONE
/return 



Posted: Tue Oct 19, 2004 2:04 pm
by seifu
Ski-

I tried your macro and it worked fine until my newbie smith failed a combine. it then frooze the macro. I never got to try the turn in because it never completed the making the files part.

Posted: Thu Oct 21, 2004 5:08 am
by Alexander
Zornecro wrote:I didn't examine it for end conditions, like when the NPC doesn't have any more work for you to do. Remember to always have a hotkey to halt looping macros:

Code: Select all

/hot Stop /end
Yeah, there is a stop condition.. I was toying with the idea of having it count how many of the last combine were turned in and once it had turned in 100 of them, then it would stop.. However, that wouldn't get the final message.. What it does at this point, is you say "silly work" and it gets the final message from snokin (about refining whatever it is) and it then looks to see if there are any items on the cursor.. If there are no items is sets and end condition, then returns to the main sub, it then immediately checks for the end condition to be true..

Code: Select all

  /if (${EndIt}!=1) { 
        /Echo Quest Finished Ending Macro 
        /endmacro 
  } 

Posted: Thu Oct 21, 2004 5:10 am
by Alexander
DryGnome wrote:Maybe you could look at how Handin.mac handles turning in 4 items.

http://www.macroquest2.com/phpBB2/viewt ... c&start=15

Thats the link to the newest version of it, on the second page. It's a really nice macro.
Ya know.. I played with that a little bit, but I couldn't get it to work and was causing too many errors that would be visible to someone watching so I dropped it until I had more time to really look at the code..

I'll try to tackle that once RL settles down again..

Alexander

Posted: Thu Oct 21, 2004 5:18 am
by Alexander
Ok.. I have added the goto that, as Zornecro pointed out (Thank You! =) ), was missing.. I think that should do it..

Scubaski --- Chief, thank you for starting this one in the first place.. It was a really good job, just needed a little tweaking.. If you want to collaborate on something.. just /invite.. I'll be happy to /join

Have a good night everyone.. Heading for sleepytime..

Posted: Thu Oct 21, 2004 5:26 am
by Alexander
Ya know what I just realized.. The first time you talk to snokin, he gives you a book, and then the items for the combine.. The macro doesn't take that into consideration.. It will try to add the book in with the other items on the first run and will cause a "can't combine" error.. Soooo... That's another mod that I'll need to make once I get a chance.. For now, if you are going to use this macro and HAVE NOT already started this quest, talk to him manually the first time (you can then either manually combine the components or destroy them), and then start the macro.. That will skip the problem until I have a chance to fix it..

Have a good night..

Posted: Wed Apr 06, 2005 8:54 pm
by Lord Beavis
I was able to get it to destroy the book but it won't combine without the 3rd item. I know the later recipies reqire 3 items. How do i get it to check if the 3rd item is ==NULL and only use 2 items to combine?