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.

User:Cegaiel/Macros/CarpBlade/Code

From A Tale in the Desert
< User:Cegaiel‎ | Macros‎ | CarpBlade
Revision as of 19:15, 14 January 2010 by Cegaiel (talk | contribs) (New page: <pre> ;Have this in your inventory: ;4 main tools: Ball Peen Hammer, Shaping Mallet, and Wide Tungsten Chisel ;Metal: Iron or Copper ;Hotkeys: ;F2: Set Location, make blade ;Right Ctrl: ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
;Have this in your inventory:
;4 main tools: Ball Peen Hammer, Shaping Mallet, and Wide Tungsten Chisel 
;Metal: Iron or Copper

;Hotkeys:
;F2: Set Location, make blade
;Right Ctrl: Use last F2 location, make blade
;Right Shift Show location in memory
;Left Click Show current mouse location

;Left Ctrl: Approve an unload the blade from anvil (and make another blade if you uncomment (see next paragraph).
;Spacebar: Discard the blade and recover metal.


;Note the next to the last line in this script: Gosub, Load .
;If you uncomment this, then everytime you Approve/unload a blade (with Left Ctrl key) then it will automatically start a
;new project immediately (same as if you had pressed Right Ctrl), after unloading.
;This can save you a few seconds when doing multiple blades. 


WinGetActiveStats, Title, Width, Height, WinX, WinY 

IfWinExist eGenesis Client
{


	Gui, Add, Text,, Metal Type:
	Gui, Add, DropDownList, vMetal Choose1, Copper|Iron
	Gui, Add, Button, gStart, MAKE
	Gui, Show
		}
		else
		{
	MsgBox, eGenesis Client not running, aborting...
	Exit
		}
		return





Start:
	WinActivate, eGenesis Client
	WinGet, GameWinHandle, ID, eGenesis Client
	StartX = 0
	StartY = 0

Gui, Submit


Gosub, HELP
;Msgbox, Make Blade: Hover mouse at starting position (image in wiki) and click F2`n`n`nHOTKEYS (works at anytime while script is idle):`n`nF1: This Help Screen`n`nF2: Make a blade and lock coordinates into memory and clipboard`nRight Ctrl: Make another blade from last F2 coordinates (memory)`n`nLeft Shift: Show current mouse position`nRight Shift: Show last F2 coordinates (memory)`n`nRight Ctrl: Approve and Unload a blade into your inventory, after making.`nSPACEBAR: Discard project`n`n`nNote: Copper and Iron produce the same quality blades, so use whatever you have the most of.


if (Metal = "Iron")
{
MetalX = 75
MetalY = 73
}else{
MetalX = 75
MetalY = 87
}

MsgBox, Step 1: Your camera angle will now automatically be adjusted to F8 mode and zoomed in to maximum.`n`nThis will take 10 seconds, do not move mouse while this occurs!`n`nNote: If you screen does not zoom in, then you already have your screen locked, press ALT+L to unlock and then reload this script to try again!`n`nPress OK to proceed...

	WinActivate, eGenesis Client

;Now Zoom in all the way with F8
	WinActivate, eGenesis Client
	Sleep 1000
	MouseGetPos, OldMX, OldMY
	Send {F5}{F8}{F8}
	MouseMove, 0,0
	Sleep 5000
	MouseMove, 0, 0
	Sleep 5000
	MouseMove, %OldMX%, %OldMY%, 0			


MsgBox, Step 2: Lock your screen (Alt+L) so the screen doesn't move (after clicking OK)`n`nStep 3: Then hover mouse on the anvil starting position (image in wiki) and hit F2 to make a blade.`n`nIf your starting position doesn't produce a quality of blade that you desire, then repeat Step 3.`nIf your starting position is satisfactory, then make your subsequent blades by clicking the Right Ctrl Key.`n`nMetal: %Metal%

	WinActivate, eGenesis Client

#Persistent
SetTimer, GetStartPos, 100
return


GetStartPos:

GetKeyState, state, F2
if state = D
{
MouseGetPos, StartX, StartY 
Clipboard = Last Project: %StartX%, %StartY%`n
Gosub, Load
}

GetKeyState, state, RCtrl
if state = D
{
Gosub, Load
}

GetKeyState, state, RShift
if state = D
{

if ((StartX == 0) && (StartY == 0))
{
Msgbox, No coordinates in memory, Start a project with F2, first...
}else{
Msgbox, Position in memory: %StartX%, %StartY%`n`nPress Right Ctrl to make another blade at these coordinates`n`nThe coordinates are also located in clipboard, Ctrl+V to paste.
}
}

GetKeyState, state, LShift
if state = D
{
MouseGetPos, xpos, ypos 
Msgbox, Current Mouse Position:`n`n%xpos%, %ypos%`n`nPress <SPACEBAR> to close this popup, without moving mouse!`n`nPress F2, after popup is closed, to start project at these coordinates...
}

GetKeyState, state, LCtrl
if state = D
{
Gosub, ACCEPT
}

GetKeyState, state, Space
if state = D
{
Gosub, DISCARD
}

GetKeyState, state, F1
if state = D
{
Gosub, HELP
}
return



Load:
	WinActivate, eGenesis Client

if StartX = 0
{
MsgBox, You must set the start position by hovering mouse over anvil and clicking F2, first!
return
}


;Load Anvil
Click right %StartX%, %StartY%
sleep 100
NewX := StartX + 45
NewY := StartY - 10 
Click %NewX%, %NewY% ;Left

sleep 100


;Choose Metal
NewX := StartX + MetalX
NewY := StartY - MetalY
Click %NewX%, %NewY% ;Left
sleep 100



;Metal Click
TempX := NewX + 20
Click %TempX%, %NewY% ;Left
sleep 100

;Msgbox, Last chance to abort (by right clicking and Reload/Exit script from system tray icon`n`nAre you sure you have your chat minimized?`n`nIf so, click OK to proceed...


;Shaping Mallet
Mousemove %StartX%, %StartY%
Send {S}
Send {8}
;end Shaping mallet
sleep 100


;round 1 front edge
NewX := StartX - 8
NewY := StartY + 16
sleep 100
Click right %NewX%, %NewY%

NewX := StartX - 8
NewY := StartY + 40
sleep 100
Click right %NewX%, %NewY%

NewX := StartX - 8
NewY := StartY + 64
sleep 100
Click right %NewX%, %NewY%

NewX := StartX - 8
NewY := StartY + 88
sleep 100
Click right %NewX%, %NewY%

NewX := StartX - 8
NewY := StartY + 112
sleep 100
Click right %NewX%, %NewY%

NewX := StartX - 8
NewY := StartY + 136
sleep 100
Click right %NewX%, %NewY%

NewX := StartX - 8
NewY := StartY + 160
sleep 100
Click right %NewX%, %NewY%

NewX := StartX - 8
NewY := StartY + 182
sleep 100
Click right %NewX%, %NewY%

;end 1

sleep 100


;// Wide Chisel //
Mousemove %StartX%, %StartY%
sleep 100
Send {C}
Send {9}
;// end Wide Chisel //

sleep 100

;// start round 2 //
;	// 2 edges //
NewX := StartX - 7
NewY := StartY + 16
sleep 100
Click right %NewX%, %NewY%

NewX := StartX - 7
NewY := StartY + 182
sleep 100
Click right %NewX%, %NewY%

;	// end 2 edges //


NewX := StartX - 8
NewY := StartY + 71
sleep 100
Click right %NewX%, %NewY%

NewX := StartX - 8
NewY := StartY + 127
sleep 100
Click right %NewX%, %NewY%

;	// end center 2 front
;// end Round 2




;// Wide Chisel //
Mousemove %StartX%, %StartY%
sleep 100
Send {C}
Send {4}
;// end Wide Chisel //

sleep 100

;// Center
NewX := StartX + 43
NewY := StartY + 70
Click right %NewX%, %NewY%
sleep 100

NewX := StartX + 43
NewY := StartY + 98
Click right %NewX%, %NewY%
sleep 100

NewX := StartX + 43
NewY := StartY + 126
Click right %NewX%, %NewY%
sleep 100
;// end Center


;// Ball Peen //
Send {B}
Send {9}
;// end Ball Peen //


;// middle points
NewX := StartX + 55
NewY := StartY + 32
Click right %NewX%, %NewY%
sleep 100


NewX := StartX + 55
NewY := StartY + 162
Click right %NewX%, %NewY%
sleep 100

// END middle points

// Edge points
NewX := StartX + 107
NewY := StartY + 28
Click right %NewX%, %NewY%
sleep 100


NewX := StartX + 107
NewY := StartY + 167
Click right %NewX%, %NewY%
sleep 100

//

NewX := StartX + 99
NewY := StartY + 38
Click right %NewX%, %NewY%
sleep 100


NewX := StartX + 99
NewY := StartY + 157
Click right %NewX%, %NewY%
sleep 100

//

NewX := StartX + 106
NewY := StartY + 48
Click right %NewX%, %NewY%
sleep 100


NewX := StartX + 106
NewY := StartY + 147
Click right %NewX%, %NewY%
sleep 100

// End Edge Points
//
Mousemove %StartX%, %StartY%
sleep 100
Send {Q}
Send {Q}
;// END Blade //
Sleep 200

MsgBox, Press <Left Ctrl> to Unload and put blade into your inventory.`n`n Press <SPACEBAR> to Discard Project, keep your %Metal%, try again (F2)...`n`nIf this blade was of satisfactory quality, then after Unloading,  press Right Ctrl to make a blade from the current anvil position.`n`nDon't forget to press F1 for Help Screen for Hotkeys/Shortcuts at anytime!

return



HELP:
Msgbox, Make Blade: Hover mouse at starting position (image in wiki) and click F2`n`n`nHOTKEYS (works at anytime while script is idle):`n`nF1: This Help Screen`n`nF2: Make a blade and lock coordinates into memory and clipboard`nRight Ctrl: Make another blade from last F2 coordinates (memory)`n`nLeft Shift: Show current mouse position`nRight Shift: Show last F2 coordinates (memory)`n`nLeft Ctrl: Approve and Unload a blade into your inventory, after making.`nSPACEBAR: Discard project and recover metal`n`n`nNote: Copper and Iron produce the same quality blades, so use whatever you have the most of.
return


DISCARD:
	WinActivate, eGenesis Client

Click right %StartX%, %StartY%
NewX := StartX + 68 ;// Discard
NewY := StartY - 8  ;// Discard
Sleep 100
Click %NewX%, %NewY% ;Left
sleep 100
MouseGetPos, OldMX, OldMY
Click 476, 433 ;Left
MouseMove, %OldMX%, %OldMY%, 0			
return

ACCEPT:
	WinActivate, eGenesis Client
Click right %StartX%, %StartY%
NewX := StartX + 68 ;// Complete
NewY := StartY - 24 ;// Complete
Sleep 100
Click %NewX%, %NewY% ;Left
sleep 100
MouseGetPos, OldMX, OldMY
Click 476, 433 ;Left
MouseMove, %OldMX%, %OldMY%, 0			


;Uncomment below line to make auto repeat. ie When you accept a project, it will immediately start another (same as Right Ctrl)
;Gosub, Load

return