Airship Macro

Moderator: Moderators

Message
Author
muszyka
Human
Human
Posts: 38
Joined: 05 Sep 2008, 08:45
Noob?: No
Location: Philippines

Re: Airship Macro

#11 Post by muszyka »

i mean macro airship Izlude Rachel
Image

Never interrupt your enemy when he's making a mistake.
Always go on PVP. /gg

sofax222
Developers
Developers
Posts: 214
Joined: 24 Nov 2010, 03:08
Noob?: Yes

Re: Airship Macro

#12 Post by sofax222 »

I play on twRO.

I make some changes, as following.

1. Merging the "airshipEinbrochAirport" and the "airshipYunoAirport" to an "airshipMainAirport", and merging the "airshipEinbrochTerminal" and the "airshipYunoTerminal" to an single "airshipMainTerminal".
2. Modify some "Move" tasks.
3. Modify some npc "Talk" procedures.
4. In the airshipLanded macro, modify the console message condition, because my openkore running in Chinese language.

The code in the macros.txt as:
At least, It works fine on my openkore (svn 7677) !

Code: Select all

##飛船巨集##
macro airship {
	# Izlude, yuno and Rachel
	# yuno, Hugel, Einbroch and Lighthalzen - airplane

	do conf lockMap none

	$airportDest = $emptyVar
	$checkTransfer = True
	$myInOut = OUTx

	if ($.param2 == "einbroch") goto destEinbroch
	if ($.param2 == "hugel") goto destHugel
	if ($.param2 == "izlude") goto destIzlude
	if ($.param2 == "lighthalzen") goto destLighthalzen
	if ($.param2 == "rachel") goto destRachel
	if ($.param2 == "yuno") goto destyuno
	goto errorDest

	:destEinbroch
	$airportDest = 艾音布羅克
	goto checkStart

	:destHugel
	$airportDest = 毀葛
	goto checkStart

	:destIzlude
	$airportDest = 依斯魯得島
	goto checkStart

	:destLighthalzen
	$airportDest = 里希塔樂鎮
	goto checkStart

	:destRachel
	$airportDest = 拉赫
	goto checkStart

	:destyuno
	$airportDest = 朱諾
	goto checkStart

	:checkStart
	if ($.param1 == "einbroch") goto airport
	if ($.param1 == "izlude") goto izlude
	if ($.param1 == "hugel") goto hugel
	if ($.param1 == "lighthalzen") goto lhzAirport
	if ($.param1 == "rachel") goto raFild12
	if ($.param1 == "yuno") goto yAirport
	goto errorStart

	:checkIzludeRachel
	if ($airportDest == "依斯魯得島") goto airshipTransfer
	if ($airportDest == "拉赫") goto airshipTransfer
	$checkTransfer = $emptyVar
	goto checkStart

	:checkEinbrochHugelLighthalzen
	if ($airportDest == "艾音布羅克") goto airshipTransfer
	if ($airportDest == "毀葛") goto airshipTransfer
	if ($airportDest == "里希塔樂鎮") goto airshipTransfer
	$checkTransfer = $emptyVar
	goto checkStart

	:airport
	if ($checkTransfer == "True") goto checkIzludeRachel
#	goto the airport portal of Einbroch
	do move 64 207 einbroch
	goto quit

	:hugel
	if ($checkTransfer == "True") goto checkIzludeRachel
	do move 181 146 hugel
	do move 178 142 hugel
	pause 2
	do talk resp 0
	goto quit

	:izlude
	if ($checkTransfer == "True") goto checkEinbrochHugelLighthalzen
	do move 202 56 izlude
	do talknpc 206 55 r0 r0
	goto quit

	:lhzAirport
	if ($checkTransfer == "True") goto checkIzludeRachel
	do move lhz_airport
	goto quit

	:raFild12
	if ($checkTransfer == "True") goto checkEinbrochHugelLighthalzen
	do move 295 208 ra_fild12
	pause 2
	do talk resp 0
	goto quit

	:yAirport
#	goto the airport portal of Yuno
	do move 53 214 yuno
	goto quit

	:airshipTransfer
	$airshipTransfer = True
	$checkTransfer = $emptyVar
	goto checkStart

	:errorStart
	log Error: Unknown starting point!
	goto quit

	:errorDest
	log Error: Unknown destination!

	:quit
}

automacro airshipMainAirport {
	location airport 90 45 193 13
	timeout 90
	delay 5
	call {
		if ($myInOut == "INx") goto leaveAirport
		if ($myInOut == "OUTx") goto enterTerminal
		goto quit

		:enterTerminal
		do move 143 38 airport
		do talknpc 143 43 r0 r0
		goto quit

		:leaveAirport
		if ($airportDest == "朱諾") goto toYuno
		if ($airportDest == "艾音布羅克") goto toEinbroch
		goto quit

		:toYuno
		$airportDest = $emptyVar
		do move 143 16 airport
		goto quit

		:toEinbroch
		$airportDest = $emptyVar
		do move 143 14 airport

		:quit
	}
}

automacro airshipMainTerminal {
	location airport 116 74 167 50
	timeout 90
	delay 5
	call {
		if ($myInOut == "INx") goto leaveTerminal
		if ($myInOut == "OUTx") goto enterGate
		goto quit

		:enterGate
		if ($airportDest == "艾音布羅克") goto rightGate
		if ($airportDest == "朱諾") goto centerGate
		if ($airportDest == "依斯魯得島") goto toTrue
		if ($airportDest == "拉赫") goto toTrue
		if ($airportDest == "毀葛") goto toFalse
		if ($airportDest == "里希塔樂鎮") goto toFalse
		goto quit

		:toTrue
		if ($airshipTransfer == "True") goto centerGate
		goto leftGate

		:toFalse
		if ($airshipTransfer == "False") goto rightGate
		goto centerGate

		:centerGate
		do move 142 61 airport
		goto quit

		:leftGate
		do move 143 58 airport
		do talknpc 140 63 r0
		goto quit

		:rightGate
		do move 143 58 airport
		do talknpc 145 63 r0
		goto quit

		:leaveTerminal
		do move 143 53 airport
		do talknpc 143 49 r0 r0

		:quit
	}
}

automacro airshipEinbrochGate {
	location einbroch 55 281 94 234
	timeout 90
	delay 5
	call {
		if ($airportDest == "艾音布羅克") goto exitGate
		if ($airportDest != "") goto enterAirship
		goto quit

		:enterAirship
		do move 92 281 einbroch
		goto quit

		:exitGate
		$myInOut = INx
		do move 64 234 einbroch

		:quit
	}
}

automacro airshipLighthalzenAirport {
	location lhz_airport 90 45 193 13
	timeout 90
	delay 5
	call {
		if ($airportDest == "里希塔樂鎮") goto leaveAirport
		if ($airportDest != "") goto enterTerminal
		goto quit

		:enterTerminal
		do move 143 38 lhz_airport
		do talk @npc (143 43)
		pause 2
		do talk resp 0
		pause 2
		do talk resp 0
		goto quit

		:leaveAirport
		$airportDest = $emptyVar
		do move lighthalzen

		:quit
	}
}

automacro airshipLighthalzenTerminal {
	location lhz_airport 116 74 167 50
	timeout 90
	delay 5
	call {
		if ($airportDest == "里希塔樂鎮") goto leaveTerminal
		if ($airportDest != "") goto enterGate
		goto quit

		:enterGate
		do move 143 63 lhz_airport
		goto quit

		:leaveTerminal
		do talk @npc(143 51)
		pause 2
		do talk resp 0
		pause 2
		do talk resp 0

		:quit
	}
}

automacro airshipLighthalzenGate {
	location lighthalzen 294 79 309 72
	timeout 90
	delay 5
	call {
		if ($airportDest == "里希塔樂鎮") goto exitGate
		if ($airportDest != "") goto enterAirship
		goto quit

		:enterAirship
		do move 308 76 lighthalzen
		goto quit

		:exitGate
		do move 294 76 lighthalzen

		:quit
	}
}

automacro airshipYunoLeftGate {
	location yuno 5 279 51 238
	timeout 90
	delay 5
	call {
		if ($airportDest == "朱諾") goto exitGate
		if ($airshipTransfer == "True") goto transferedAirships
		if ($airportDest != "") goto enterAirship
		goto quit

		:enterAirship
		do move 6 261 yuno
		goto quit

		:transferedAirships
		$airshipTransfer = "False"
		$myInOut = "OUTx"
		do move 47 240 yuno
		goto quit

		:exitGate
		$myInOut = INx
		do move 47 240 yuno

		:quit
	}
}

automacro airshipyunoRightGate {
	location yuno 56 279 97 238
	timeout 90
	delay 5
	call {
		if ($airportDest == "朱諾") goto exitGate
		if ($airshipTransfer == "True") goto transferedAirships
		if ($airportDest != "") goto enterAirship
		goto quit

		:enterAirship
		do move 97 260 yuno
		goto quit

		:transferedAirships
		$airshipTransfer = "False"
		$myInOut = "OUTx"
		do move 59 240 yuno
		goto quit

		:exitGate
		$myInOut = INx
		do move 59 240 yuno

		:quit
	}
}

automacro airshipLanded {
	map airplane
	console /目前本飛空艇正飛往(.*)途中/i
	call {
		if ($airportDest == $.lastMatch1) goto exitAirport
		if ($.lastMatch1 == "朱諾") goto checkyuno
		if ($airshipTransfer == "True") goto checkTransfer
		goto quit

		:checkTransfer
		if ($.lastMatch1 == "朱諾") goto exitAirport
		goto quit

		:checkyuno
		if ($airportDest == "朱諾") goto exitAirport
		if ($airshipTransfer == "True") goto checkTransfer
		goto quit

		:exitAirport
		do move 243 74 airplane
#		do move 243 29 airplane

		:quit
	}
}

sofax222
Developers
Developers
Posts: 214
Joined: 24 Nov 2010, 03:08
Noob?: Yes

Re: Airship Macro

#13 Post by sofax222 »

I play on twRO.

This is a new one !
I merge the airshipLighthalzenAirport into airshipMainAirport.
And, I merge the airshipLighthalzenTerminal into airshipMainTerminal.

I could smothly fly between cities with these macros.

The comand is: macro airship -- <from city> <to city>

As:

Code: Select all

macro airship {
	# Izlude, yuno and Rachel
	# yuno, Hugel, Einbroch and Lighthalzen - airplane

	do conf lockMap none

	$airportDest = $emptyVar
	$checkTransfer = True
	$myInOut = OUTx

	if ($.param2 == "einbroch") goto destEinbroch
	if ($.param2 == "hugel") goto destHugel
	if ($.param2 == "izlude") goto destIzlude
	if ($.param2 == "lighthalzen") goto destLighthalzen
	if ($.param2 == "rachel") goto destRachel
	if ($.param2 == "yuno") goto destyuno
	goto errorDest

	:destEinbroch
	$airportDest = 艾音布羅克
	goto checkStart

	:destHugel
	$airportDest = 毀葛
	goto checkStart

	:destIzlude
	$airportDest = 依斯魯得島
	goto checkStart

	:destLighthalzen
	$airportDest = 里希塔樂鎮
	goto checkStart

	:destRachel
	$airportDest = 拉赫
	goto checkStart

	:destyuno
	$airportDest = 朱諾
	goto checkStart

	:checkStart
	if ($.param1 == "einbroch") goto eAirport
	if ($.param1 == "izlude") goto izlude
	if ($.param1 == "hugel") goto hugel
	if ($.param1 == "lighthalzen") goto lAirport
	if ($.param1 == "rachel") goto raFild12
	if ($.param1 == "yuno") goto yAirport
	goto errorStart

	:checkIzludeRachel
	if ($airportDest == "依斯魯得島") goto airshipTransfer
	if ($airportDest == "拉赫") goto airshipTransfer
	$checkTransfer = $emptyVar
	goto checkStart

	:checkEinbrochHugelLighthalzen
	if ($airportDest == "艾音布羅克") goto airshipTransfer
	if ($airportDest == "毀葛") goto airshipTransfer
	if ($airportDest == "里希塔樂鎮") goto airshipTransfer
	$checkTransfer = $emptyVar
	goto checkStart

	:eAirport
	$myInOut = OUTe
	if ($checkTransfer == "True") goto checkIzludeRachel
	do move 64 207 einbroch
	goto quit

	:hugel
	if ($checkTransfer == "True") goto checkIzludeRachel
	do move 181 146 hugel
	do move 178 142 hugel
	pause 2
	do talk resp 0
	pause 2
	do move 95 67 airplane
	goto quit

	:izlude
	if ($checkTransfer == "True") goto checkEinbrochHugelLighthalzen
	do move 202 56 izlude
	do talknpc 206 55 r0 r0
	pause 2
	do move 95 67 airplane
	goto quit

	:lAirport
	$myInOut = OUTl
	if ($checkTransfer == "True") goto checkIzludeRachel
	do move 267 75 lighthalzen
	goto quit

	:raFild12
	if ($checkTransfer == "True") goto checkEinbrochHugelLighthalzen
	do move 295 208 ra_fild12
	pause 2
	do talk resp 0
	pause 2
	do move 95 67 airplane
	goto quit

	:yAirport
	$myInOut = OUTy
	do move 53 214 yuno
	goto quit

	:airshipTransfer
	$airshipTransfer = True
	$checkTransfer = $emptyVar
	goto checkStart

	:errorStart
	log Error: Unknown starting point!
	goto quit

	:errorDest
	log Error: Unknown destination!

	:quit
}

automacro airshipMainAirport {
	location airport 90 45 193 13
	timeout 90
	delay 5
	call {
		if ($myInOut == "INx") goto leaveAirport
		if ($myInOut == "OUTx") goto enterTerminal
		if ($myInOut == "OUTe") goto enterTerminal
		if ($myInOut == "OUTl") goto enterTerminal
		if ($myInOut == "OUTy") goto enterTerminal
		goto quit

		:enterTerminal
		do move 143 38 airport
		do talknpc 143 43 r0 r0
		goto quit

		:leaveAirport
		if ($airportDest == "朱諾") goto toYuno
		if ($airportDest == "艾音布羅克") goto toEinbroch
		if ($airportDest == "里希塔樂鎮") goto toLighthalzen
		goto quit

		:toYuno
		$airportDest = $emptyVar
		do move 143 16 airport
		goto quit

		:toEinbroch
		$airportDest = $emptyVar
		do move 143 14 airport

		:toLighthalzen
		$airportDest = $emptyVar
		do move 143 13 airport

		:quit
	}
}

automacro airshipMainTerminal {
	location airport 116 74 167 50
	timeout 90
	delay 5
	call {
		if ($myInOut == "INx") goto leaveTerminal
		if ($myInOut == "OUTx") goto enterGate
		if ($myInOut == "OUTe") goto centerGate
		if ($myInOut == "OUTl") goto centerGate
		if ($myInOut == "OUTy") goto enterGate
		goto quit

		:enterGate
		if ($airportDest == "艾音布羅克") goto rightGate
		if ($airportDest == "依斯魯得島") goto leftGate
		if ($airportDest == "拉赫") goto leftGate
		if ($airportDest == "毀葛") goto rightGate
		if ($airportDest == "里希塔樂鎮") goto rightGate
		goto quit

		:toTrue
		if ($airshipTransfer == "True") goto centerGate
		goto leftGate

		:toFalse
		if ($airshipTransfer == "False") goto rightGate
		goto centerGate

		:centerGate
		do move 142 61 airport
		goto quit

		:leftGate
		do move 143 58 airport
		do talknpc 140 63 r0
		goto quit

		:rightGate
		do move 143 58 airport
		do talknpc 145 63 r0
		goto quit

		:leaveTerminal
		do move 143 53 airport
		do talknpc 143 49 r0 r0

		:quit
	}
}

automacro airshipEinbrochGate {
	location einbroch 55 281 94 234
	timeout 90
	delay 5
	call {
		if ($airportDest == "艾音布羅克") goto exitGate
		if ($airportDest != "") goto enterAirship
		goto quit

		:enterAirship
		do move 92 281 einbroch
		pause 2
		do move 95 67 airplane
		goto quit

		:exitGate
		$myInOut = INx
		do move 64 234 einbroch

		:quit
	}
}



automacro airshipLighthalzenGate {
	location lighthalzen 294 79 309 72
	timeout 90
	delay 5
	call {
		if ($airportDest == "里希塔樂鎮") goto exitGate
		if ($airportDest != "") goto enterAirship
		goto quit

		:enterAirship
		do move 308 76 lighthalzen
		pause 2
		do move 95 67 airplane
		goto quit

		:exitGate
		$myInOut = INx
		do move 294 76 lighthalzen

		:quit
	}
}

automacro airshipYunoLeftGate {
	location yuno 5 279 51 238
	timeout 90
	delay 5
	call {
		if ($airportDest == "朱諾") goto exitGate
		if ($airshipTransfer == "True") goto transferedAirships
		if ($airportDest != "") goto enterAirship
		goto quit

		:enterAirship
		do move 6 261 yuno
		pause 2
		do move 95 67 airplane
		goto quit

		:transferedAirships
		$airshipTransfer = "False"
		$myInOut = "OUTx"
		do move 47 240 yuno
		goto quit

		:exitGate
		$myInOut = INx
		do move 47 240 yuno

		:quit
	}
}

automacro airshipyunoRightGate {
	location yuno 56 279 97 238
	timeout 90
	delay 5
	call {
		if ($airportDest == "朱諾") goto exitGate
		if ($airshipTransfer == "True") goto transferedAirships
		if ($airportDest != "") goto enterAirship
		goto quit

		:enterAirship
		do move 97 260 yuno
		pause 2
		do move 95 67 airplane
		goto quit

		:transferedAirships
		$airshipTransfer = "False"
		$myInOut = "OUTx"
		do move 59 240 yuno
		goto quit

		:exitGate
		$myInOut = INx
		do move 59 240 yuno

		:quit
	}
}

automacro airshipLanded {
	map airplane
	console /^目前本飛空艇正飛往(.*)途中$/i
	call {
		if ($airportDest == $.lastMatch1) goto exitAirport
		if ($.lastMatch1 == "朱諾") goto checkyuno
		if ($airshipTransfer == "True") goto checkTransfer
		goto quit

		:checkTransfer
		if ($.lastMatch1 == "朱諾") goto exitAirport
		goto quit

		:checkyuno
		if ($airportDest == "朱諾") goto exitAirport
		if ($airshipTransfer == "True") goto checkTransfer
		goto quit

		:exitAirport
		do move 243 74 airplane

		:quit
	}
}

Post Reply