200+ Jeweling Code WORKING!

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

Moderator: MacroQuest Developers

The_Sage
orc pawn
orc pawn
Posts: 11
Joined: Wed Oct 30, 2002 5:23 am

200+ Jeweling Code WORKING!

Post by The_Sage » Mon Dec 16, 2002 8:46 am

Alright. Thing is don't need to start out at 0 or some low number...we're starting in the 200s here folks. Writing this macro for a very specific reason although expanding it wouldn't be hard. Combine.mac for whatever reason doesn't work for jeweling. In fact, nothing i have found does.

So what else does a poor fool like me do except try to write his own? I'm no n00b to scripting, but as long as I have been out of scripting of any sort I may as well be.

Well. It works. It switches. It does everything it needed to do. Hehehe, too bad i made this AFTER GMing my jewelcraft =\

Anyway, couple knowmn bugs. For some reason it always gives a "Can't parse Sub SkillCheck" And there is alos mass spam from /cleanup. I'm sure this code could be MUCH more efficeint, but hey, my first macro ladies and gents. And considering the fact that it worked, I would say I didn't do half bad. =)

Code: Select all

| - Jeweling.mac -
|


#include routines.mac

Sub Main
      /if "$invpanel"!="TRUE" /press i
        /call FindCombiner "Jewelry Making"
         /if $return==99 /return
      /varset v80 $return
      /cleanup
      
Sub SkillCheck 
/skill Jewel 
/varset v1 $char(skill,"Jewelry Making") 
/if n $v1<223 /call PlatTurq 
/if n $v1<226 /if n $v1>=223 /call PlatHem 
/if n $v1<231 /if n $v1>=226 /call PlatBlood 
/if n $v1<236 /if n $v1>=231 /call PlatJasp 
/if n $v1<242 /if n $v1>=236 /call PlatRose 
/if n $v1<250 /if n $v1>=242 /call PlatJade
/if n $v1>=250 {
/echo CONGRATULATIONS! YOU HAVE GRANDMASTERED JEWELRY MAKING!
/cleanup
/endmacro
}
/call SkillCheck


Sub PlatTurq
	/cleanup
	/if $invpanel==TRUE /if $pack($v80,open)!=TRUE /click right inv $v80
	/sendkey down ctrl

	/finditem "Platinum Bar"
	/if $find()==FALSE /call Finished
	/click left pack $v80 0

	/finditem "Turquoise"
	/if $find()==FALSE /call Finished
	/click left pack $v80 3
	
	/sendkey up ctrl
	/click left pack $v80 combine

	/if "$cursor()"=="TRUE" /goto :AutoDropPlatTest
	/for v1 1 to 5
	    /delay 11
	    /if "$cursor()"=="TRUE" /goto :AutoDropPlatTest
	/next v1

	:AutoDropPlatTest
	/click left auto
	/delay 2
	/click left auto
	/call SkillCheck

Sub PlatHem
	/cleanup
	/if $invpanel==TRUE /if $pack($v80,open)!=TRUE /click right inv $v80
	/sendkey down ctrl

	/finditem "Platinum Bar"
	/if $find()==FALSE /call Finished
	/click left pack $v80 0

	/finditem "Hematite"
	/if $find()==FALSE /call Finished
	/click left pack $v80 3
	
	/sendkey up ctrl
	/click left pack $v80 combine

	/if "$cursor()"=="TRUE" /goto :AutoDropPlatHem
	/for v1 1 to 5
	    /delay 11
	    /if "$cursor()"=="TRUE" /goto :AutoDropPlatHem
	/next v1

	:AutoDropPlatHem
	/click left auto
	/delay 2
	/click left auto
	/call SkillCheck
Sub PlatBlood
	/cleanup
	/if $invpanel==TRUE /if $pack($v80,open)!=TRUE /click right inv $v80
	/sendkey down ctrl

	/finditem "Platinum Bar"
	/if $find()==FALSE /call Finished
	/click left pack $v80 0

	/finditem "Bloodstone"
	/if $find()==FALSE /call Finished
	/click left pack $v80 3
	
	/sendkey up ctrl
	/click left pack $v80 combine

	/if "$cursor()"=="TRUE" /goto :AutoDropPlatBlood
	/for v1 1 to 5
	    /delay 11
	    /if "$cursor()"=="TRUE" /goto :AutoDropPlatBlood
	/next v1

	:AutoDropPlatBlood
	/click left auto
	/delay 2
	/click left auto
	/call SkillCheck

Sub PlatJasp
	/cleanup
	/if $invpanel==TRUE /if $pack($v80,open)!=TRUE /click right inv $v80
	/sendkey down ctrl

	/finditem "Platinum Bar"
	/if $find()==FALSE /call Finished
	/click left pack $v80 0

	/finditem "Jasper"
	/if $find()==FALSE /call Finished
	/click left pack $v80 3
	
	/sendkey up ctrl
	/click left pack $v80 combine

	/if "$cursor()"=="TRUE" /goto :AutoDropPlatJasp
	/for v1 1 to 5
	    /delay 11
	    /if "$cursor()"=="TRUE" /goto :AutoDropPlatJasp
	/next v1

	:AutoDropPlatTest
	/click left auto
	/delay 2
	/click left auto
	/call SkillCheck

Sub PlatRose
	/cleanup
	/if $invpanel==TRUE /if $pack($v80,open)!=TRUE /click right inv $v80
	/sendkey down ctrl

	/finditem "Platinum Bar"
	/if $find()==FALSE /call Finished
	/click left pack $v80 0

	/finditem "Star Rose Quartz"
	/if $find()==FALSE /call Finished
	/click left pack $v80 3
	
	/sendkey up ctrl
	/click left pack $v80 combine

	/if "$cursor()"=="TRUE" /goto :AutoDropPlatRose
	/for v1 1 to 5
	    /delay 11
	    /if "$cursor()"=="TRUE" /goto :AutoDropPlatRose
	/next v1

	:AutoDropPlatRose
	/click left auto
	/delay 2
	/click left auto
	/call SkillCheck

Sub PlatJade
	/cleanup
	/if $invpanel==TRUE /if $pack($v80,open)!=TRUE /click right inv $v80
	/sendkey down ctrl

	/finditem "Platinum Bar"
	/if $find()==FALSE /call Finished
	/click left pack $v80 0

	/finditem "Jade"
	/if $find()==FALSE /call Finished
	/click left pack $v80 3
	
	/sendkey up ctrl
	/click left pack $v80 combine

	/if "$cursor()"=="TRUE" /goto :AutoDropPlatJade
	/for v1 1 to 5
	    /delay 11
	    /if "$cursor()"=="TRUE" /goto :AutoDropPlatJade
	/next v1

	:AutoDropPlatJade
	/click left auto
	/delay 2
	/click left auto
	/call SkillCheck

Sub Finished
	/endmacro

/return

Now then. I know it is FAR from complete....but I was wondering if i could get some pointers on how it is going so far, what is just plain *&^#$ code, and what looks like it might stand a chance of working.

Thanks =)

**EDIT**

Crediting the mooched code to http://macroquest2.com/phpBB2/viewtopic.php?t=1274
as well as http://macroquest2.com/phpBB2/viewtopic.php?t=762

Just posted the rest of the code....I'm looking over it to see if I can spot anyhting immediately wrong with it but seeing as how I borrowed most all of this from several other macros...*shrug*

Hehhee, I know jack squat about scripting...did a bit o scripting for mIRC back in the day but....jeez that was like 6 years ago
...