Need help with a macro you are writing? Ask here!
Moderator: MacroQuest Developers
-
OPIVYAFI
- decaying skeleton

- Posts: 2
- Joined: Tue Aug 03, 2004 6:25 am
Post
by OPIVYAFI » Tue Aug 03, 2004 6:32 am
I am having trouble with a macro I am making for smithing. The #event command doesnt seem to be working. This is the first macro I ever tried to make, and I read the manual and searched the forums but can't seem to find an answer. Sub Event_CombineFail and CombineSucceed at bottom. Here is the code:
Code: Select all
#turbo
#event CombineFail "You lacked the skills to fashion the items together."
#event CombineSuceed "You have fashioned the items together to create something new!"
sub main
/declare Bags int outer
/declare islot int outer
/declare x int outer
/declare v80 int outer 99
/declare times int outer
/declare times2 int outer
/cleanup
/call findcontainer
/call openbags
/call docombine
/return
sub findcontainer
/itemtarget Forge
/delay 1s
/click left item
/delay 1s
/notify TradeskillWnd ExperimentButton leftmousehold
/notify TradeskillWnd ExperimentButton leftmouseup
/return
sub openbags
/delay 1s
/keypress i
/delay 1s
/for x 0 to 7
/itemnotify ${Math.Calc[22+${x}]} rightmouseup
/delay 1
/next x
/return
sub docombine
:start
/delay 2s
/if (${times2}==3) /call docombine3
/if (${times}==3) /call docombine2
/varset islot ${FindItem[Small Piece].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 1 leftmouseup
/varset islot ${FindItem[Small Piece].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 2 leftmouseup
/varset islot ${FindItem[Small Piece].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 3 leftmouseup
/varset islot ${FindItem[Water].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 4 leftmouseup
/combine Enviro
/delay 1s
/autoinv
/varcalc times ${times}+1
/echo ${times}
/goto :start
:end
/return
ombine2
/echo In docombine2
/if (${times2}==3) /call docombine3
/varset islot ${FindItem[Small Brick].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 1 leftmouseup
/varset islot ${FindItem[Small Brick].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 2 leftmouseup
/varset islot ${FindItem[Small Brick].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 3 leftmouseup
/varset islot ${FindItem[Water].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 4 leftmouseup
/combine Enviro
/delay 1s
/autoinv
/varset times 0
/varcalc times2 ${times2}+1
/call docombine
/return
sub docombine3
/delay 2s
/echo docombine3
/varset islot ${FindItem[Large Brick].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 1 leftmouseup
/varset islot ${FindItem[Large Brick].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 2 leftmouseup
/varset islot ${FindItem[Large Brick].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 3 leftmouseup
/varset islot ${FindItem[Water].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 4 leftmouseup
/combine Enviro
/delay 1s
/autoinv
/varset times2 0
/call docombine4
/return
sub docombine4
/delay 2s
/echo docombine4
/varset islot ${FindItem[Smithy].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 1 leftmouseup
/varset islot ${FindItem[Block of Ore].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 2 leftmouseup
/varset islot ${FindItem[Water].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 4 leftmouseup
/combine Enviro
/delay 1s
/autoinv
/delay 1s
/autoinv
/call docombine
/return
Sub Event_CombineFail
/echo Combine Fail
/varcalc times ${times}-1
/call docombine
/return
Sub Event_CombineSuceed
/echo Success!
/return
sub doc
MacroQuest doesn't seem to detect the text in the weindow when the combine fails. I need the #event for fail to work so that it will call the docombine command to prevent not having the appropriate materials. Any help/suggestions would be appreciated, thank you.
-
Fuergrissa
- a grimling bloodguard

- Posts: 607
- Joined: Mon Dec 08, 2003 3:46 pm
- Location: UK
Post
by Fuergrissa » Tue Aug 03, 2004 6:57 am
The reason your Events wont work is you have NO
Put them after your /combine in your Docombine Subs, you are doing alot of work here you could easily avoid by looping your main combine.
Also you may want to use these events instead.
Code: Select all
#Event CombineFail "#*#You lacked the skills#*#"
#Event CombineSucceed "#*#You have fashioned the items together to create something new#*#"
Code: Select all
#event CombineFail "You lacked the skills to fashion the items together."
#event CombineSuceed "You have fashioned the items together to create something new!"
sub main
/declare Bags int outer
/declare islot int outer
/declare x int outer
/declare v80 int outer 99
/declare times int outer
/declare times2 int outer
:main
/cleanup
/call findcontainer
/call openbags
/call docombine
/return
sub findcontainer
/itemtarget Forge
/delay 1s
/click left item
/delay 1s
/notify TradeskillWnd ExperimentButton leftmousehold
/notify TradeskillWnd ExperimentButton leftmouseup
/return
sub openbags
/delay 1s
/keypress i
/delay 1s
/for x 0 to 7
/itemnotify ${Math.Calc[22+${x}]} rightmouseup
/delay 1
/next x
/return
sub docombine
:start
/delay 2s
/if (${times2}==3) /call docombine3
/if (${times}==3) /call docombine2
/varset islot ${FindItem[Small Piece].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 1 leftmouseup
/varset islot ${FindItem[Small Piece].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 2 leftmouseup
/varset islot ${FindItem[Small Piece].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 3 leftmouseup
/varset islot ${FindItem[Water].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 4 leftmouseup
/combine Enviro
/delay 1s
/doevents
/autoinv
/varcalc times ${times}+1
/echo ${times}
/goto :start
:end
/return
Sub docombine2
/echo In docombine2
/if (${times2}==3) /call docombine3
/varset islot ${FindItem[Small Brick].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 1 leftmouseup
/varset islot ${FindItem[Small Brick].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 2 leftmouseup
/varset islot ${FindItem[Small Brick].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 3 leftmouseup
/varset islot ${FindItem[Water].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 4 leftmouseup
/combine Enviro
/delay 1s
/doevents
/autoinv
/varset times 0
/varcalc times2 ${times2}+1
/call docombine
/return
sub docombine3
/delay 2s
/echo In docombine3
/varset islot ${FindItem[Large Brick].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 1 leftmouseup
/varset islot ${FindItem[Large Brick].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 2 leftmouseup
/varset islot ${FindItem[Large Brick].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 3 leftmouseup
/varset islot ${FindItem[Water].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 4 leftmouseup
/combine Enviro
/delay 1s
/doevents
/autoinv
/varset times2 0
/call docombine4
/return
sub docombine4
/delay 2s
/echo docombine4
/varset islot ${FindItem[Smithy].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 1 leftmouseup
/varset islot ${FindItem[Block of Ore].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 2 leftmouseup
/varset islot ${FindItem[Water].InvSlot}
/ctrl /itemnotify ${islot} leftmouseup
/itemn in Enviro 4 leftmouseup
/combine Enviro
/delay 1s
/doevents
/autoinv
/delay 1s
/autoinv
/call docombine
/return
Sub Event_CombineFail
/echo Combine Fail
/varcalc times ${times}-1
/call docombine
/return
Sub Event_CombineSuceed
/echo Success!
/return
|sub doc <----****** Whats This ******
[quote]"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."[/quote]
-
OPIVYAFI
- decaying skeleton

- Posts: 2
- Joined: Tue Aug 03, 2004 6:25 am
Post
by OPIVYAFI » Tue Aug 03, 2004 7:25 am
Thanks a lot.