[help] Alberta Daily Quest for Valkyrie Server pRO

All about the macro plugin can be found in this forum. This forum is intended for the macro plugin only.

Moderator: Moderators

ever_boy_
Developers
Developers
Posts: 308
Joined: 06 Jul 2012, 13:44
Noob?: No

Re: [help] Alberta Daily Quest for Valkyrie Server pRO

#21 Post by ever_boy_ »

raine101 wrote:

Code: Select all

automacro resetBoats-a {
   console /^\[Quest\] Port Manager#: Here/i
   call {
      $i = 0
	  log Number of boats: $i
   }
}

automacro resetBoats-b {
   console /^\[Quest\] Port Manager#: Why/i
   call {
      $i = 0
	  log Number of boats: $i
   }
}

automacro resetBoats-c {
   console /^\[Quest\] Port Manager#: How can I help you?/i
   call {
      $i = 0
	  log Number of boats: $i
   }
}

Code: Select all

automacro resetBoats {
   console /^\[Quest\] Port Manager#: (Why|Here|How can I help you)/i
   call {
      $i = 0
	  log Number of boats: $i
   }
}
arenole
Noob
Noob
Posts: 6
Joined: 05 Dec 2012, 06:20
Noob?: Yes

Re: [help] Alberta Daily Quest for Valkyrie Server pRO

#22 Post by arenole »

Code: Select all


automacro AlbertaCargoDeliveryQuest {
   priority 1
   run-once 1
   location alberta
   call {
      $randomHX = @random ("94","95","96","97","98")
             $randomHY = @random ("60","61","62","63","64")
             do move alberta $randomHX $randomHY
      do talknpc 90 62 c c c r0 c c n
      stop
   }
}

automacro countBoats {
   console /^NPC \[Quest\] Port Manager# \(\d+\) shown minimap indicator/i
   call {
      [
      $i++
      ]
   }
   }
automacro answerBoats {
   console /^\[Quest\] Port Manager#: Type 'talk text'/i
   call {
     pause 5
      do talk text $i
     }
}
automacro answerBoats2 {
   console / MIMICs of all things!/i
   run-once 1
   delay 5
   call {
      do talk resp 0
      }
}

automacro resetBoats-a {
   console /^\[Quest\] Port Manager#: Here/i
   call {
      $i = 0
     log Number of boats: $i
   }
}

automacro resetBoats-b {
   console /^\[Quest\] Port Manager#: Why/i
   call {
      $i = 0
     log Number of boats: $i
   }
}

automacro resetBoats-c {
   console /^\[Quest\] Port Manager#: How can I help you?/i
   call {
      $i = 0
     log Number of boats: $i
   }
}

automacro 1stBracket {
   console /You can easily recognize the first crate/
   base >= 1
   base <= 20
   exclusive 1
   run-once 1
   call {
      call 1stCrate
      call HomeNPC
      log 1st Crate done!
      log Quest Complete!
      stop
   }
}

automacro 2ndBracket {
   console /You can easily recognize the first crate/
   base >= 21
   base <= 40
   exclusive 1
   run-once 1
   call {
      call 1stCrate
      call HomeNPC
      log 1st Crate done!
      call 2ndCrate
      call HomeNPC
      log 2nd Crate done!
      log Quest Complete!
      stop
   }
}

automacro 3rdBracket {
   console /You can easily recognize the first crate/
   base >= 41
   base <= 60
   exclusive 1
   run-once 1
   call {
      call 1stCrate
      call HomeNPC
      log 1st Crate done!
      call 2ndCrate
      call HomeNPC
      log 2nd Crate done!
      call 3rdCrate
      call HomeNPC
      log 3rd Crate done!
      log Quest Complete!
      stop
   }
}

automacro 4thBracket {
   console /You can easily recognize the first crate/
   base >= 61
   base <= 80
   exclusive 1
   run-once 1
   call {
      call 1stCrate
      call HomeNPC
      log 1st Crate done!
      call 2ndCrate
      call HomeNPC
      log 2nd Crate done!
      call 3rdCrate
      call HomeNPC
      log 3rd Crate done!
      call 4thCrate
      call HomeNPC
      log 4th Crate done!
      log Quest Complete!
      stop
   }
}

automacro 5thBracket {
   console /You can easily recognize the first crate/
   base >= 81
   base <= 97
   exclusive 1
   run-once 1
   call {
      call 1stCrate
      call HomeNPC
      log 1st Crate done!
      call 2ndCrate
      call HomeNPC
      log 2nd Crate done!
      call 3rdCrate
      call HomeNPC
      log 3rd Crate done!
      call 4thCrate
      call HomeNPC
      log 4th Crate done!
      call 5thCrate
      call HomeNPC
      log 5th Crate done!
      log Quest Complete!
      stop
   }
}

automacro 6thBracket {
   console /You can easily recognize the first crate/
   base >= 98
   exclusive 1
   run-once 1
   call {
      call 1stCrate
      call HomeNPC
      log 1st Crate done!
      call 2ndCrate
      call HomeNPC
      log 2nd Crate done!
      call 3rdCrate
      call HomeNPC
      log 3rd Crate done!
      call 4thCrate
      call HomeNPC
      log 4th Crate done!
      call 5thCrate
      call HomeNPC
      log 5th Crate done!
      call 6thCrate
      call HomeNPC
      log 6th Crate done!
      log Quest Complete!
      stop
   }
}

macro 1stCrate {
   $randomX1 = @random ("187","188","189","190","191")
   $randomY1 = @random ("164","165","166","167","168")
   do move $randomX1 $randomY1
   pause 2
   $i = 0
   while ($i < 5) as loop
      do talknpc 188 173 c n
      $i++
   end loop
   stop
}

macro 2ndCrate {
   $randomX2 = @random ("224","225","226","227","228")
   $randomY2 = @random ("102","103","104","105","106")
   do move $randomX2 $randomY2
   pause 2
   $i = 0
   while ($i < 5) as loop
      do talknpc 232 104 c n
      $i++
   end loop
   stop
}

macro 3rdCrate {
   $randomX3 = @random ("238","239","240","241","242")
   $randomY3 = @random ("88","89","90","91","92")
   do move $randomX3 $randomY3
   pause 2
   $i = 0
   while ($i < 5) as loop
      do talknpc 246 87 c n
      $i++
   end loop
   stop
}

macro 4thCrate {
   $randomX4 = @random ("238","239","240","241","242")
   $randomY4 = @random ("64","65","66","67","68")
   do move $randomX4 $randomY4
   pause 2
   $i = 0
   while ($i < 5) as loop
      do talknpc 245 67 c n
      $i++
   end loop
   stop
}

macro 5thCrate {
   $randomX5 = @random ("235","236","237","238","239")
   $randomY5 = @random ("40","41","42","43","44")
   do move $randomX5 $randomY5
   pause 2
   $i = 0
   while ($i < 5) as loop
      do talknpc 243 43 c n
      $i++
   end loop
   stop
}


macro 6thCrate {
   $randomX6 = @random ("114","115","116","117","118")
   $randomY6 = @random ("215","216","217","218","219")
   do move alberta 105 153
   pause 2
   do move alberta 110 221
   pause 2
   do move $randomX6 $randomY6
   pause 2
   do talknpc 123 221 c n
   pause 2
   do move alberta 110 221
   pause 2
   do move alberta 105 153
   pause 2
   stop
}

macro HomeNPC {
   $randomHX = @random ("94","95","96","97","98")
   $randomHY = @random ("60","61","62","63","64")
   do move $randomHX $randomHY
   pause 2
   do talknpc 90 62 c n
   stop
}


i put all the codes together and tried it but it failed.. it didn't give the correct answer to the port npc... can u tell me what is wrong with this..
sorry about that.. i dont know what to change to make this macro work.. i just copied this from the previous post and combined the countBoats auto macro.
Last edited by arenole on 19 Dec 2012, 18:33, edited 6 times in total.
NiTRO106
Plain Yogurt
Plain Yogurt
Posts: 64
Joined: 30 Nov 2012, 20:27
Noob?: No

Re: [help] Alberta Daily Quest for Valkyrie Server pRO

#23 Post by NiTRO106 »

@arenole: next time, please paste your macro in code form (the

Code: Select all

 bracket). it seems that after the brackets have triggered (from 1stBracket to 6thBracket), the macro will not read the other automacros because of the [b]exclusive[/b] command. try to remove it from the brackets and try to run your macro again.
raine101
Noob
Noob
Posts: 12
Joined: 30 Oct 2012, 00:59
Noob?: No

Re: [help] Alberta Daily Quest for Valkyrie Server pRO

#24 Post by raine101 »

Thanks for that edit on my 3 macros @ever_boy_

@arenole: here's the full macro that i've been using.. again, it's metalmarine's macro --->> http://forums.openkore.com/viewtopic.php?f=55&t=15699

Code: Select all

#####INSTRUCTION:####
# *READ, READ AND READ FIRST
# *
# *FOLLOW INSTRUCTIONS:
# *   -FOR THE FIRST TIME USER OF THIS MACRO LEAVE ALL YOUR CHARACTER IN PRONTERA, THEY WILL BE SORTED IF THEY ARE QUALIFIED TO DO PRONT QUEST OR ALBERTA QUEST,
# *   -KEEP IN MIND THAT THIS MACRO IS INTENDED TO DO DAILY QUEST FOR USERS WHO JUST BOT FOR DAILY QUEST AND NO MORE   
# *   -YOU JUST NEED TO EDIT changeCHAR macro AT THE BOTTOM, ctrl + f, find "changeCHAR".
# *      - put your username and pass, your char's slot
# *      - choose quest for each of your char to do, for your first queue char's quest choices its in "questCHOICE" macro
# *      - if you want to bot more or less, just edit changeCHAR macro, its easy to follow the pattern.
#########REQUIREMENTS########
#MUST HAVE ZENY AND WHITE POTION(AT STORAGE) 
#MUST HAVE 2k FREE WEIGHT
#MUST/MAY HAVE 10 GREEN HERB   
#
#NOTE: ITS OK IF YOU DON'T HAVE ALL REQUIREMENTS, BUT ATLEAST HAVE ZENY, IT WON'T DO OR WILL SKIP THE QUEST IF YOU DON'T HAVE THE REQUIREMENTS
#
#
##########SUMMARY: ##########
#QUEST REQUIRED LVL:
#ARMY SUPPLY : 61 TO 150
#DONATION:     60 TO 99
#CARGO DELIVERY: 1 TO 99
#STICKY RAT:   1 TO 150
#MSG DELIVERY: 1 TO 150
#GEFFEN MASTER THIEF 21 TO 150
#
############NOTES:##########
#PROBLEM YOU MIGHT ENCOUNTER(I DID)##
#SEE THE BOTTOM PART OF THIS MACRO
#
#
#IF THERE IS A QUEST THAT DOESN'T WORK FOR A CERTAIN CHAR, BUT THE QUEST WORKS FINE TO ALL CHARS, MANUALLY DO THE QUEST.
#
#
#
########UPDATE#######
#ADDED questCHOICE OPTION
#-YOU MAY NOW CHOICE WHICH QUEST YOU DON'T WANT TO DO
#JUST
# TOGGLE 1 FOR YES, DO THE QUEST
# TOGGLE 0 FOR NO, SKIP THE QUEST
#
#IT IS LOCATED AT THE BOTTOM WITHIN changeCHAR macro
#
# $army = Army Supply Quest
# $donation = Church donation
# $cargo = Cargo delivery
# $swab = Swab the deck/Sticky Rat Quest
# $message = Message Delivery Quest
# $geffen = Master Thief Quest(not yet coded)
#
#####DISCLAIMER######
#CODES WITH TABS/INDENT AREN'T MINE, CARGO QUEST is from botter community AND changeCHAR macro is from an openkore member.
#ANYONE MAY DISTRIBUTE AND EDIT THIS ^_^. 
#I JUST DON'T LIKE IT TO BE SOLD OUT
#FREE LIBRE gratuitement libero bezmaksas frei
#
####FUTURE UPDATE I WANT TO ADD, MAY BE AFTER A MONTH OR TWO####
#   AUTOBUY WHITE POTION AT NPC
#   VARIABLEs TO TOGGLE IF A QUEST HAS BEEN DONE, SO THAT YOU LEAVE YOUR CHAR IN EITHER PRONT OR ALBERTA
#   AND
#   ADD COMMENTS FOR THIS TO BE READ EASILY
#   AND ALSO
#   A RESTRUCTURING OF CODES, REMOVING UNNECESSARY LINES, CODES, COMMENTS, LOGIC, ETC
#   
#
#   MORE IMPROVEMENTs TO COME ^_^
#

#made by: metalmarine
#

#   MUCH BETTER IF WE HAVE A COMMUNITY TO IMPROVE THIS. 





#EDIT questCHOICE macro and changeCHAR if there's a quest you don't want to do for a certain char


macro questCHOICE {
#$slot has no value
$slot = $slot

if ($slot > 1) goto altered

#retain quest choices set $slot number in changeCHAR is altered
:retain
#THIS IS FOR YOUR FIRST CHARACTER QUEST'S CHOICE
$catchedrat = 1 #FOR MSG DELIVERY QUEST
$army = 0
$donation = 1
$swab = 1
$cargo = 1
$message = 1
$geffen = 0


if (($army = 0) && ($donation = 0) && ($swab = 0) && ($message = 0)) goto chars
goto cont

:cont
if (($army = 0) && ($donation = 0) && ($swab = 0) && ($message = 0)) goto chars
stop
:altered
stop

:chars
call changeCHAR
stop
}

####START YOUR DAILY QUEST#####
macro dq {
do move prontera 168 193
release all
}

#TALK WITH ARMY SUPPLY
#CHECK FOR WHITE POTION
#IF YOU ARE 99/50 or 99/70 YOU'LL SKIP ARMY SUPPLY AND DONATION, BETTER EDIT THIS IF YOU HAVE A 99/50 TRANS CHAR
#IF YOU'RE IN PRONTERA, AND YOUR LVL IS LESs THAN LVL60 YOU'LL GO TO ALBERTA STRAIGHT
#
automacro prontQUEST {
map prontera
run-once 1
priority 5
call PRONTquest
}

macro PRONTquest {
call questCHOICE
log army = $army donation = $donation swab = $swab cargo = $cargo message = $message geffen = $geffen


if (($army = 0) && ($donation = 0)) goto warptoalb

$baselvl = $.lvl
$jlvl = $.joblvl
if (($baselvl < 60) || (($jlvl = 70) && ($baselvl = 99)) || (($jlvl = 50) && ($baselvl = 99))) goto warptoalb
goto prontquest

:warptoalb
log EITHER ARMY SUPPLY IS SET TO 0 OR NOT ENOUGH SUPPLY
call warpALB
stop

:prontquest
do move prontera 168 193
pause 2

#TALK DONATION NPC
if (($baselvl >= 60) && ($baselvl <= 99)) goto donate
goto supply

:donate
log DONATING TO THE CHURCH
pause 2
do talknpc 165 191 r1 n
pause 2

if ($baselvl >= 61) goto supply
goto warptoALB
stop

:supply
do talknpc 159 191 r1 n
pause 1


do move prontera 277 199
pause 3

$wPot = @invamount(White Potion) #inventory white potion count

if ($wPot < 100) goto storewp
goto skipstore

:storewp
do talknpc 282 200 r1
pause 2

#IF YOUR LVL IS BELOW 80 YOU JUST NEED TO BRING 5 WHITE POTZ, IF YOUR ABOVE, 100.
if ($baselvl <= 80) goto five
goto hundred
:five
do storage get @storage (White Potion) @eval(5 - $wPot)
goto donestore
:hundred
do storage get @storage (White Potion) @eval(100 - $wPot)
:donestore
pause 1
do storage close
$wPot = @invamount(White Potion) #inventory white potion count
if ((($wPot < 100) && ($baselvl > 80)) || (($wPot < 5) && ($baselvl <= 80))) goto warptoalb

pause 3

:skipstore
do talknpc 282 200 r2 r3
pause 4
do move morocc 173 104
pause 2

}

#THE ARMY SUPPLY WAS ALREADY DONE OR NOT YET COOLED DOWN, SO MOVE DIRECTLY TO ALBERTA
automacro doneSUPP {
console /be injured armies who need your help/i
run-once 1
exclusive 1
call warpALB
}


macro warpALB {
log WILL GO TO ALBERTA
do move prontera 277 199
pause 2
log WARPING FROM PRONT TO ALBERTA
do talknpc 282 200 r2 r5
}




#IN MORROC, TALK WITH MORROC SOLDIER


automacro inmoc {
map morocc
run-once 1
timeout 90
call {
do move @random ("173","172","171","170") 104
release all
}
}

automacro mocsold {
location morocc 173 104, morocc 172 104, morocc 170 104, morocc 171 104
console /Injured (.*) .* /i
run-once 1
timeout 10
exclusive 0
call talksold
}

#TALK WITH THE SOLDIER WHERE YOUR LVL BELONGS
macro talksold {
$baselvl = $.lvl
log $baselvl
if ($baselvl <= 80) goto rec
if ($baselvl <= 97) goto vet
if ($baselvl >= 98) goto eli
goto end
:rec
do talknpc 164 108 r1
goto end
:vet
do talknpc 167 108 r1
goto end
:eli
do talknpc 170 108 r1
pause 2
:end
release mocsold
}

#EITHER DONE TALKING WITH THE SOLDIER OR NOT ENOUGH POTION, MUST GO TO ALBERTA

automacro doneMoc {
console /so sick/i
run-once 1
exclusive 1
delay 3
call goalberta
}

#YOU ALREADY GAVE THE POTION
automacro gavepotz {
console /Thanks to your potion/i
run-once 1
exclusive 1
delay 3
call goalberta
}

#GOING TO ALBERTA THROUGH KAFRA

macro goalberta {
log FROM MORROC WARPING TO ALBERTA
$x = @rand (160, 163)
do move morocc $x 100
do talknpc 156 97 r2 r2
pause 4
}

#IN ALBERTA, TALK FIRST WITH THE STICKY RAT NPC

#automacro swabthedeck {
#location alberta 117 56, alberta 116 57
#delay 1
#exclusive 0
#priority 1
#run-once 1
#call talkswab
#}





#YOU HAVEN'T YET DONE TURTLE ISLE QUEST, SO DO THE QUEST
automacro lostNPC {
console /cannot calculate a route from alberta \((\d+),(\d+)\) to tur_dun01 .*/i
run-once 1
exclusive 1
call {
do move alberta_in 22 107
pause 1
do talknpc 23 104 r0 r0
pause 2
do talknpc 23 104 r1 n
pause 2
do move alberta
do reload portal
do reload macro

log $locx $locy
release all
}
}

#IF THERE'S NO NPC, RELOAD THE MACRO
automacro noNPC {
console /could not find an npc/i
run-once 1
call {
do relog
do reload macro
release noNPC
}
}



###ALBERTA QUEST######
#START THE QUEST
automacro STARTQUEST {
location alberta
priority 5
exclusive 0
call PORTNPC
run-once 1
#timeout 15
}

#END TALKING TO MIMIC
automacro ENDmimic1 {
console /before it changes its mind/
call PORTNPC
timeout 5
}

automacro ENDmimic2 {
console /have already moved/
call PORTNPC
timeout 5
}

# TALK TO MIMIC AGAIN
automacro RETALKmimic {
#location alberta
console /Deadly Cargo (.*) That/
call retalkMIMIC
timeout 0
}


automacro MIMIC1-a {
console /recognize the first crate/
call {
$mimic = first
call talkMIMIC
}
timeout 5
}

automacro MIMIC1-b {
priority 2
console /get me the first crate/
call {
$mimic = first
call talkMIMIC
}
timeout 5
}

automacro MIMIC2-a {
priority 2
console /retrieve the second crate/
call {
$mimic = second
call talkMIMIC
}
timeout 5
}

automacro MIMIC2-b {
priority 2
console /get me the second crate/
call {
$mimic = second
call talkMIMIC
}
timeout 5
}



automacro MIMIC3-a {
priority 2
console /third crate should be with/
call {
$mimic = third
call talkMIMIC
}
timeout 5
}

automacro MIMIC4-a {
priority 2
console /get me the fourth crate/
call {
$mimic = fourth
call talkMIMIC
}

timeout 5
}

automacro MIMIC5-a {
priority 2
console /find the fifth crate/
call {
$mimic = fifth
call talkMIMIC
}

timeout 5
}

automacro MIMIC6-a {
priority 2
console /sixth create has been found/
call {
$mimic = sixth
call talkMIMIC
}
timeout 5
}

automacro MIMIC6-b {
priority 2
console /our wounded scouts have reported/
call {
$mimic = sixth
call talkMIMIC
}
timeout 5
}

#CARGO QUEST FINISHED, DO THE NEXT QUEST: SWAB THEN MSG DELIVERY
automacro FINISHa {
console /already did work for today/
exclusive 1
priority 4
call doswab
timeout 5
}

automacro FINISHb {
console /boxes are not arrived/i
exclusive 1
priority 4
call doswab
timeout 5
}


#######MACROS###########


macro PORTNPC {
call questCHOICE
if ($cargo = 0) goto swab
$baselvl = $.lvl
if ($baselvl > 99) goto swab
goto port
:swab
call doswab
stop
:port
$x = @random ("94","95","96","97","98")
$y = @random ("67","68","69","70","71")
do move alberta $x $y
pause 1
do talk @npc(90 62)
}


macro talkMIMIC {
pause 1
if ($mimic == first) goto mimic1
if ($mimic == second) goto mimic2
if ($mimic == third) goto mimic3
if ($mimic == fourth) goto mimic4
if ($mimic == fifth) goto mimic5
if ($mimic == sixth) goto mimic6
stop
:mimic1
$x = @random ("187","188","189","190","191")
$y = @random ("164","165","166","167","168")
do move $x $y
pause 1
do talknpc 188 173 c n
stop
:mimic2
$x = @random ("224","225","226","227","228")
$y = @random ("102","103","104","105","106")
do move $x $y
pause 1
do talknpc 232 104 c n
stop
:mimic3
$x = @random ("238","239","240","241","242")
$y = @random ("88","89","90","91","92")
do move $x $y
pause 1
do talknpc 246 87 c n
stop
:mimic4
$x = @random ("238","239","240","241","242")
$y = @random ("64","65","66","67","68")
do move $x $y
pause 1
do talknpc 245 67 c n
stop
:mimic5
$x = @random ("235","236","237","238","239")
$y = @random ("40","41","42","43","44")
do move $x $y
pause 1
do talknpc 243 43 c n
stop
:mimic6
$x = @random ("114","115","116","117","118")
$y = @random ("215","216","217","218","219")
do move $x $y
pause 1
do talknpc 123 221 c n
stop
}

macro retalkMIMIC {
$num = $.lastMatch1
goto mimic
stop
:mimic
if ($num == [1]#:) goto retalk1
if ($num == [2]#:) goto retalk2
if ($num == [3]#:) goto retalk3
if ($num == [4]#:) goto retalk4
if ($num == [5]#:) goto retalk5
if ($num == [6]#:) goto retalk6
stop
:retalk1
do talknpc 188 173 c n
goto end
:retalk2
do talknpc 232 104 c n
goto end
:retalk3
do talknpc 246 87 c n
goto end
:retalk4
do talknpc 245 67 c n
goto end
:retalk5
do talknpc 243 43 c n
goto end
:retalk6
do talknpc 123 221 c n

:end
release RETALKmimic
}




#CHECK IF YOU HAVE MYSTIC BALL OR IF YOU MUST CATCH RATS

macro doswab {
do ai auto
do move alberta 114 55

if ($swab = 0) goto skipswab
goto swab

:skipswab
call talkmessage
stop

:swab
pause 2

$mcatball = @invamount (Mystic Leaf Cat Ball)

if ($mcatball > 0) goto pasamystic
goto mustcatch

:pasamystic
do talknpc 104 60 r0 n
pause 2
do talknpc 104 60 c n
pause 2
call talkmessage
goto end

#ASK THE NPC FOR LEAF CAT BALLS
:mustcatch
$lball = @invamount(Leaf Cat Ball)
while ($lball < 5) as lball
do talknpc 104 60 r0 n
pause 1
do talk no
$lball++
log $lball
end lball


#NOW, MOVE TO ALBERTA SHIP WHERE MOST STICKY RAT RESPAWN
if ($lball = 5) goto catchem
goto end
:catchem
do move alb_ship @rand (121,125) @rand (99,100)
log moving to alb_ship
do conf attackAuto 2
$ai = ai
do $ai clear
pause 1

:end

#release swabthedeck
}

#IF YOU STILL HAVE A LEAF BALL, BE AGGRESSIVE
automacro sticky {
inventory "Leaf Cat Ball" > 0
monster Sticky Rat
run-once 1
exclusive 1
timeout 40
delay 0
call sticky
}

#AUTO ATTACK RATS

macro sticky {
do conf attackAuto 2
pause 0
release sticky
}

#YOU ARE NOW ATTACKING A RAT, WHILE YOU ATTACK AND HAVE LEAF BALL TRY TO CATCH RAT
#IF YOU RUN OUT OF LEAF BALL, BACK TO TOWN TO DELIVER THE MYSTIC BALL
#AND THEN TURN AUTOATTACK OFF

automacro mindexa {
console /You are now attacking Monster Sticky Rat \((\d+)\)/i
run-once 1
exclusive 1
timeout 8
delay 2
priority 3
call mindex
}


automacro mindex {
console /Monster Sticky Rat \((\d+)\) attacks you/i
run-once 1
exclusive 1
priority 2
timeout 8
delay 0
call mindex
}

#MONSTER TO BE CATCH TRIGGERED
macro mindex {
$lball = @invamount (Leaf Cat Ball)
if ($lball = 0) goto return
goto cont
:return
$catchedrat = 1
do conf attackAuto 0

pause 1
do move alberta 117 56
pause 2
$mball = @inventory (Mystic Leaf Cat Ball)

if (($mball > 0) && ($lball =< 0)) goto pass
call doswab
stop

:pass
do talknpc 104 60 r0 n
call msgdelivery
pause 1

:cont
$m = $.lastMatch1
log $m
do im @inventory (Leaf Cat Ball) $m
pause 0
do pet c $m
#do conf attackAuto 0
release mindex
release mindexa
}


#IF ALREADY DONE STICKY RAT QUEST MOVE TO MESSENGER QUEST


automacro calltalkm {
console /Here is the list/i
run-once 1
exclusive 0
delay 4
priority 4
call talkmessage
}


automacro donemessage {
console /already delivered all the letters/
exclusive 1
priority 0
run-once 1
call returnpront
}



#MESSENGER QUEST
#TALK MESSAGE HAS A PATHWAY BEFORE TALKING, BECAUSE OPENKORE DOESN'T RECOGNIZES MSG DELIVERY NPC AFTER TELEPORTING TO ALBERTA OR RELOG

macro talkmessage {
if ($message = 0) goto repront
goto talkmsg

:repront
call returnpront
stop

:talkmsg
$baselvl = $.lvl
#AFTER YOU FINISHED CARGO QUEST, MSG DELIVERY NPC IS ALREADY RECOGNIZED, NO NEED TO MOVE AWAY-BACK 
if (($baselvl <= 99) || (($cargo = 1) && ($baselvl <= 99))) goto skip
if ($cargo = 0) goto walkaway
:walkaway
pause
if ($catchedrat = 1) goto skip
do west
pause 1
do west
pause 1
do west
pause 1
do east
pause 1
do east
do east
pause 2
:skip
pause 2
call msgdelivery
}


#TALK WITH THE MSG DELIVERY NPC ACCORDING TO YOUR LVL BRACKET
macro msgdelivery {
pause 5
$jlvl = $.joblvl
$baselvl = $.lvl
if ((($jlvl = 70) && ($baselvl = 99)) || (($jlvl = 50) && ($baselvl = 99))) goto futile
goto proceed

:futile
call returnpront
stop

:proceed
$blvl = $.lvl
if ($blvl <= 20) goto txta
if ($blvl <= 40) goto txtb
if ($blvl <= 60) goto txtc
if ($blvl <= 80) goto txtd
if ($blvl <= 150) goto txte
goto end

:txta
do talknpc 122 55 r0 r0 n
$randomX1 = @random ("54","55","56","57","58")
$randomY1 = @random ("74","75","76","77","78")
do move alberta $randomX1 $randomY1
pause 2
do talknpc 56 80 c n
call returnpront
stop

:txtb
do talknpc 122 55 r0 r1 n
$randomX1 = @random ("61","62","63","64","65")
$randomY1 = @random ("65","66","67","68","69")
do move alb2trea
pause 2
do move alb2trea $randomX1 $randomY1
pause 2
do talknpc 57 67 c n
call returnpront
stop


:txtc
do talknpc 122 55 r0 r2 n
$randomX1 = @random ("98","99","100","101","102")
$randomY1 = @random ("114","115","116","117","118")
do move alberta 109 59
pause 1
do talknpc 113 60 r2 r2 #warp to pront
pause 2
do move prontera $randomX1 $randomY1
pause 2
do talknpc 104 116 c n
$messagedone = 1
call returnpront
stop

:txtd
do talknpc 122 55 r0 r3 n
$randomX1 = @random ("123","124","125","126","127")
$randomY1 = @random ("172","173","174","175","176")
do move izlude 125 150
pause 2
do move izlude $randomX1 $randomY1
pause 2
do talknpc 121 174 c n
call returnpront
stop

:txte
do talknpc 122 55 r0 r4 n
$randomX1 = @rand (190,194)
$randomY1 = @rand (104,105)
do move tur_dun01
pause 2
do move tur_dun01 $randomX1 $randomY1
pause 2
do talknpc 192 117 c n
call returnpront
stop

:end
call returnpront
}



#AFTER DOING THE MESSENGER QUEST, EITHER RETURN BACK TO PRONTERA TO
#FINISH THE ARMY SUPPLY QUEST OR DO GEFFEN QUEST 


macro returnpront {
lock prontQUEST #PRONT QUEST AND ALBERTA QUEST HAS BEEN DONE SO WE HAVE COME HERE
$map = $.map
log VAR GEF = $geffen
lock findTHIEF
$re = @inventory (Red Potion)
$or = @inventory (Orange Potion)
$ye = @inventory (Yellow Potion)
$wh = @inventory (White Potion)
$bl = @inventory (Blue Potion)
$yg = @inventory (Yggdrasil Seed)
$blvl = $.lvl
$gherb = @invamount (Green Herb)
$donestore = 1

if ($geffen = 1) goto gefquest #WE HAVEN'T DONE GEFFEN QUEST
goto returnprontera


:gefquest
log WE MIGHT DO GEF QUEST
if ($map = izlude) goto storeinizlude
if ($map = prontera) goto storeinpront
goto storeinalb

:storeinizlude
do move 134 90
do talknpc 134 88 r1
goto storing

:storeinpront
do move 145 89
pause 1
do talknpc 146 89 r1 #storage
goto storing


:storeinalb
do move alberta @rand(108,110) 59
log MOVING TO ALBERTA
pause 1
do talknpc 113 60 r1

:storing
if ($gherb >= 10) goto re
pause 2
do storage get @storage (Green Herb) @eval (10 - $gherb)
:re
if ($re < 1) goto or
do storage add @inventory (Red Potion)
:or
if ($or < 1) goto ye
do storage add @inventory (Orange Potion)
:ye
if ($ye < 1) goto wh
do storage add @inventory (Yellow Potion)
:wh
if ($wh < 1) goto bl
do storage add @inventory (White Potion)
:bl
if ($bl < 1) goto yg
do storage add @inventory (Blue Potion)
:yg
if ($yg < 1) goto storeclose
do storage add @inventory (Yggdrasil Seed)
:storeclose
do storage close

$donestore = 1 #you've done storing
pause 1

$gherb = @invamount (Green Herb)
log I HAVE $gherb Green Herb and MY LEVEL IS $baselvl

if (($blvl > 20) && ($gherb >= 10) && ($geffen = 1)) goto gefQ
goto returnprontera

:gefQ

if ($map = prontera) goto pronttogef
if ($map = izlude) goto iztogef
goto gefQ1

:pronttogef
do talknpc 146 89 r2 r1 #AFTER STORAGE FROM PRONT, WARP TO GEFFEN
stop

:iztogef
do move izlude 134 90
do talknpc 134 88 r2 r0 #WARP FROM IZLUDE TO GEFFEN
stop

:gefQ1
log FROM $.map GOING TO ALBERTA TO PRONT TO GO TO GEFFEN
do move alberta 109 59
pause 1
do talknpc 113 60 r2 r2 #WARP TO PRONT
pause 1
do move 145 89
pause 1
do talknpc 146 89 r2 r1 #WARP TO GEFFEN
stop


:returnprontera

$map = $.map

if ($map = geffen) goto warptoPront
if ($map = izlude) goto movalberta
goto contini #YOU'RE IN PRONT OR ALBERTA

:warptoPront
log MOVING FROM GEFFEN TO PRONTERA
do move 116 63
pause 1
do talknpc 120 62 r2 r0
pause 1
goto inpront

:movalberta
do move alberta
call returnpront
stop


:contini
if (($map = prontera) && ($geffen = 0)) goto storeinpront1
if ($map = alberta) goto skipna










:storeinpront1
log WILL GO BACK FROM PRONT TO ALBERTA
do move 145 89
pause 1

goto store



:skipna

do move alberta 109 59
pause 2
if ($baselvl > 99) goto return #you don't need to store co'z u didn't receive anything.
goto store

:store

if ($donestore = 1) goto notneed
if (($re > 0) || ($or > 0) || ($ye > 0) || ($wh > 0) || ($bl > 0) || ($yg > 0)) goto dostore
goto notneed

:dostore
if ($map = prontera) goto prontkaf
goto albkaf

:prontkaf
do talknpc 146 89 r1 #STORE IN PRONTERA
goto putstore

:albkaf
do talknpc 113 60 r1
pause 1

:putstore
if ($re < 1) goto or1
do storage add @inventory (Red Potion)
:or1
if ($or < 1) goto ye1
do storage add @inventory (Orange Potion)
:ye1
if ($ye < 1) goto wh1
do storage add @inventory (Yellow Potion)
:wh1
if ($wh < 1) goto bl1
do storage add @inventory (White Potion)
:bl1
if ($bl < 1) goto yg1
do storage add @inventory (Blue Potion)
:yg1
if ($yg < 1) goto storeclose1
do storage add @inventory (Yggdrasil Seed)
:storeclose1
do storage close
:notneed

if ($map = prontera) goto prontissue
goto albissue

:prontissue
if ((($blvl < 60) && ($blvl > 20) && ($cargo = 0) && ($swab = 0) && ($message = 0)) || (($blvl > 59) && ($army = 0) || ($donation = 0))) goto stay
if (($blvl < 60) && ($blvl > 20) && (($cargo = 1) || ($swab = 1) || ($message = 1))) goto bacalb
goto albissue

:bacalb
do talknpc 146 89 r2 r5
pause 1
goto stay
#call returnpront


:albissue
pause 1
#do move alberta 120 58
#pause 2
if (($baselvl < 60) || (($jlvl = 70) && ($baselvl = 99)) || (($jlvl = 50) && ($baselvl = 99)) || (($donation = 0) && ($army = 0))) goto stay
goto return

:stay
call changeCHAR
stop

:return
do talknpc 113 60 r2 r2
pause 2

:inpront
$randx = @rand (166,170)
$randy = @rand (188,192)
do move prontera $randx $randy
do talknpc 159 191 c n
pause 1
call changeCHAR
}



automacro gefQUEST {
base >= 21
inventory "Green Herb" >= 10
map geffen
run-once 0
timeout 400
priority 2
exclusive 0
call gefcap
}
macro gefcap {
lock findTHIEF
$geffen = 0
log MOVING TO GEFFEN CAPTAIN's LOCATION
do move 128 115
pause 2
log TALKING TO THE CAPTAIN
do talknpc 127 115 r0 r0
call search
stop
}

automacro rereport {
console /He is in Alberta\./i
run-once 1
exclusive 1
priority 1
call geftoalb
}

automacro finGef {
console /I wil need your help again sometime soon\./i
run-once 1
exclusive 1
priority 1
call geftoalb
}
automacro finGef2 {
console /Maybe I will need your help again sometime soon/i
run-once 1
exclusive 1
priority 1
call geftoprontORalb
}

macro geftoalb {
$geffen = 0
do talk no
lock STARTQUEST
lock prontQUEST
log FROM GEFFEN GOING TO PRONT
do move 116 63
pause 1
do talknpc 120 62 r2 r0
pause 1
do move 145 89
pause 1
do talknpc 146 89 r2 r5
pause 1
do move 104 50
do talknpc 101 48 c n
call returnpront
release rereport
release finGef
}


macro geftoprontORalb {
$geffen = 0
do talk no
lock STARTQUEST
lock prontQUEST
log FROM GEFFEN GOING TO PRONT
do move 116 63
pause 1
do talknpc 120 62 r2 r0
pause 1
call returnpront
}

automacro findTHIEF {
base >= 21
inventory "Green Herb" >= 10
map geffen
run-once 1
exclusive 0
priority 4
call search
}
macro search {
do move geffen 145 163
do sit
pause 2
do stand
do move geffen 174 97
do sit
pause 2
do stand
do move geffen 138 31
do sit
do stand
do move geffen 76 96
do sit
pause 2
do stand
release findTHIEF
}


automacro foundTHIEF {
console /Tell me who you are/i
run-once 1
priority 3
delay 0
exclusive 0
call talkthief
}
macro talkthief {
#do relog 2
pause 3
do talk resp 0
pause 1
do talk resp 0
pause 1
do talk resp 0
release foundTHIEF
lock findTHIEF
}



automacro reportBACK {
console /you can not keep me last/i
run-once 1
exclusive 1
priority 1
delay 2
call report
}
macro report {
#do talk cont
pause 2
do move 128 115
do talknpc 127 115 c
pause 2
do talknpc 127 115 c
pause 5
do talknpc 101 48 c
pause 1
call returnpront
}

automacro albCAP {
console /know how to repay/i
priority 1
exclusive 1
run-once 1
call done
}

macro done {
log DONE GEFFEN THIEF
log DONE GEFFEN THIEF
log DONE GEFFEN THIEF
log DONE GEFFEN THIEF
call returnpront
}

automacro stoptalk {
console /Injured Master Thief.* \.\.\.\.\.\./i
run-once 1
exclusive 1
call {
do talk no
call report
release stoptalk
lock findTHIEF
}
}
macro changeCHAR {

   $uname1 = username
   $pword1 = password
   $slot1 = 1

   $uname2 = username
   $pword2 = password
   $slot2 = 2

   $uname3 = username
   $pword3 = password
   $slot3 = 3

   $uname4 = username
   $pword4 = password
   $slot4 = 2

   $uname5 = username
   $pword5 = password
   $slot5 = 4

   $uname6 = username
   $pword6 = password
   $slot6 = 0

   $uname7 = username
   $pword7 = password
   $slot7 = 0
   
   goto char
   stop

   :char
   if (($uname1 == @config(username)) && ($pword1 == @config(password)) && ($slot1 == @config(char))) goto secondchar
   if (($uname2 == @config(username)) && ($pword2 == @config(password)) && ($slot2 == @config(char))) goto thirdchar
   if (($uname3 == @config(username)) && ($pword3 == @config(password)) && ($slot3 == @config(char))) goto fourthchar
   if (($uname4 == @config(username)) && ($pword4 == @config(password)) && ($slot4 == @config(char))) goto fifthchar
   if (($uname5 == @config(username)) && ($pword5 == @config(password)) && ($slot5 == @config(char))) goto sixthchar
   if (($uname6 == @config(username)) && ($pword6 == @config(password)) && ($slot6 == @config(char))) goto seventhchar
   if (($uname7 == @config(username)) && ($pword7 == @config(password)) && ($slot7 == @config(char))) goto firstchar   
   stop

   :secondchar
   do conf username $uname2
   do conf password $pword2
   do conf char $slot2
$slot = 2
$army = 1
$donation = 1
$swab = 1
$cargo = 1
$message = 1
$geffen = 1
   do relog 5
   do reload macro
do $ai clear
   stop

   :thirdchar
   do conf username $uname3
   do conf password $pword3
   do conf char $slot3
$slot = 3
$army = 1
$donation = 1
$swab = 1
$cargo = 1
$message = 1
$geffen = 1
   do relog 5
   do reload macro
do $ai clear
   stop

   :fourthchar
   do conf username $uname4
   do conf password $pword4
   do conf char $slot4
$slot = 4
$army = 1
$donation = 1
$swab = 1
$cargo = 1
$message = 1
$geffen = 1
   do relog 5
   do reload macro
do $ai clear
   stop

   :fifthchar
   do conf username $uname5
   do conf password $pword5
   do conf char $slot5
$slot = 5
$army = 1
$donation = 1
$swab = 1
$cargo = 1
$message = 1
$geffen = 1
   do relog 5
   do reload macro
do $ai clear
   stop

   :sixthchar
   do conf username $uname6
   do conf password $pword6
   do conf char $slot6
$slot = 6
$army = 1
$donation = 0
$swab = 1
$cargo = 0
$message = 0
$geffen = 1
   do relog 5
   do reload macro
do $ai clear
   stop


   :seventhchar
   do conf username $uname7
   do conf password $pword7
   do conf char $slot7
$slot = 7
$army = 1
$donation = 0
$swab = 1
$cargo = 0
$message = 0
$geffen = 1
   do relog 5
   do reload macro
do $ai clear
   stop


   :eightchar
   do conf username $uname8
   do conf password $pword8
   do conf char $slot8
$slot = 8
$army = 1
$donation = 0
$swab = 1
$cargo = 0
$message = 0
$geffen = 1
   do relog 5
   do reload macro
do $ai clear
   stop


   :ninthchar
   do conf username $uname9
   do conf password $pword9
   do conf char $slot9
$slot = 9
$army = 1
$donation = 0
$swab = 1
$cargo = 0
$message = 0
$geffen = 1
   do relog 5
   do reload macro
do $ai clear
   stop



   :firstchar
   do conf username $uname1
   do conf password $pword1
   do conf char $slot1
   do quit
   do relog 5
   do reload macro
   stop
}   


automacro lock {
location alberta
console /Since you have completed to help me out yesterday, you/
run-once 1
call {
	lock pasamystic
	}
}
	
#automacro hp {
run-once 1
hp < 100%
location prontera
call {
	do move alberta
	release hp2
	}
}
#automacro hp2 {
run-once 1
hp < 100%
location alberta
call {
	do e hp
	release hp
	}
}
	
automacro sucessPET {
console /Pet capture success/[i]
run-once 1
call {
	do relog 5
	release sucessPET
	}
}


automacro countBoats {
   console /^NPC \[Quest\] Port Manager# \(\d+\) shown minimap indicator/i
   call {
      [
      $i++
      ]
   }
}
automacro answerBoats {
   console /^\[Quest\] Port Manager#: Type 'talk text'/i
   call {
	  do ai manual
	  pause 5
      do talk text $i
	  
     }
}

automacro answerBoats2 {
   console / MIMICs of all things!/i
   run-once 1
   delay 5
   call {
      do talk resp 0
      }
}

automacro resetBoats {
   console /^\[Quest\] Port Manager#: (Why|Here|How can I help you)/i
   call {
      $i = 0
     log Number of boats: $i
   }
}

#bugs:  *sometimes cannot find kafra npc at mid pront, also with the message delivery girl. 
#   *geffen - always get dc upon pop up of the injured master thief


it starts with the Donation daily quest --> Army Supplies quest (first half) --> Cargo Quest --> Swab the Deck --> Message Delivery Quest then the Geffen Daily quest (if possible) then Army Supplies quest (second half)...

instructions are included in this macro so i suggest you read them to completely understand the details..

the macros that ever_boy_ gave me have already been incorporated on this macro and if you have a good, fast and reliable internet connection, the macro will definitely finish all the quests, (else, just pray that Kore won't be disconnected or you will be reloading the macro over and over again -- not to mention the risk of having your character suspended due to the number of connection attempts per hour) cargo quest included. but be warned as well that the macro is not yet stable and you may encounter the bugs every now and then.

and by the way, swab the deck has a bug which prevents Kore to notice the correct number of "Leaf Cat Balls" in the inventory. i suggest that you just relog the Kore after a sucessful pet capture since the quest gives a good amount of experience.
arenole
Noob
Noob
Posts: 6
Joined: 05 Dec 2012, 06:20
Noob?: Yes

Re: [help] Alberta Daily Quest for Valkyrie Server pRO

#25 Post by arenole »

wow tnx a lot sir rain for sharing ur macros.. :)
NiTRO106
Plain Yogurt
Plain Yogurt
Posts: 64
Joined: 30 Nov 2012, 20:27
Noob?: No

Re: [help] Alberta Daily Quest for Valkyrie Server pRO

#26 Post by NiTRO106 »

@raine101

nice to know you're sharing your macros with us. good job /no1. im trying to "clean up" a bit with your code and after that i will post it on the Share your macro's :)
ever_boy_
Developers
Developers
Posts: 308
Joined: 06 Jul 2012, 13:44
Noob?: No

Re: [help] Alberta Daily Quest for Valkyrie Server pRO

#27 Post by ever_boy_ »

judging from the first macro edited here:

Code: Select all

macro questCHOICE {
#$slot has no value
$slot = $slot

if ($slot > 1) stop

#retain quest choices set $slot number in changeCHAR is altered
:retain
#THIS IS FOR YOUR FIRST CHARACTER QUEST'S CHOICE
$catchedrat = 1 #FOR MSG DELIVERY QUEST
$army = 0
$donation = 1
$swab = 1
$cargo = 1
$message = 1
$geffen = 0

if (($army = 0) && ($donation = 0) && ($swab = 0) && ($message = 0)) call changeCHAR
}
there's gotta be a ton of lines which can be removed from there.
NiTRO106
Plain Yogurt
Plain Yogurt
Posts: 64
Joined: 30 Nov 2012, 20:27
Noob?: No

Re: [help] Alberta Daily Quest for Valkyrie Server pRO

#28 Post by NiTRO106 »

@ever_boy_

i think that this is off-topic but is this code is acceptable?

Code: Select all

automacro QuestCompleted {
	exclusive 1
	console /help 20 hours later./ | /come back 20 hours later./
	call {
		pause 5
		do quit
	}
}
ever_boy_
Developers
Developers
Posts: 308
Joined: 06 Jul 2012, 13:44
Noob?: No

Re: [help] Alberta Daily Quest for Valkyrie Server pRO

#29 Post by ever_boy_ »

Code: Select all

automacro QuestCompleted {
	exclusive 1
	console /(help|come back) 20 hours later./
	call {
		pause 5
		do quit
	}
}
ever_boy_
Developers
Developers
Posts: 308
Joined: 06 Jul 2012, 13:44
Noob?: No

Re: [help] Alberta Daily Quest for Valkyrie Server pRO

#30 Post by ever_boy_ »

so far I've come to this, but there's still a thousand lines to go...

Code: Select all

#####INSTRUCTION:####
# *READ, READ AND READ FIRST
# *
# *FOLLOW INSTRUCTIONS:
# *   -FOR THE FIRST TIME USER OF THIS MACRO LEAVE ALL YOUR CHARACTER IN PRONTERA, THEY WILL BE SORTED IF THEY ARE QUALIFIED TO DO PRONT QUEST OR ALBERTA QUEST,
# *   -KEEP IN MIND THAT THIS MACRO IS INTENDED TO DO DAILY QUEST FOR USERS WHO JUST BOT FOR DAILY QUEST AND NO MORE   
# *   -YOU JUST NEED TO EDIT changeCHAR macro AT THE BOTTOM, ctrl + f, find "changeCHAR".
# *      - put your username and pass, your char's slot
# *      - choose quest for each of your char to do, for your first queue char's quest choices its in "questCHOICE" macro
# *      - if you want to bot more or less, just edit changeCHAR macro, its easy to follow the pattern.
#########REQUIREMENTS########
#MUST HAVE ZENY AND WHITE POTION(AT STORAGE) 
#MUST HAVE 2k FREE WEIGHT
#MUST/MAY HAVE 10 GREEN HERB   
#
#NOTE: ITS OK IF YOU DON'T HAVE ALL REQUIREMENTS, BUT ATLEAST HAVE ZENY, IT WON'T DO OR WILL SKIP THE QUEST IF YOU DON'T HAVE THE REQUIREMENTS
#
#
##########SUMMARY: ##########
#QUEST REQUIRED LVL:
#ARMY SUPPLY : 61 TO 150
#DONATION:     60 TO 99
#CARGO DELIVERY: 1 TO 99
#STICKY RAT:   1 TO 150
#MSG DELIVERY: 1 TO 150
#GEFFEN MASTER THIEF 21 TO 150
#
############NOTES:##########
#PROBLEM YOU MIGHT ENCOUNTER(I DID)##
#SEE THE BOTTOM PART OF THIS MACRO
#
#
#IF THERE IS A QUEST THAT DOESN'T WORK FOR A CERTAIN CHAR, BUT THE QUEST WORKS FINE TO ALL CHARS, MANUALLY DO THE QUEST.
#
#
#
########UPDATE#######
#ADDED questCHOICE OPTION
#-YOU MAY NOW CHOICE WHICH QUEST YOU DON'T WANT TO DO
#JUST
# TOGGLE 1 FOR YES, DO THE QUEST
# TOGGLE 0 FOR NO, SKIP THE QUEST
#
#IT IS LOCATED AT THE BOTTOM WITHIN changeCHAR macro
#
# $army = Army Supply Quest
# $donation = Church donation
# $cargo = Cargo delivery
# $swab = Swab the deck/Sticky Rat Quest
# $message = Message Delivery Quest
# $geffen = Master Thief Quest(not yet coded)
#
#####DISCLAIMER######
#CODES WITH TABS/INDENT AREN'T MINE, CARGO QUEST is from botter community AND changeCHAR macro is from an openkore member.
#ANYONE MAY DISTRIBUTE AND EDIT THIS ^_^. 
#I JUST DON'T LIKE IT TO BE SOLD OUT
#FREE LIBRE gratuitement libero bezmaksas frei
#
####FUTURE UPDATE I WANT TO ADD, MAY BE AFTER A MONTH OR TWO####
#   AUTOBUY WHITE POTION AT NPC
#   VARIABLEs TO TOGGLE IF A QUEST HAS BEEN DONE, SO THAT YOU LEAVE YOUR CHAR IN EITHER PRONT OR ALBERTA
#   AND
#   ADD COMMENTS FOR THIS TO BE READ EASILY
#   AND ALSO
#   A RESTRUCTURING OF CODES, REMOVING UNNECESSARY LINES, CODES, COMMENTS, LOGIC, ETC
#   
#
#   MORE IMPROVEMENTs TO COME ^_^
#

#made by: metalmarine
#

#   MUCH BETTER IF WE HAVE A COMMUNITY TO IMPROVE THIS. 





#EDIT questCHOICE macro and changeCHAR if there's a quest you don't want to do for a certain char

macro questCHOICE {
	#$slot has no value
	$slot = $slot

	if ($slot > 1) stop

	#retain quest choices set $slot number in changeCHAR is altered
	:retain
	#THIS IS FOR YOUR FIRST CHARACTER QUEST'S CHOICE
	$catchedrat = 1 #FOR MSG DELIVERY QUEST
	$army = 0
	$donation = 1
	$swab = 1
	$cargo = 1
	$message = 1
	$geffen = 0

	if (($army = 0) && ($donation = 0) && ($swab = 0) && ($message = 0)) call changeCHAR
	}

####START YOUR DAILY QUEST#####
macro dq {
	do move prontera 168 193
	release all
}

#TALK WITH ARMY SUPPLY
#CHECK FOR WHITE POTION
#IF YOU ARE 99/50 or 99/70 YOU'LL SKIP ARMY SUPPLY AND DONATION, BETTER EDIT THIS IF YOU HAVE A 99/50 TRANS CHAR
#IF YOU'RE IN PRONTERA, AND YOUR LVL IS LESs THAN LVL60 YOU'LL GO TO ALBERTA STRAIGHT

automacro prontQUEST {
	map prontera
	run-once 1
	priority 5
	call {
		call questCHOICE
		log army = $army donation = $donation swab = $swab cargo = $cargo message = $message geffen = $geffen
		if (($army = 0) && ($donation = 0)) goto warptoalb
		$baselvl = $.lvl
		$jlvl = $.joblvl
		if (($baselvl < 60) || (($jlvl = 70) && ($baselvl = 99)) || (($jlvl = 50) && ($baselvl = 99))) goto warptoalb
		goto prontquest

		:warptoalb
		log EITHER ARMY SUPPLY IS SET TO 0 OR NOT ENOUGH SUPPLY
		call warpALB
		stop

		:prontquest
		do move prontera 168 193
		pause 2
		#TALK DONATION NPC
		if (($baselvl >= 60) && ($baselvl <= 99)) goto donate
		goto supply

		:donate
		log DONATING TO THE CHURCH
		pause 2
		do talknpc 165 191 r1 n
		pause 2
		if ($baselvl < 61) goto warptoALB
		do talknpc 159 191 r1 n
		pause 1
		do move prontera 277 199
		pause 3
		$wPot = @invamount(White Potion) #inventory white potion count
		if ($wPot >= 100) goto skipstore
		do talknpc 282 200 r1
		pause 2

		#IF YOUR LVL IS BELOW 80 YOU JUST NEED TO BRING 5 WHITE POTZ, IF YOUR ABOVE, 100.
		if ($baselvl > 80) goto hundred
		do storage get @storage (White Potion) @eval(5 - $wPot)
		goto donestore

		:hundred
		do storage get @storage (White Potion) @eval(100 - $wPot)

		:donestore
		pause 1
		do storage close
		$wPot = @invamount(White Potion) #inventory white potion count
		if ((($wPot < 100) && ($baselvl > 80)) || (($wPot < 5) && ($baselvl <= 80))) goto warptoalb
		pause 3

		:skipstore
		do talknpc 282 200 r2 r3
		pause 4
		do move morocc 173 104
		pause 2
	}
}

#THE ARMY SUPPLY WAS ALREADY DONE OR NOT YET COOLED DOWN, SO MOVE DIRECTLY TO ALBERTA
automacro doneSUPP {
	console /be injured armies who need your help/i
	run-once 1
	exclusive 1
	call warpALB
}

macro warpALB {
	log WILL GO TO ALBERTA
	do move prontera 277 199
	pause 0.5
	log WARPING FROM PRONT TO ALBERTA
	do talknpc 282 200 r2 r5
}

#IN MORROC, TALK WITH MORROC SOLDIER
automacro inmoc {
	map morocc
	run-once 1
	timeout 90
	call {
		do move @random ("173","172","171","170") 104
		release all
	}
}

automacro mocsold {
	location morocc 173 104, morocc 172 104, morocc 170 104, morocc 171 104
	console /Injured (.*) .* /i
	run-once 1
	timeout 10
	exclusive 0
	call {
#TALK WITH THE SOLDIER WHERE YOUR LVL BELONGS
		macro talksold {
		$baselvl = $.lvl
		log $baselvl
		if ($baselvl <= 80) goto rec
		if ($baselvl <= 97) goto vet
		if ($baselvl >= 98) goto eli
		goto end

		:rec
		do talknpc 164 108 r1
		goto end

		:vet
		do talknpc 167 108 r1
		goto end

		:eli
		do talknpc 170 108 r1
		pause 2

		:end
		release mocsold
	}
}

#EITHER DONE TALKING WITH THE SOLDIER OR NOT ENOUGH POTION, MUST GO TO ALBERTA, OR YOU ALREADY GAVE THE POTION
automacro gavepotz {
	console /Thanks to your potion|so sick/i
	run-once 1
	exclusive 1
	delay 3
	call goalberta
}

#GOING TO ALBERTA THROUGH KAFRA
macro goalberta {
	log FROM MORROC WARPING TO ALBERTA
	$x = @rand (160, 163)
	do move morocc $x 100
	do talknpc 156 97 r2 r2
	pause 4
}

#IN ALBERTA, TALK FIRST WITH THE STICKY RAT NPC
#automacro swabthedeck {
#location alberta 117 56, alberta 116 57
#delay 1
#exclusive 0
#priority 1
#run-once 1
#call talkswab
#}

#YOU HAVEN'T YET DONE TURTLE ISLE QUEST, SO DO THE QUEST
automacro lostNPC {
	console /cannot calculate a route from alberta \((\d+),(\d+)\) to tur_dun01 .*/i
	run-once 1
	exclusive 1
	call {
		do move alberta_in 22 107
		pause 0.5
		do talknpc 23 104 r0 r0
		pause 2
		do talknpc 23 104 r1 n
		pause 2
		do move alberta
		do reload portal
		do reload macro
		log $locx $locy
		release all
	}
}

#IF THERE'S NO NPC, RELOAD THE MACRO
automacro noNPC {
	console /could not find an npc/i
	run-once 1
	call {
		do relog
		do reload macro
		release noNPC
	}
}

###ALBERTA QUEST######
#START THE QUEST
automacro STARTQUEST {
	location alberta
	priority 5
	exclusive 0
	call PORTNPC
	run-once 1
	#timeout 15
}

#END TALKING TO MIMIC
automacro ENDmimic {
	console /before it changes its mind|have already moved/
	call PORTNPC
	timeout 5
}

# TALK TO MIMIC AGAIN
automacro RETALKmimic {
#location alberta
	console /Deadly Cargo (.*) That/
	call {
		$num = $.lastMatch1
		goto mimic
		stop
		
		:mimic
		if ($num == [1]#:) goto retalk1
		if ($num == [2]#:) goto retalk2
		if ($num == [3]#:) goto retalk3
		if ($num == [4]#:) goto retalk4
		if ($num == [5]#:) goto retalk5
		if ($num == [6]#:) goto retalk6
		goto end
		
		:retalk1
		do talknpc 188 173 c n
		goto end
		
		:retalk2
		do talknpc 232 104 c n
		goto end
		
		:retalk3
		do talknpc 246 87 c n
		goto end
		
		:retalk4
		do talknpc 245 67 c n
		goto end
		
		:retalk5
		do talknpc 243 43 c n
		goto end
		
		:retalk6
		do talknpc 123 221 c n
		
		:end
		release RETALKmimic
}

automacro MIMIC1-a {
	console /(recognize the first crate|third crate should be with|find the fifth crate|/
	call {
		if ($.lastMatch1 =~ /recognize the first crate/i) goto first
		if ($.lastMatch1 =~ /third crate should be with/i) goto third
		$mimic = fifth
		:first
		$mimic = first
		:third
		$mimic = third
		call talkMIMIC
	}
	timeout 5
}

automacro MIMIC1-b {
	priority 2
	console /(get me|retrieve the) (first|second|fourth) crate/
	call {
		$mimic = $.lastMatch2
		call talkMIMIC
	}
	timeout 5
}

automacro MIMIC6-a {
	priority 2
	console /sixth create has been found|our wounded scouts have reported/
	call {
		$mimic = sixth
		call talkMIMIC
	}
	timeout 5
}

#CARGO QUEST FINISHED, DO THE NEXT QUEST: SWAB THEN MSG DELIVERY
automacro FINISHa {
	console /already did work for today|boxes are not arrived/
	exclusive 1
	priority 4
	call doswab
	timeout 5
}

#######MACROS###########

macro PORTNPC {
	call questCHOICE
	if (($cargo = 0) || ($.lvl > 99)) call doswab

	:port
	$x = @random ("94","95","96","97","98")
	$y = @random ("67","68","69","70","71")
	do move alberta $x $y
	pause 0.5
	do talk @npc(90 62)
}

macro talkMIMIC {
	pause 1
	if ($mimic == first) goto mimic1
	if ($mimic == second) goto mimic2
	if ($mimic == third) goto mimic3
	if ($mimic == fourth) goto mimic4
	if ($mimic == fifth) goto mimic5
	if ($mimic == sixth) goto mimic6
	stop
	
	:mimic1
	$x = @random ("187","188","189","190","191")
	$y = @random ("164","165","166","167","168")
	do move $x $y
	pause 1
	do talknpc 188 173 c n
	stop
	
	:mimic2
	$x = @random ("224","225","226","227","228")
	$y = @random ("102","103","104","105","106")
	do move $x $y
	pause 1
	do talknpc 232 104 c n
	stop
	
	:mimic3
	$x = @random ("238","239","240","241","242")
	$y = @random ("88","89","90","91","92")
	do move $x $y
	pause 1
	do talknpc 246 87 c n
	stop
	
	:mimic4
	$x = @random ("238","239","240","241","242")
	$y = @random ("64","65","66","67","68")
	do move $x $y
	pause 1
	do talknpc 245 67 c n
	stop
	
	:mimic5
	$x = @random ("235","236","237","238","239")
	$y = @random ("40","41","42","43","44")
	do move $x $y
	pause 1
	do talknpc 243 43 c n
	stop
	
	:mimic6
	$x = @random ("114","115","116","117","118")
	$y = @random ("215","216","217","218","219")
	do move $x $y
	pause 1
	do talknpc 123 221 c n
}

macro retalkMIMIC {
	$num = $.lastMatch1
	if ($num == [1]#:) goto retalk1
	if ($num == [2]#:) goto retalk2
	if ($num == [3]#:) goto retalk3
	if ($num == [4]#:) goto retalk4
	if ($num == [5]#:) goto retalk5
	if ($num == [6]#:) goto retalk6
	goto end
	
	:retalk1
	do talknpc 188 173 c n
	goto end
	
	:retalk2
	do talknpc 232 104 c n
	goto end
	
	:retalk3
	do talknpc 246 87 c n
	goto end
	
	:retalk4
	do talknpc 245 67 c n
	goto end
	
	:retalk5
	do talknpc 243 43 c n
	goto end
	
	:retalk6
	do talknpc 123 221 c n

	:end
	release RETALKmimic
}

#CHECK IF YOU HAVE MYSTIC BALL OR IF YOU MUST CATCH RATS
macro doswab {
do ai auto
do move alberta 114 55

if ($swab = 0) goto skipswab
goto swab

:skipswab
call talkmessage
stop

:swab
pause 2

$mcatball = @invamount (Mystic Leaf Cat Ball)

if ($mcatball > 0) goto pasamystic
goto mustcatch

:pasamystic
do talknpc 104 60 r0 n
pause 2
do talknpc 104 60 c n
pause 2
call talkmessage
goto end

#ASK THE NPC FOR LEAF CAT BALLS
:mustcatch
$lball = @invamount(Leaf Cat Ball)
while ($lball < 5) as lball
do talknpc 104 60 r0 n
pause 1
do talk no
$lball++
log $lball
end lball


#NOW, MOVE TO ALBERTA SHIP WHERE MOST STICKY RAT RESPAWN
if ($lball = 5) goto catchem
goto end
:catchem
do move alb_ship @rand (121,125) @rand (99,100)
log moving to alb_ship
do conf attackAuto 2
$ai = ai
do $ai clear
pause 1

:end

#release swabthedeck
}

#IF YOU STILL HAVE A LEAF BALL, BE AGGRESSIVE
automacro sticky {
inventory "Leaf Cat Ball" > 0
monster Sticky Rat
run-once 1
exclusive 1
timeout 40
delay 0
call sticky
}

#AUTO ATTACK RATS

macro sticky {
do conf attackAuto 2
pause 0
release sticky
}

#YOU ARE NOW ATTACKING A RAT, WHILE YOU ATTACK AND HAVE LEAF BALL TRY TO CATCH RAT
#IF YOU RUN OUT OF LEAF BALL, BACK TO TOWN TO DELIVER THE MYSTIC BALL
#AND THEN TURN AUTOATTACK OFF

automacro mindexa {
console /You are now attacking Monster Sticky Rat \((\d+)\)/i
run-once 1
exclusive 1
timeout 8
delay 2
priority 3
call mindex
}


automacro mindex {
console /Monster Sticky Rat \((\d+)\) attacks you/i
run-once 1
exclusive 1
priority 2
timeout 8
delay 0
call mindex
}

#MONSTER TO BE CATCH TRIGGERED
macro mindex {
$lball = @invamount (Leaf Cat Ball)
if ($lball = 0) goto return
goto cont
:return
$catchedrat = 1
do conf attackAuto 0

pause 1
do move alberta 117 56
pause 2
$mball = @inventory (Mystic Leaf Cat Ball)

if (($mball > 0) && ($lball =< 0)) goto pass
call doswab
stop

:pass
do talknpc 104 60 r0 n
call msgdelivery
pause 1

:cont
$m = $.lastMatch1
log $m
do im @inventory (Leaf Cat Ball) $m
pause 0
do pet c $m
#do conf attackAuto 0
release mindex
release mindexa
}


#IF ALREADY DONE STICKY RAT QUEST MOVE TO MESSENGER QUEST


automacro calltalkm {
console /Here is the list/i
run-once 1
exclusive 0
delay 4
priority 4
call talkmessage
}


automacro donemessage {
console /already delivered all the letters/
exclusive 1
priority 0
run-once 1
call returnpront
}



#MESSENGER QUEST
#TALK MESSAGE HAS A PATHWAY BEFORE TALKING, BECAUSE OPENKORE DOESN'T RECOGNIZES MSG DELIVERY NPC AFTER TELEPORTING TO ALBERTA OR RELOG

macro talkmessage {
if ($message = 0) goto repront
goto talkmsg

:repront
call returnpront
stop

:talkmsg
$baselvl = $.lvl
#AFTER YOU FINISHED CARGO QUEST, MSG DELIVERY NPC IS ALREADY RECOGNIZED, NO NEED TO MOVE AWAY-BACK 
if (($baselvl <= 99) || (($cargo = 1) && ($baselvl <= 99))) goto skip
if ($cargo = 0) goto walkaway
:walkaway
pause
if ($catchedrat = 1) goto skip
do west
pause 1
do west
pause 1
do west
pause 1
do east
pause 1
do east
do east
pause 2
:skip
pause 2
call msgdelivery
}


#TALK WITH THE MSG DELIVERY NPC ACCORDING TO YOUR LVL BRACKET
macro msgdelivery {
pause 5
$jlvl = $.joblvl
$baselvl = $.lvl
if ((($jlvl = 70) && ($baselvl = 99)) || (($jlvl = 50) && ($baselvl = 99))) goto futile
goto proceed

:futile
call returnpront
stop

:proceed
$blvl = $.lvl
if ($blvl <= 20) goto txta
if ($blvl <= 40) goto txtb
if ($blvl <= 60) goto txtc
if ($blvl <= 80) goto txtd
if ($blvl <= 150) goto txte
goto end

:txta
do talknpc 122 55 r0 r0 n
$randomX1 = @random ("54","55","56","57","58")
$randomY1 = @random ("74","75","76","77","78")
do move alberta $randomX1 $randomY1
pause 2
do talknpc 56 80 c n
call returnpront
stop

:txtb
do talknpc 122 55 r0 r1 n
$randomX1 = @random ("61","62","63","64","65")
$randomY1 = @random ("65","66","67","68","69")
do move alb2trea
pause 2
do move alb2trea $randomX1 $randomY1
pause 2
do talknpc 57 67 c n
call returnpront
stop


:txtc
do talknpc 122 55 r0 r2 n
$randomX1 = @random ("98","99","100","101","102")
$randomY1 = @random ("114","115","116","117","118")
do move alberta 109 59
pause 1
do talknpc 113 60 r2 r2 #warp to pront
pause 2
do move prontera $randomX1 $randomY1
pause 2
do talknpc 104 116 c n
$messagedone = 1
call returnpront
stop

:txtd
do talknpc 122 55 r0 r3 n
$randomX1 = @random ("123","124","125","126","127")
$randomY1 = @random ("172","173","174","175","176")
do move izlude 125 150
pause 2
do move izlude $randomX1 $randomY1
pause 2
do talknpc 121 174 c n
call returnpront
stop

:txte
do talknpc 122 55 r0 r4 n
$randomX1 = @rand (190,194)
$randomY1 = @rand (104,105)
do move tur_dun01
pause 2
do move tur_dun01 $randomX1 $randomY1
pause 2
do talknpc 192 117 c n
call returnpront
stop

:end
call returnpront
}



#AFTER DOING THE MESSENGER QUEST, EITHER RETURN BACK TO PRONTERA TO
#FINISH THE ARMY SUPPLY QUEST OR DO GEFFEN QUEST 


macro returnpront {
lock prontQUEST #PRONT QUEST AND ALBERTA QUEST HAS BEEN DONE SO WE HAVE COME HERE
$map = $.map
log VAR GEF = $geffen
lock findTHIEF
$re = @inventory (Red Potion)
$or = @inventory (Orange Potion)
$ye = @inventory (Yellow Potion)
$wh = @inventory (White Potion)
$bl = @inventory (Blue Potion)
$yg = @inventory (Yggdrasil Seed)
$blvl = $.lvl
$gherb = @invamount (Green Herb)
$donestore = 1

if ($geffen = 1) goto gefquest #WE HAVEN'T DONE GEFFEN QUEST
goto returnprontera


:gefquest
log WE MIGHT DO GEF QUEST
if ($map = izlude) goto storeinizlude
if ($map = prontera) goto storeinpront
goto storeinalb

:storeinizlude
do move 134 90
do talknpc 134 88 r1
goto storing

:storeinpront
do move 145 89
pause 1
do talknpc 146 89 r1 #storage
goto storing


:storeinalb
do move alberta @rand(108,110) 59
log MOVING TO ALBERTA
pause 1
do talknpc 113 60 r1

:storing
if ($gherb >= 10) goto re
pause 2
do storage get @storage (Green Herb) @eval (10 - $gherb)
:re
if ($re < 1) goto or
do storage add @inventory (Red Potion)
:or
if ($or < 1) goto ye
do storage add @inventory (Orange Potion)
:ye
if ($ye < 1) goto wh
do storage add @inventory (Yellow Potion)
:wh
if ($wh < 1) goto bl
do storage add @inventory (White Potion)
:bl
if ($bl < 1) goto yg
do storage add @inventory (Blue Potion)
:yg
if ($yg < 1) goto storeclose
do storage add @inventory (Yggdrasil Seed)
:storeclose
do storage close

$donestore = 1 #you've done storing
pause 1

$gherb = @invamount (Green Herb)
log I HAVE $gherb Green Herb and MY LEVEL IS $baselvl

if (($blvl > 20) && ($gherb >= 10) && ($geffen = 1)) goto gefQ
goto returnprontera

:gefQ

if ($map = prontera) goto pronttogef
if ($map = izlude) goto iztogef
goto gefQ1

:pronttogef
do talknpc 146 89 r2 r1 #AFTER STORAGE FROM PRONT, WARP TO GEFFEN
stop

:iztogef
do move izlude 134 90
do talknpc 134 88 r2 r0 #WARP FROM IZLUDE TO GEFFEN
stop

:gefQ1
log FROM $.map GOING TO ALBERTA TO PRONT TO GO TO GEFFEN
do move alberta 109 59
pause 1
do talknpc 113 60 r2 r2 #WARP TO PRONT
pause 1
do move 145 89
pause 1
do talknpc 146 89 r2 r1 #WARP TO GEFFEN
stop


:returnprontera

$map = $.map

if ($map = geffen) goto warptoPront
if ($map = izlude) goto movalberta
goto contini #YOU'RE IN PRONT OR ALBERTA

:warptoPront
log MOVING FROM GEFFEN TO PRONTERA
do move 116 63
pause 1
do talknpc 120 62 r2 r0
pause 1
goto inpront

:movalberta
do move alberta
call returnpront
stop


:contini
if (($map = prontera) && ($geffen = 0)) goto storeinpront1
if ($map = alberta) goto skipna










:storeinpront1
log WILL GO BACK FROM PRONT TO ALBERTA
do move 145 89
pause 1

goto store



:skipna

do move alberta 109 59
pause 2
if ($baselvl > 99) goto return #you don't need to store co'z u didn't receive anything.
goto store

:store

if ($donestore = 1) goto notneed
if (($re > 0) || ($or > 0) || ($ye > 0) || ($wh > 0) || ($bl > 0) || ($yg > 0)) goto dostore
goto notneed

:dostore
if ($map = prontera) goto prontkaf
goto albkaf

:prontkaf
do talknpc 146 89 r1 #STORE IN PRONTERA
goto putstore

:albkaf
do talknpc 113 60 r1
pause 1

:putstore
if ($re < 1) goto or1
do storage add @inventory (Red Potion)
:or1
if ($or < 1) goto ye1
do storage add @inventory (Orange Potion)
:ye1
if ($ye < 1) goto wh1
do storage add @inventory (Yellow Potion)
:wh1
if ($wh < 1) goto bl1
do storage add @inventory (White Potion)
:bl1
if ($bl < 1) goto yg1
do storage add @inventory (Blue Potion)
:yg1
if ($yg < 1) goto storeclose1
do storage add @inventory (Yggdrasil Seed)
:storeclose1
do storage close
:notneed

if ($map = prontera) goto prontissue
goto albissue

:prontissue
if ((($blvl < 60) && ($blvl > 20) && ($cargo = 0) && ($swab = 0) && ($message = 0)) || (($blvl > 59) && ($army = 0) || ($donation = 0))) goto stay
if (($blvl < 60) && ($blvl > 20) && (($cargo = 1) || ($swab = 1) || ($message = 1))) goto bacalb
goto albissue

:bacalb
do talknpc 146 89 r2 r5
pause 1
goto stay
#call returnpront


:albissue
pause 1
#do move alberta 120 58
#pause 2
if (($baselvl < 60) || (($jlvl = 70) && ($baselvl = 99)) || (($jlvl = 50) && ($baselvl = 99)) || (($donation = 0) && ($army = 0))) goto stay
goto return

:stay
call changeCHAR
stop

:return
do talknpc 113 60 r2 r2
pause 2

:inpront
$randx = @rand (166,170)
$randy = @rand (188,192)
do move prontera $randx $randy
do talknpc 159 191 c n
pause 1
call changeCHAR
}



automacro gefQUEST {
base >= 21
inventory "Green Herb" >= 10
map geffen
run-once 0
timeout 400
priority 2
exclusive 0
call gefcap
}
macro gefcap {
lock findTHIEF
$geffen = 0
log MOVING TO GEFFEN CAPTAIN's LOCATION
do move 128 115
pause 2
log TALKING TO THE CAPTAIN
do talknpc 127 115 r0 r0
call search
stop
}

automacro rereport {
console /He is in Alberta\./i
run-once 1
exclusive 1
priority 1
call geftoalb
}

automacro finGef {
console /I wil need your help again sometime soon\./i
run-once 1
exclusive 1
priority 1
call geftoalb
}
automacro finGef2 {
console /Maybe I will need your help again sometime soon/i
run-once 1
exclusive 1
priority 1
call geftoprontORalb
}

macro geftoalb {
$geffen = 0
do talk no
lock STARTQUEST
lock prontQUEST
log FROM GEFFEN GOING TO PRONT
do move 116 63
pause 1
do talknpc 120 62 r2 r0
pause 1
do move 145 89
pause 1
do talknpc 146 89 r2 r5
pause 1
do move 104 50
do talknpc 101 48 c n
call returnpront
release rereport
release finGef
}


macro geftoprontORalb {
$geffen = 0
do talk no
lock STARTQUEST
lock prontQUEST
log FROM GEFFEN GOING TO PRONT
do move 116 63
pause 1
do talknpc 120 62 r2 r0
pause 1
call returnpront
}

automacro findTHIEF {
base >= 21
inventory "Green Herb" >= 10
map geffen
run-once 1
exclusive 0
priority 4
call search
}
macro search {
do move geffen 145 163
do sit
pause 2
do stand
do move geffen 174 97
do sit
pause 2
do stand
do move geffen 138 31
do sit
do stand
do move geffen 76 96
do sit
pause 2
do stand
release findTHIEF
}


automacro foundTHIEF {
console /Tell me who you are/i
run-once 1
priority 3
delay 0
exclusive 0
call talkthief
}
macro talkthief {
#do relog 2
pause 3
do talk resp 0
pause 1
do talk resp 0
pause 1
do talk resp 0
release foundTHIEF
lock findTHIEF
}



automacro reportBACK {
console /you can not keep me last/i
run-once 1
exclusive 1
priority 1
delay 2
call report
}
macro report {
#do talk cont
pause 2
do move 128 115
do talknpc 127 115 c
pause 2
do talknpc 127 115 c
pause 5
do talknpc 101 48 c
pause 1
call returnpront
}

automacro albCAP {
console /know how to repay/i
priority 1
exclusive 1
run-once 1
call done
}

macro done {
log DONE GEFFEN THIEF
log DONE GEFFEN THIEF
log DONE GEFFEN THIEF
log DONE GEFFEN THIEF
call returnpront
}

automacro stoptalk {
console /Injured Master Thief.* \.\.\.\.\.\./i
run-once 1
exclusive 1
call {
do talk no
call report
release stoptalk
lock findTHIEF
}
}
macro changeCHAR {

   $uname1 = username
   $pword1 = password
   $slot1 = 1

   $uname2 = username
   $pword2 = password
   $slot2 = 2

   $uname3 = username
   $pword3 = password
   $slot3 = 3

   $uname4 = username
   $pword4 = password
   $slot4 = 2

   $uname5 = username
   $pword5 = password
   $slot5 = 4

   $uname6 = username
   $pword6 = password
   $slot6 = 0

   $uname7 = username
   $pword7 = password
   $slot7 = 0
   
   goto char
   stop

   :char
   if (($uname1 == @config(username)) && ($pword1 == @config(password)) && ($slot1 == @config(char))) goto secondchar
   if (($uname2 == @config(username)) && ($pword2 == @config(password)) && ($slot2 == @config(char))) goto thirdchar
   if (($uname3 == @config(username)) && ($pword3 == @config(password)) && ($slot3 == @config(char))) goto fourthchar
   if (($uname4 == @config(username)) && ($pword4 == @config(password)) && ($slot4 == @config(char))) goto fifthchar
   if (($uname5 == @config(username)) && ($pword5 == @config(password)) && ($slot5 == @config(char))) goto sixthchar
   if (($uname6 == @config(username)) && ($pword6 == @config(password)) && ($slot6 == @config(char))) goto seventhchar
   if (($uname7 == @config(username)) && ($pword7 == @config(password)) && ($slot7 == @config(char))) goto firstchar   
   stop

   :secondchar
   do conf username $uname2
   do conf password $pword2
   do conf char $slot2
$slot = 2
$army = 1
$donation = 1
$swab = 1
$cargo = 1
$message = 1
$geffen = 1
   do relog 5
   do reload macro
do $ai clear
   stop

   :thirdchar
   do conf username $uname3
   do conf password $pword3
   do conf char $slot3
$slot = 3
$army = 1
$donation = 1
$swab = 1
$cargo = 1
$message = 1
$geffen = 1
   do relog 5
   do reload macro
do $ai clear
   stop

   :fourthchar
   do conf username $uname4
   do conf password $pword4
   do conf char $slot4
$slot = 4
$army = 1
$donation = 1
$swab = 1
$cargo = 1
$message = 1
$geffen = 1
   do relog 5
   do reload macro
do $ai clear
   stop

   :fifthchar
   do conf username $uname5
   do conf password $pword5
   do conf char $slot5
$slot = 5
$army = 1
$donation = 1
$swab = 1
$cargo = 1
$message = 1
$geffen = 1
   do relog 5
   do reload macro
do $ai clear
   stop

   :sixthchar
   do conf username $uname6
   do conf password $pword6
   do conf char $slot6
$slot = 6
$army = 1
$donation = 0
$swab = 1
$cargo = 0
$message = 0
$geffen = 1
   do relog 5
   do reload macro
do $ai clear
   stop


   :seventhchar
   do conf username $uname7
   do conf password $pword7
   do conf char $slot7
$slot = 7
$army = 1
$donation = 0
$swab = 1
$cargo = 0
$message = 0
$geffen = 1
   do relog 5
   do reload macro
do $ai clear
   stop


   :eightchar
   do conf username $uname8
   do conf password $pword8
   do conf char $slot8
$slot = 8
$army = 1
$donation = 0
$swab = 1
$cargo = 0
$message = 0
$geffen = 1
   do relog 5
   do reload macro
do $ai clear
   stop


   :ninthchar
   do conf username $uname9
   do conf password $pword9
   do conf char $slot9
$slot = 9
$army = 1
$donation = 0
$swab = 1
$cargo = 0
$message = 0
$geffen = 1
   do relog 5
   do reload macro
do $ai clear
   stop



   :firstchar
   do conf username $uname1
   do conf password $pword1
   do conf char $slot1
   do quit
   do relog 5
   do reload macro
   stop
}   


automacro lock {
location alberta
console /Since you have completed to help me out yesterday, you/
run-once 1
call {
   lock pasamystic
   }
}
   
#automacro hp {
run-once 1
hp < 100%
location prontera
call {
   do move alberta
   release hp2
   }
}
#automacro hp2 {
run-once 1
hp < 100%
location alberta
call {
   do e hp
   release hp
   }
}
   
automacro sucessPET {
console /Pet capture success/[i]
run-once 1
call {
   do relog 5
   release sucessPET
   }
}


automacro countBoats {
   console /^NPC \[Quest\] Port Manager# \(\d+\) shown minimap indicator/i
   call {
      [
      $i++
      ]
   }
}
automacro answerBoats {
   console /^\[Quest\] Port Manager#: Type 'talk text'/i
   call {
     do ai manual
     pause 5
      do talk text $i
     
     }
}

automacro answerBoats2 {
   console / MIMICs of all things!/i
   run-once 1
   delay 5
   call {
      do talk resp 0
      }
}

automacro resetBoats {
   console /^\[Quest\] Port Manager#: (Why|Here|How can I help you)/i
   call {
      $i = 0
     log Number of boats: $i
   }
}

#bugs:  *sometimes cannot find kafra npc at mid pront, also with the message delivery girl. 
#   *geffen - always get dc upon pop up of the injured master thief
you should check ALL the pauses in the macro, because I believe most of them are higher than should be, and some must be useless, making this set of macros last much longer than needed.