The Wiki for Tale 4 is in read-only mode and is available for archival and reference purposes only. Please visit the current Tale 11 Wiki in the meantime.

If you have any issues with this Wiki, please post in #wiki-editing on Discord or contact Brad in-game.

Difference between revisions of "Iron macro"

From A Tale in the Desert
Jump to navigationJump to search
(New page: <pre> // This is what I suggest for setting up for this macro // First align your view so you can see all 7 crystals clearly // second use Alt-L to lock your camera angle // Third before s...)
 
Line 6: Line 6:
 
//  the first crystal.
 
//  the first crystal.
 
// You will have 3 seconds between the recording of each crystal's location
 
// You will have 3 seconds between the recording of each crystal's location
// place your mouse over the darkest part of each crystal in turn
+
// place your mouse over a spot of average gem color for each crystal in turn
 
// Once it has identified the 7 crystals, it will run the mine
 
// Once it has identified the 7 crystals, it will run the mine
 
Constructs
 
Constructs
Line 17: Line 17:
 
END
 
END
 
Constants
 
Constants
OELevel = 1 // change this to your Ore Extraction level
+
OELevel = 2 // change this to your Ore Extraction level
totalpulls = 100 // How many times do you want it to pull the mine
+
totalpulls = 300 // How many times do you want it to pull the mine
colordiff = 30
+
colordiff = 30 // this is used to find a base for comparison, shouldn't need adjusting
diffRA = 0
+
CDiff = 0
diffRB = 0
+
CurrHigh = 0
diffGA = 0
+
Compare = 0
diffGB = 0
+
Currcrys = 0
diffBA = 0
 
diffBB = 0
 
 
DIFFFOUND = 0
 
DIFFFOUND = 0
 
loopcnt = 1  
 
loopcnt = 1  
Line 34: Line 32:
 
ColorGS = 0
 
ColorGS = 0
 
ColorBS = 0
 
ColorBS = 0
found = 0
 
 
OElistcnt = 0
 
OElistcnt = 0
 
OELvlset = 1
 
OELvlset = 1
Line 69: Line 66:
 
CALL FindtheOdd
 
CALL FindtheOdd
 
 
 +
CALL OreExtractionstore
 +
 +
ListCount OEOffset, $OElistcnt
 +
IF $OELevel > $OElistcnt
 +
Compute OELvlset = OEOffset[$OElistcnt]
 +
ELSE
 +
Compute OELvlset = OEOffset[$OELevel]
 +
END
 +
//Saypaste $OELevel $OElistcnt $OELvlset
 +
 +
mousepos MouseX[$OELvlset], MouseY[$OELvlset]
 +
Delay 200 //200
 +
leftclick
 +
Compute MouseXN = MouseX[$OELvlset] + 15 // adjust this if you need to for the menu click
 +
Compute MouseYN = MouseY[$OELvlset] - 5 // adjust this if you need to for the menu click
 +
Mousepos $MouseXN, $MouseYN
 +
Delay 200
 +
Leftclick
 +
 +
Delay 4300 // Delay to manage the str/perc timer on mining, adjust as needed
 +
 +
end
 +
 +
Procedure CALCCOLOR // This procedure grabs the color of the crystal
 +
Listadd CrysColorR, {RGBRed}
 +
Listadd CrysColorG, {RGBGreen}
 +
Listadd CrysColorB, {RGBBlue}
 +
 +
//Saypaste {RGBRed} {RGBGreen} {RGBBlue}
 +
END
 +
 +
Procedure FindtheOdd
 +
Call Findcompare
 +
Compute CDiff = 0
 +
Compute CurrHigh = 0
 +
 +
Compute Currcrys = 1
 +
loop 7 // Red loop
 +
IF $Currcrys <> $Compare
 +
Compute ColorRS = CrysColorR[$Currcrys] - CrysColorR[$Compare]
 +
IF $ColorRS < 0
 +
Compute ColorRS = 0 - $ColorRS
 +
END
 +
 +
IF $ColorRS > $CDiff
 +
Compute CDiff = $ColorRS
 +
Compute CurrHigh = $Currcrys
 +
END
 +
END
 +
 +
Compute Currcrys = $Currcrys + 1
 +
END
 +
 +
Compute Currcrys = 1
 +
loop 7 // Green loop
 +
IF $Currcrys <> $Compare
 +
Compute ColorGS = CrysColorG[$Currcrys] - CrysColorG[$Compare]
 +
IF $ColorGS < 0
 +
Compute ColorGS = 0 - $ColorGS
 +
END
 +
 +
IF $ColorGS > $CDiff
 +
Compute CDiff = $ColorGS
 +
Compute CurrHigh = $Currcrys
 +
END
 +
END
 +
 +
Compute Currcrys = $Currcrys + 1
 +
END
 +
 +
Compute Currcrys = 1
 +
loop 7 // Blue loop
 +
IF $Currcrys <> $Compare
 +
Compute ColorBS = CrysColorB[$Currcrys] - CrysColorB[$Compare]
 +
IF $ColorBS < 0
 +
Compute ColorBS = 0 - $ColorBS
 +
END
 +
 +
IF $ColorBS > $CDiff
 +
Compute CDiff = $ColorBS
 +
Compute CurrHigh = $Currcrys
 +
END
 +
END
 +
 +
Compute Currcrys = $Currcrys + 1
 +
End
 +
Compute Mousecnt = $CurrHigh
 +
END
 +
 +
Procedure OreExtractionstore
 
ListCount OEOffset, $OElistcnt
 
ListCount OEOffset, $OElistcnt
 
IF $OElistcnt = 0
 
IF $OElistcnt = 0
Line 117: Line 204:
 
Compute OEOffset[1] = $Mousecnt
 
Compute OEOffset[1] = $Mousecnt
 
END
 
END
 +
 +
END
 +
 +
Procedure FindCompare
 +
Compute ColorRS = CrysColorR[1] - CrysColorR[2]
 +
Compute ColorGS = CrysColorG[1] - CrysColorG[2]
 +
Compute ColorBS = CrysColorB[1] - CrysColorB[2]
 
 
ListCount OEOffset, $OElistcnt
+
IF $ColorRS < 0
IF $OELevel > $OElistcnt
+
Compute ColorRS = 0 - $ColorRS
Compute OELvlset = OEOffset[$OElistcnt]
+
END
ELSE
+
IF $ColorGS < 0
Compute OELvlset = OEOffset[$OELevel]
+
Compute ColorGS = 0 - $ColorGS
 +
END
 +
IF $ColorBS < 0
 +
Compute ColorBS = 0 - $ColorBS
 
END
 
END
//Saypaste $OELevel $OElistcnt $OELvlset
 
 
 
mousepos MouseX[$OELvlset], MouseY[$OELvlset]
+
IF $ColorRS < $colordiff AND $ColorGS < $colordiff AND $ColorBS < $colordiff
Delay 200 //200
+
Compute Compare = 1
leftclick
+
ELSE
Compute MouseXN = MouseX[$OELvlset] + 15 // adjust this if you need to for the menu click
+
Compute ColorRS = CrysColorR[1] - CrysColorR[3]
Compute MouseYN = MouseY[$OELvlset] - 5 // adjust this if you need to for the menu click
+
Compute ColorGS = CrysColorG[1] - CrysColorG[3]
Mousepos $MouseXN, $MouseYN
+
Compute ColorBS = CrysColorB[1] - CrysColorB[3]
Delay 200
 
Leftclick
 
 
 
Delay 4200 // Delay to manage the str/perc timer on mining, adjust as needed
+
IF $ColorRS < 0
+
Compute ColorRS = 0 - $ColorRS
end
+
END
 
+
IF $ColorGS < 0
Procedure CALCCOLOR // This procedure grabs the color of the crystal
+
Compute ColorGS = 0 - $ColorGS
Listadd CrysColorR, {RGBRed}
+
END
Listadd CrysColorG, {RGBGreen}
+
IF $ColorBS < 0
Listadd CrysColorB, {RGBBlue}
+
Compute ColorBS = 0 - $ColorBS
 
+
END
//Saypaste {RGBRed} {RGBGreen} {RGBBlue}
 
END
 
 
 
Procedure FindtheOdd
 
Compute ColorRS = CrysColorR[1]
 
Compute ColorGS = CrysColorG[1]
 
Compute ColorBS = CrysColorB[1]
 
Compute DIFFFOUND = 0
 
//Saypaste $ColorRS $ColorGS $ColorBS
 
Compute loopcnt = 2
 
CALL computediff
 
 
IF $DIFFFOUND = 1
 
 
 
Compute loopcnt = 3
 
CALL computediff
 
 
 
IF $DIFFFOUND = 1
+
IF $ColorRS < $colordiff AND $ColorGS < $colordiff AND $ColorBS < $colordiff
Compute found = 1
+
Compute Compare = 1
Compute Mousecnt = 1
 
//Saypaste first one is it $DiffRA $DiffRB $DiffGA $DiffGB $DiffBA $DiffBB
 
 
ELSE
 
ELSE
Compute found = 1
+
Compute Compare = 2
Compute Mousecnt = 2
 
//Saypaste second one is it
 
END
 
ELSE
 
Compute loopcnt = 3
 
CALL computediff
 
 
 
IF $DIFFFOUND = 1
 
Compute found = 1
 
Compute Mousecnt = 3
 
//Saypaste third one is it
 
ELSE
 
Compute found = 0
 
Compute Mousecnt = 4
 
//Saypaste not found yet
 
END
 
 
END
 
IF $found = 0
 
Compute loopcnt = 4
 
While $found = 0
 
CALL computediff
 
 
IF $DIFFFOUND = 1
 
Compute found = 1
 
Compute Mousecnt = $loopcnt
 
//Saypaste $loopcnt is it
 
END
 
IF $loopcnt = 7 AND $found = 0
 
Compute found = 1
 
Compute Mousecnt = 1
 
//Saypaste couldnt find it
 
ELSE
 
Compute loopcnt = $loopcnt + 1
 
END
 
 
END
 
END
 
END
 
END
 
END
 
  
Procedure computediff
 
Compute DIFFFOUND = 0
 
Compute DiffRA = CrysColorR[$loopcnt] - $ColorRS
 
Compute DiffRB = $ColorRS - CrysColorR[$loopcnt]
 
Compute DiffGA = CrysColorG[$loopcnt] - $ColorGS
 
Compute DiffGB = $ColorGS - CrysColorG[$loopcnt]
 
Compute DiffBA = CrysColorB[$loopcnt] - $ColorBS
 
Compute DiffBB = $ColorBS - CrysColorB[$loopcnt]
 
 
IF $DiffRA > $colordiff OR $DiffRB > $colordiff OR $DiffGA > $colordiff OR $DiffGB > $colordiff OR $DiffBA > $colordiff OR $DiffBB > $colordiff
 
Compute DIFFFOUND = 1
 
END
 
 
END
 
END
 
</pre>
 
</pre>
 
back to Macro list:[[http://www.atitd.org/wiki/tale4/ACtool_Macros Mosaic Macros]]
 
back to Macro list:[[http://www.atitd.org/wiki/tale4/ACtool_Macros Mosaic Macros]]

Revision as of 07:07, 30 December 2008

// This is what I suggest for setting up for this macro
// First align your view so you can see all 7 crystals clearly
// second use Alt-L to lock your camera angle
// Third before starting this, I suggest you have your mouse sitting over
//  the first crystal.
// You will have 3 seconds between the recording of each crystal's location
// place your mouse over a spot of average gem color for each crystal in turn
// Once it has identified the 7 crystals, it will run the mine
Constructs
	MouseX=List // this is an array of mouse X coords for gem sample points
	MouseY=List // this is an array of mouse X coords for gem sample points
	CrysColorR=List
	CrysColorG=List
	CrysColorB=List
	OEOffset=List
END
Constants
	OELevel = 2  // change this to your Ore Extraction level
	totalpulls = 300 // How many times do you want it to pull the mine
	colordiff = 30 // this is used to find a base for comparison, shouldn't need adjusting
	CDiff = 0
	CurrHigh = 0
	Compare = 0
	Currcrys = 0
	DIFFFOUND = 0
	loopcnt = 1 
	Mousecnt = 1
	MouseXN = 0
	MouseYN = 0
	ColorRS = 0
	ColorGS = 0
	ColorBS = 0
	OElistcnt = 0
	OELvlset = 1
End

// First part that requires a detailed explanation
// this loop will pause for 3 seconds then grab the current mouse location
// its purpose is to identify the 7 sampling locations for the crystals
// when it grabs the sampling spot, it will then echo a . to the chat window
// make sure you are in your main chat tab.
Loop 7
	Delay 3000
	Listadd MouseX, {MouseX}
	Listadd MouseY, {MouseY}
	SayPaste .
END

ListClear OEOffset

loop $totalpulls
	Compute loopcnt = 1
	ListClear CrysColorR
	ListClear CrysColorG
	ListClear CrysColorB
	loop 7
		mousepos MouseX[$loopcnt], MouseY[$loopcnt]
		LoadRGB MouseX[$loopcnt], MouseY[$loopcnt]

		Call CALCCOLOR
		Compute loopcnt = $loopcnt + 1
		Delay 100
	END
	
	CALL FindtheOdd
	
	CALL OreExtractionstore
		
	ListCount OEOffset, $OElistcnt
	IF $OELevel > $OElistcnt
		Compute OELvlset = OEOffset[$OElistcnt]
	ELSE
		Compute OELvlset = OEOffset[$OELevel]
	END
	//Saypaste $OELevel $OElistcnt $OELvlset
	
	mousepos MouseX[$OELvlset], MouseY[$OELvlset]
	Delay 200 //200
	leftclick
	Compute MouseXN = MouseX[$OELvlset] + 15 // adjust this if you need to for the menu click
	Compute MouseYN = MouseY[$OELvlset] - 5 // adjust this if you need to for the menu click
	Mousepos $MouseXN, $MouseYN
	Delay 200
	Leftclick
	
	Delay 4300 // Delay to manage the str/perc timer on mining, adjust as needed
	
end

Procedure CALCCOLOR // This procedure grabs the color of the crystal
	Listadd CrysColorR, {RGBRed}
	Listadd CrysColorG, {RGBGreen}
	Listadd CrysColorB, {RGBBlue}

	//Saypaste {RGBRed} {RGBGreen} {RGBBlue}
END

Procedure FindtheOdd
	Call Findcompare
	Compute CDiff = 0
	Compute CurrHigh = 0
	
	Compute Currcrys = 1
	loop 7 // Red loop
		IF $Currcrys <> $Compare
			Compute ColorRS = CrysColorR[$Currcrys] - CrysColorR[$Compare]
			IF $ColorRS < 0
				Compute ColorRS = 0 - $ColorRS
			END
			
			IF $ColorRS > $CDiff
				Compute CDiff = $ColorRS
				Compute CurrHigh = $Currcrys
			END
		END
		
		Compute Currcrys = $Currcrys + 1
	END
	
	Compute Currcrys = 1
	loop 7 // Green loop
		IF $Currcrys <> $Compare
			Compute ColorGS = CrysColorG[$Currcrys] - CrysColorG[$Compare]
			IF $ColorGS < 0
				Compute ColorGS = 0 - $ColorGS
			END
			
			IF $ColorGS > $CDiff
				Compute CDiff = $ColorGS
				Compute CurrHigh = $Currcrys
			END
		END
		
		Compute Currcrys = $Currcrys + 1
	END
	
	Compute Currcrys = 1
	loop 7 // Blue loop
		IF $Currcrys <> $Compare
			Compute ColorBS = CrysColorB[$Currcrys] - CrysColorB[$Compare]
			IF $ColorBS < 0
				Compute ColorBS = 0 - $ColorBS
			END
			
			IF $ColorBS > $CDiff
				Compute CDiff = $ColorBS
				Compute CurrHigh = $Currcrys
			END
		END
		
		Compute Currcrys = $Currcrys + 1
	End
	Compute Mousecnt = $CurrHigh
END

Procedure OreExtractionstore
	ListCount OEOffset, $OElistcnt
	IF $OElistcnt = 0
		Listadd OEOffset, $Mousecnt
	ELSE
		IF $OElistcnt = 1
			Listadd OEOffset, OEOffset[1]
		END
		IF $OElistcnt = 2
			Listadd OEOffset, OEOffset[2]
			Compute OEOffset[2] = OEOffset[1]
		END
		IF $OElistcnt = 3
			Listadd OEOffset, OEOffset[3]
			Compute OEOffset[3] = OEOffset[2]
			Compute OEOffset[2] = OEOffset[1]
		END
		IF $OElistcnt = 4
			Listadd OEOffset, OEOffset[4]
			Compute OEOffset[4] = OEOffset[3]
			Compute OEOffset[3] = OEOffset[2]
			Compute OEOffset[2] = OEOffset[1]
		END
		IF $OElistcnt = 5
			Listadd OEOffset, OEOffset[5]
			Compute OEOffset[5] = OEOffset[4]
			Compute OEOffset[4] = OEOffset[3]
			Compute OEOffset[3] = OEOffset[2]
			Compute OEOffset[2] = OEOffset[1]
		END
		IF $OElistcnt = 6
			Listadd OEOffset, OEOffset[6]
			Compute OEOffset[6] = OEOffset[5]
			Compute OEOffset[5] = OEOffset[4]
			Compute OEOffset[4] = OEOffset[3]
			Compute OEOffset[3] = OEOffset[2]
			Compute OEOffset[2] = OEOffset[1]
		END
		IF $OElistcnt = 7
			Compute OEOffset[7] = OEOffset[6]
			Compute OEOffset[6] = OEOffset[5]
			Compute OEOffset[5] = OEOffset[4]
			Compute OEOffset[4] = OEOffset[3]
			Compute OEOffset[3] = OEOffset[2]
			Compute OEOffset[2] = OEOffset[1]
		END

		Compute OEOffset[1] = $Mousecnt
	END

END

Procedure FindCompare
	Compute ColorRS = CrysColorR[1] - CrysColorR[2]
	Compute ColorGS = CrysColorG[1] - CrysColorG[2]
	Compute ColorBS = CrysColorB[1] - CrysColorB[2]
	
	IF $ColorRS < 0
		Compute ColorRS = 0 - $ColorRS
	END
	IF $ColorGS < 0
		Compute ColorGS = 0 - $ColorGS
	END
	IF $ColorBS < 0
		Compute ColorBS = 0 - $ColorBS
	END
	
	IF $ColorRS < $colordiff AND $ColorGS < $colordiff AND $ColorBS < $colordiff
		Compute Compare = 1
	ELSE
		Compute ColorRS = CrysColorR[1] - CrysColorR[3]
		Compute ColorGS = CrysColorG[1] - CrysColorG[3]
		Compute ColorBS = CrysColorB[1] - CrysColorB[3]
	
		IF $ColorRS < 0
			Compute ColorRS = 0 - $ColorRS
		END
		IF $ColorGS < 0
			Compute ColorGS = 0 - $ColorGS
		END
		IF $ColorBS < 0
			Compute ColorBS = 0 - $ColorBS
		END
		
		IF $ColorRS < $colordiff AND $ColorGS < $colordiff AND $ColorBS < $colordiff
			Compute Compare = 1
		ELSE
			Compute Compare = 2
		END
	END

END

back to Macro list:[Mosaic Macros]