Airship Macro

Moderator: Moderators

Message
Author
Alexander
Noob
Noob
Posts: 11
Joined: 29 May 2008, 12:00
Noob?: Yes

Airship Macro

#1 Post by Alexander »

I wrote this at 2 am, so if something blows up, I blame that.

Usage: macro airship -- startTown endTown
Example: macro airship -- Izlude Lighthalzen

(It transfers airships)
(All portal and npcs are based on KoreRO)

And the really long macro:

Code: Select all

macro airship {
	# Izlude, Yuno and Rachel
	# Yuno, Hugel, Einbroch and Lighthalzen - airplane
	
	$checkTransfer = True
	
	if ($.param2 == "Einbroch") goto destEinbroch
	if ($.param2 == "einbroch") goto destEinbroch
	if ($.param2 == "Hugel") goto destHugel
	if ($.param2 == "hugel") goto destHugel
	if ($.param2 == "Izlude") goto destIzlude
	if ($.param2 == "izlude") goto destIzlude
	if ($.param2 == "Lighthalzen") goto destLighthalzen
	if ($.param2 == "lighthalzen") goto destLighthalzen
	if ($.param2 == "Rachel") goto destRachel
	if ($.param2 == "rachel") goto destRachel
	if ($.param2 == "Yuno") goto destYuno
	if ($.param2 == "yuno") goto destYuno
	if ($.param2 == "Juno") goto destYuno
	if ($.param2 == "juno") goto destYuno
	goto errorDest
	
	:destEinbroch
	$airportDest = Einbroch
	goto checkStart
	
	:destHugel
	$airportDest = Hugel
	goto checkStart
	
	:destIzlude
	$airportDest = Izlude
	goto checkStart
	
	:destLighthalzen
	$airportDest = Lighthalzen
	goto checkStart
	
	:destRachel
	$airportDest = Rachel
	goto checkStart
	
	:destYuno
	$airportDest = Yuno
	goto checkStart
	
	:checkStart
	if ($.param1 == "Einbroch") goto airport
	if ($.param1 == "einbroch") goto airport
	if ($.param1 == "Izlude") goto izlude
	if ($.param1 == "izlude") goto izlude
	if ($.param1 == "Hugel") goto hugel
	if ($.param1 == "hugel") goto hugel
	if ($.param1 == "Lighthalzen") goto lhzAirport
	if ($.param1 == "lighthalzen") goto lhzAirport
	if ($.param1 == "Rachel") goto raFild12
	if ($.param1 == "rachel") goto raFild12
	if ($.param1 == "Yuno") goto yAirport
	if ($.param1 == "yuno") goto yAirport
	if ($.param1 == "Juno") goto yAirport
	if ($.param1 == "Juno") goto yAirport
	goto errorStart
	
	:checkIzludeRachel
	if ($airportDest == "Izlude") goto airshipTransfer
	if ($airportDest == "Rachel") goto airshipTransfer
	$checkTransfer = $emptyVar
	goto checkStart
	
	:checkEinbrochHugelLighthalzen
	if ($airportDest == "Einbroch") goto airshipTransfer
	if ($airportDest == "Hugel") goto airshipTransfer
	if ($airportDest == "Lighthalzen") goto airshipTransfer
	$checkTransfer = $emptyVar
	goto checkStart

	:airport
	if ($checkTransfer == "True") goto checkIzludeRachel
	do move airport
	goto quit
	
	:hugel
	if ($checkTransfer == "True") goto checkIzludeRachel
	do move 182 150 hugel
	do talk @npc (182 150)
	pause 2
	do talk resp 0
	pause 2
	do talk resp 0
	goto quit
	
	:izlude
	if ($checkTransfer == "True") goto checkEinbrochHugelLighthalzen
	do move 202 56 izlude
	do talk @npc (201 54)
	pause 2
	do talk resp 0
	pause 2
	do talk resp 0
	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
	do move y_airport
	goto quit
	
	:airshipTransfer
	$airshipTransfer = True
	$checkTransfer = $emptyVar
	goto checkStart
	
	:errorStart
	log Error: Unknown starting point!
	goto quit
	
	:errorDest
	log Error: Unknown destination!
	
	:quit
}

automacro airshipEinbrochAirport {
	location airport 90 45 193 13
	timeout 90
	delay 5
	call {
		if ($airportDest == "Einbroch") goto leaveAirport
		if ($airportDest != "") goto enterTerminal
		goto quit
		
		:enterTerminal
		do move 143 38 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 einbroch
		
		:quit
	}
}

automacro airshipEinbrochTerminal {
	location airport 116 74 167 50
	timeout 90
	delay 5
	call {
		if ($airportDest == "Einbroch") goto leaveTerminal
		if ($airportDest != "") goto enterGate
		goto quit
		
		:enterGate
		do move 142 61 airport
		goto quit
		
		:leaveTerminal
		do talk @npc(143 51)
		pause 2
		do talk resp 0
		pause 2
		do talk resp 0
		
		:quit
	}
}

automacro airshipEinbrochGate {
	location einbroch 55 281 94 234
	timeout 90
	delay 5
	call {
		if ($airportDest == "Einbroch") goto exitGate
		if ($airportDest != "") goto enterAirship
		goto quit
		
		:enterAirship
		do move 92 280 einbroch
		goto quit
		
		:exitGate
		do move 64 234 airport
		
		:quit
	}
}

automacro airshipHugel {
	location hugel
	timeout 90
	delay 5
	call {
		if ($airportDest == "Hugel") goto arrived
		goto quit
		
		:arrived
		$airportDest = $emptyVar
		
		:quit
	}
}

automacro airshipIzlude {
	location izlude
	timeout 90
	delay 5
	call {
		if ($airportDest == "Izlude") goto arrived
		goto quit
		
		:arrived
		$airportDest = $emptyVar
		
		:quit
	}
}

automacro airshipLighthalzenAirport {
	location lhz_airport 90 45 193 13
	timeout 90
	delay 5
	call {
		if ($airportDest == "Lighthalzen") 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 == "Lighthalzen") 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 == "Lighthalzen") goto exitGate
		if ($airportDest != "") goto enterAirship
		goto quit
		
		:enterAirship
		do move 308 76 lighthalzen
		goto quit
		
		:exitGate
		do move 294 76 lighthalzen
		
		:quit
	}
}

automacro airshipraFild12 {
	location ra_fild12
	timeout 90
	delay 5
	call {
		if ($airportDest == "Rachel") goto arrived
		goto quit
		
		:arrived
		$airportDest = $emptyVar
		
		:quit
	}
}

automacro airshipYunoAirport {
	location y_airport 90 45 193 13
	timeout 90
	delay 5
	call {
		if ($airportDest == "Yuno") goto leaveAirport
		if ($airportDest != "") goto enterTerminal
		goto quit
		
		:enterTerminal
		do move 143 38 y_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 yuno
		
		:quit
	}
}

# Left 141 63: Izlude Yuno Rachel
# Right 144 63 : Yuno Hugel Einbroch Lighthalzen
automacro airshipYunoTerminal {
	location y_airport 116 74 167 50
	timeout 90
	delay 5
	call {
		if ($airportDest == "Yuno") goto leaveTerminal
		if ($airportDest != "") goto enterGate
		goto quit
		
		:enterGate
		if ($airportDest == "Izlude") goto leftGate
		if ($airportDest == "Rachel") goto leftGate
		if ($airportDest == "Hugel") goto rightGate
		if ($airportDest == "Einbroch") goto rightGate
		if ($airportDest == "Lighthalzen") goto rightGate
		goto quit
		
		:leftGate
		do talk @npc (141 63)
		pause 2
		do talk resp 0
		goto quit
		
		:rightGate
		do talk @npc (144 63)
		pause 2
		do talk resp 0
		goto quit
		
		:leaveTerminal
		do talk @npc(143 51)
		pause 2
		do talk resp 0
		pause 2
		do talk resp 0
		
		:quit
	}
}

automacro airshipYunoLeftGate {
	location yuno 5 279 51 238
	timeout 90
	delay 5
	call {
		if ($airportDest == "Yuno") goto exitGate
		if ($airshipTransfer == "True") goto transferedAirships
		if ($airportDest != "") goto enterAirship
		goto quit
		
		:enterAirship
		do move 8 261 yuno
		goto quit
		
		:transferedAirships
		$airshipTransfer = "False"
		
		:exitGate
		do move 52 238 yuno
		
		:quit
	}
}

automacro airshipYunoRightGate {
	location yuno 56 279 97 238
	timeout 90
	delay 5
	call {
		if ($airportDest == "Yuno") goto exitGate
		if ($airshipTransfer == "True") goto transferedAirships
		if ($airportDest != "") goto enterAirship
		goto quit
		
		:enterAirship
		do move 97 260 yuno
		goto quit
		
		:transferedAirships
		$airshipTransfer = "False"
		
		:exitGate
		do move 55 238 yuno
		
		:quit
	}
}

automacro airshipLanded {
	#console /The Airship is leaving the ground. Our next destination is (.*)./
	#console /We are heading to (.*)./
	console /We will arrive in (.*) shortly./
	#console /Welcome to (.*). Have a safe trip./	
	call {
		if ($airportDest == $.lastMatch1) goto exitAirport
		if ($.lastMatch1 == "Juno") goto checkYuno
		if ($airshipTransfer == "True") goto checkTransfer
		goto quit
		
		:checkTransfer
		if ($.lastMatch1 == "Yuno") goto exitAirport
		if ($.lastMatch1 == "Juno") goto exitAirport
		goto quit
		
		:checkYuno
		if ($airportDest == "Yuno") goto exitAirport
		if ($airshipTransfer == "True") goto checkTransfer
		goto quit
		
		:exitAirport
		do move 243 74
		
		:quit
	}
}

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

Re: Airship Macro

#2 Post by muszyka »

is this macro working?
Image

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

Alexander
Noob
Noob
Posts: 11
Joined: 29 May 2008, 12:00
Noob?: Yes

Re: Airship Macro

#3 Post by Alexander »

Pretty sure it works :o

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

Re: Airship Macro

#4 Post by muszyka »

its working, thnx
Image

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

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

Re: Airship Macro

#5 Post by muszyka »

ei, i have a problem in yuor macro when i update my bot in 2.0.6.1

this is the problem....

OpenKore version 2.0.6
SVN revision: unknown
Loaded plugins:
plugins/macro.pl (macro)

Error message:
Cannot load control file macros.txt

Stack trace:
Trace begun at C:\Documents and Settings\Mark\Desktop\openkore-2.0.6\src\Settings.pm line 389
Settings::loadByHandle(47) called at C:\Documents and Settings\Mark\Desktop\openkore-2.0.6\plugins\macro.pl line 58
macro::onstart3('start3', undef, undef) called at src\Plugins.pm line 440
Plugins::callHook('start3') called at src\functions.pl line 218
main::loadDataFiles at src\functions.pl line 81
main::mainLoop at src\Interface.pm line 75
Interface::mainLoop('Interface::Console::Win32=HASH(0x248c7e8)') called at openkore.pl line 96
main::__start at start.pl line 119

Died at this line:
$filename = $object->{name} if (!defined $filename);
* if ($object->{type} == CONTROL_FILE_TYPE) {
FileNotFoundException->throw(
Image

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

User avatar
help_us
Testers Team
Testers Team
Posts: 106
Joined: 04 Apr 2008, 21:53
Noob?: No
Location: Asia
Contact:

Re: Airship Macro

#6 Post by help_us »

muszyka wrote: Error message:
Cannot load control file macros.txt
have you seen this?
Image
Image

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

Re: Airship Macro

#7 Post by muszyka »

this is my fault, i make macro.txt instead of macros.txt... soryyy
Image

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

ezza
Developers
Developers
Posts: 109
Joined: 04 Apr 2008, 09:50

Re: Airship Macro

#8 Post by ezza »

muszyka wrote:this is my fault, i make macro.txt instead of macros.txt... soryyy

Its okay... we understand your problem. Alot of idiot out there do the same mistake as yours after they read the manual brainlessly. They just report "Hey my macro not working... blablablabla".



p.s: Its so common... we can accept the idiotic epidemic :roll:

sli
Perl Monk
Perl Monk
Posts: 810
Joined: 04 Apr 2008, 17:26
Noob?: No

Re: Airship Macro

#9 Post by sli »

The noob disease.
cs : ee : realist

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

Re: Airship Macro

#10 Post by muszyka »

I have a problem when I using this macro, the problem is when I command my bot to go to einbroch the bot stuck at yuno left gate...
Last edited by muszyka on 19 Sep 2008, 04:50, edited 2 times in total.
Image

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

Post Reply