Showing posts with label Macro Plugin. Show all posts
Showing posts with label Macro Plugin. Show all posts

Monday, November 16, 2009

Kena Strip Weapon ?? The Solution is !!

Ini dia solusi buat yang bot di tempat seperti metaling yang bisa menggunakan skill strip..

setelah terkena strip otomatis si bot akan dc biar status strip nya hilang dan bs memakai equip yang dipakai kembali seperti semula..

hehehe

silakan menikmati

==========================

automacro Strip{

status Strip Weapon 
call {
do relog
}
timeout 3

}

=================

Dijamin 100% Worked ^^

Enjoy !

Monday, October 12, 2009

Macros Auto-Vending 2.0.6.1

Macros ini digunakan untuk auto-vending bagi pengguna openkore 2.0.6.1 yang tidak bisa langsung openshop / harus mengetik openshop terlebih dahulu

gunakan macros d bawah ini.

automacro OpenShopEN {
 console /You are sitting./
 call {
  do openshop
 }
}
automacro OpenShopID {
 console /Anda duduk./
 call {
  do openshop
 }
}

dijamin sukses 100%

Wednesday, August 26, 2009

Download OpenKore 2.0.7 + Macros 2.0.2

OpenKore 2.07 adalah versi keluaran Wed Jul 29 2009

Link yang saya masukan berasal dari openkore.com, bisa dipercaya ^^

Untuk Petunjuk dapat di download di :

http://sourceforge.net/projects/openkore/files/OpenKore/2.0.7/README.txt/download

Untuk Download openkore-2.0.7.tar.bz2 [ linux, mac, bsd, solaris, others] 

http://sourceforge.net/projects/openkore/files/OpenKore/2.0.7/openkore-2.0.7.tar.bz2/download

Untuk Download openkore-2.0.7.zip [ windows ]

http://sourceforge.net/projects/openkore/files/OpenKore/2.0.7/openkore-2.0.7.zip/download

Download macro-2.0.2.zip

http://sourceforge.net/projects/openkore/files/Macro%20plugin/2.0.2/macro-2.0.2.zip/download

Download fieldpack-2.0.7.zip

http://sourceforge.net/projects/openkore/files/Field%20pack/2.0.7/fieldpack-2.0.7.zip/download

Download confpack-2.0.7.zip

http://sourceforge.net/projects/openkore/files/Default%20configuration%20files/2.0.7/confpack-2.0.7.zip/download

Download tablepack-2.0.7.zip

http://sourceforge.net/projects/openkore/files/Default%20configuration%20files/2.0.7/tablepack-2.0.7.zip/download

Terima Kasih kepada http://sourceforge.net/projects/openkore/files/

Apabila ada yang tidak dimengerti, dapat ditanyakan melalui comment atau chat box yang ada di sebelah kanan.

Terima Kasih kepada semua roberto1910.blogspot.com readers ^^

Saturday, August 1, 2009

Macro Vending

automacro Jualan {
location payon 145 55
cart "Green Potion" >= 1
cart "Red Potion" >= 1
call Vending
}

macro Vending {
do openshop
}

automacro yah {
location payon 168  48
shop "Red Potion" < 5
shop "Green Potion" > 0
call abis
run-once 1
}

macro abis {
do closeshop
do move payon_in01
do talk @npc (5 49)
pause 2
do store
pause 1
do buy 2 100
do cart add @inventory(Red Potion)
do move 168 48 payon
stop
do openshop
release yah
}


tinggal d ubah" sndiri ajah..

Macro Soul Linker

===============================================================

automacro soulinker {

console /\[dist=(.*)\] (.*) \((\d+)\): (.*)(spirit|Flag|)(.*)$/
call spirit
priority 1
}

macro spirit {
$n = $.lastMatch2
$b = $.lastMatch3
$skill = $.lastMatch5
$playerID = @player($.lastguild)
$playerguild = @eval (exists $:layers{$:layersID[$playerID]}->{guild} ? $:layers{$:layersID[$playerID]}->{guild}{name} : 'null')

$guild = TechnoGeek


if ($playerguild == $guild) goto skill
if ($playerguild != $guild) goto laen
goto laen
stop

:skill
if ($skill == spirit) goto spirit
if ($skill == Flag) goto ka
if ($skill == ) goto ka
stop

:ka
do sp kaite "$n"
do sp kaupe "$n"
do sp kaizel "$n"
do c sabar lg maketin $n
do e ok
stop

:spirit
if ($job = 12) goto sin
if ($job = 4013) goto sin
if ($job = 16) goto sage
if ($job = 4017) goto sage
if ($job = 8) goto pris
if ($job = 4009) goto pris
if ($job = 15) goto monk
if ($job = 4016) goto monk
if ($job = 9) goto wiz
if ($job = 4010) goto wiz
if ($job = 17) goto rogue
if ($job = 4018) goto rogue
if ($job = 18) goto alche
if ($job = 4019) goto alche
if ($job = 4020) goto bdc
if ($job = 4021) goto bdc
if ($job = 19) goto bdc
if ($job = 20) goto bdc
if ($job = 14) goto crs
if ($job = 4015) goto crs
if ($job = 21) goto crs
if ($job = 4022) goto crs
if ($job = 23) goto sn
if ($job = 10) goto bs
if ($job = 4011) goto bs
if ($job = 4047) goto tm
if ($job = 4048) goto tm
if ($job = 4049) goto sl
if ($job = 7) goto knit
if ($job = 13) goto knit
if ($job = 174) goto knit
if ($job = 4014) goto knit

:sin
do sp 457 "$n"
goto finish
:sage
do sp 449 "$n"
goto finish
ris
do sp 454 "$n"
goto finish
:monk
do sp 447 "$n"
goto finish
:wiz
do sp 453 "$n"
goto finish
:rogue
do sp 456 "$n"
goto finish
:alche
do sp 445 "$n"
goto finish
:bdc
do sp 455 "$n"
goto finish
:crs
do sp 450 "$n"
goto finish
:sn
do sp 451 "$n"
goto finish
:bs
do sp 458 "$n"
goto finish
:tm
do sp 448 "$n"
goto finish
:sl
do sp 461 "$n"
goto finish
:knit
do sp 452 "$n"
goto finish

:finish
release all
do c abis mati ya $n ? Kasihan...
do e pif
stop

:laen
do c cuma buat Geek Guild only
stop

:end
stop

}

===========================================================

itu yg huruf merah , tlg d rubah sndiri ya..

btw g jamin 100% worked, soal na wa juga lom pernah coba tuh.. gr" gk bikin SL =P

Warp Melalui PM

ok, ini merupakan request dari beberapa org ,

maap klo br bs dimasukin skg.. soal na ge sibuk >,<

==================================

automacro warp-brito {
pm /brito/
call warp2brito
}

macro warp2brito {
do sl 27
do warp 1
}

automacro warp-green {
pm /gw/
call warp2green
}

macro warp2green {
do sl 27
do warp 2
}

automacro warp-valk {
pm /val/
call warp2valk
}

macro warp2valk {
do sl 27
do warp 3
}

====================

tinggal copas ke macros.txt ajah...

yg di kasih warna itu tinggal ganti sndiri aajah klo mw..

Monday, April 13, 2009

Refine Macro

Nie macro refine/macro buat nempa... Kegagalan dalam menempa jgn salah kan bot ato saya.... karena biar bagaimana pun menempa tetap membutuh kan ke ho-q an dari char kamu...

automacro check_inventory {
var upgradeon = 1
location prt_in 54 63 57 59
inventory Phracon < upgradeon =" 1"> 0
equipped Sword [3]
call do_upgrade
}

automacro check_equip1 {
var upgradeon = 1
location prt_in 54 63 57 59
inventory Phracon > 0
equipped +1 Sword [3]
call do_upgrade
}

automacro check_equip2 {
var upgradeon = 1
location prt_in 54 63 57 59
inventory Phracon > 0
equipped +2 Sword [3]
call do_upgrade
}

automacro check_equip3 {
var upgradeon = 1
location prt_in 54 63 57 59
inventory Phracon > 0
equipped +3 Sword [3]
call do_upgrade
}


automacro check_equip4 {
var upgradeon = 1
location prt_in 54 63 57 59
inventory Phracon > 0
equipped +4 Sword [3]
call do_upgrade
}


automacro check_equip5 {
var upgradeon = 1
location prt_in 54 63 57 59
inventory Phracon > 0
equipped +5 Sword [3]
call do_upgrade
}

automacro check_equip6 {
var upgradeon = 1
location prt_in 54 63 57 59
inventory Phracon > 0
equipped +6 Sword [3]
call do_upgrade
}

automacro check_equip7 {
var upgradeon = 1
location prt_in 54 63 57 59
inventory Phracon > 0
equipped +7 Sword [3]
call do_overupgrade
}

automacro check_equip8 {
var upgradeon = 1
location prt_in 54 63 57 59
inventory Phracon > 0
equipped +8 Sword [3]
call do_overupgrade
}

automacro check_equip9 {
var upgradeon = 1
location prt_in 54 63 57 59
inventory Phracon > 0
equipped +9 Sword [3]
call do_overupgrade
}

automacro check_equipnone {
var upgradeon = 1
location prt_in 54 63 57 59
inventory Phracon > 0
inventory "Sword [3]" > 0
equipped not Sword [3]
equipped not +1 Sword [3]
equipped not +2 Sword [3]
equipped not +3 Sword [3]
equipped not +4 Sword [3]
equipped not +5 Sword [3]
equipped not +6 Sword [3]
equipped not +7 Sword [3]
equipped not +8 Sword [3]
equipped not +9 Sword [3]
call equip_item
}

macro equip_item {
eq Sword [3]
@pause 2
}

macro do_upgrade {
talk @npc (63 60)
@pause 1
talk cont
@pause 1
talk resp 3
@pause 1
talk cont
@pause 1
talk resp 0
@pause 1
}

macro do_overupgrade {
talk @npc (63 60)
@pause 1
talk cont
@pause 1
talk resp 3
@pause 1
talk cont
@pause 1
talk resp 0
@pause 1
talk cont
@pause 1
talk cont
@pause 1
talk resp 0
@pause 1
}

Novice - Thief Using Macro

#Novice to Thief Macro byMasahiro

automacro thief{
inventory "Orange Gooey Mushroom" <>= 1
inventory "Orange Net Mushroom" >= 8
call done
run-once 1
}

automacro gathered2 {
inventory "Orange Gooey Mushroom" >= 4
inventory "Orange Net Mushroom" >= 7
call done
run-once 1
}

automacro gathered3 {
inventory "Orange Gooey Mushroom" >= 7
inventory "Orange Net Mushroom" >= 6
call done
run-once 1
}

automacro gathered4 {
inventory "Orange Gooey Mushroom" >= 10
inventory "Orange Net Mushroom" >= 5
call done
run-once 1
}

automacro gathered5 {
inventory "Orange Gooey Mushroom" >= 13
inventory "Orange Net Mushroom" >= 4
call done
run-once 1
}

automacro gathered6 {
inventory "Orange Gooey Mushroom" >= 16
inventory "Orange Net Mushroom" >= 3
call done
run-once 1
}

automacro gathered7 {
inventory "Orange Gooey Mushroom" >= 19
inventory "Orange Net Mushroom" >= 2
call done
run-once 1
}

automacro gathered8 {
inventory "Orange Gooey Mushroom" >= 22
inventory "Orange Net Mushroom" >= 1
call done
run-once 1
}

automacro gathered9 {
inventory "Orange Gooey Mushroom" >= 25
call done
run-once 1
}

automacro gathered10 {
inventory "Orange Net Mushroom" >= 9
call done
run-once 1
}

macro done {
do is @inventory (Butterfly Wing)
pause 3
do conf attackAuto 0
do conf route_randomWalk 0
do conf autoTalkCont 1
do move 41 125 moc_prydb1
pause 1
do talk @npc (42 133)
pause 3
}

automacro died {
map morocc
call ban
run-once 1
}

macro ban {
do move 135 130 moc_ruins
do talk @npc (141 125)
pause 3
do conf attackAuto 2
do conf route_randomWalk 1
do conf itemsTakeAuto 2
do conf itemsGatherAuto 2
release all
}


Note : i'm not tried it , so idk if its worked well or not...

PvP Macro !

Saya Harap Smua mau sedikit berusaha mengedit nya. Karena jika bermain copas saya yakin maka macro pvp ini tdk akan berhasil/jalan. Karena saya telah mengedit d bag tertentu.

###################################################
# PLAYER KILL MACRO Version 1.0.0 Beta #
# JOB: ALL CLASSES #
# Requires Macro Plugin 1.3.x
# By : MaSaHiRo
###################################################

automacro ignorepm {
pm /bot/
timeout 1
call pm
}

automacro ignorepm2 {
pm /botter/
timeout 1
call pm
}

automacro ignorepm3 {
pm /report/
timeout 1
call pm
}

automacro ignorepm4 {
pm /ur name/
timeout 1
call pm
}

macro pm {
$pm = @eval ($pm + 1)
if ($pm >= 2) goto ignore
goto end
:ignore
pause 3
do ignore 1 $.lastpm
$pm = 0
:end
}

automacro subload {
overideAI 1
run-once 1
timeout 1
call onload
}

macro onload {

# Macro Config 

do conf macro_debug 0

#Edit This:
#[ 1 = on | 0 = off ]


# Commands @warp, @go, etc
$allowA = 1

$kos = 1
$freewill = 1

# use 2 or 0
#
$randomwalk = 2

$nohide = 0
$fp = 0
$skills = 1
$lock = 1
$homemap = prt_fild09 29 295
$lockedmap = prt_fild08 150 365
$fpbot = "= ur name bot for FP ="
$master = Master Name
$follow = @config(follow)

# character: $atk - attack skill
#
$atk = sp 266

# If your jobclass is champion or hpriest leave none, else set this to 1
#
$job = none


# Dont mess with this:

$hello = Hi $master ! Our Enemies: @config(kos_pk) @config(kos_pk2).

:next0
if ($follow = 1) goto f
goto next1
:f
do follow $master
:next1
if (@arg("$lockedmap", 1) = prt_fild08) goto makelocprt
$location = $.map
goto next2
:makelocprt
$location = prt_fild08

:next2
$lastpos = 0 0 $.map
$damage = 0
$nmes = 0

#

# Say that you are online
do pm "$master" $hello

# Log (you can remove it)

log ===================================================
log PVP (BVP) Macros
log JOB: ALL CLASSES
log ===================================================
log Master: $master
log Skill Usage On Players - Ruwach: $nohide Buffs: $skills
log Random Walk: $randomwalk Free will: $freewill KOS: $kos
log Homeplace: $homemap Locked Place: $lockedmap
log Commands are: follow / stop / prt / gef / pay / br
log home / fp / walk / free / duel / kill / kos / skill / warp / go
log ===================================================
log Kill On Sight players: @config(kos_pk) @config(kos_pk2)
log ===================================================

call move2
}

#### MASTER


automacro mapchange99 { 
mapchange any
call {
release newmove
}
}

automacro masterlost {
#var randomwalk = 2
exclusive 1
console "I lost my master"
timeout 1
#location prt_fild08
call {
release move
release newmove
}
}

automacro masterfound {
hook player
exclusive 1
var randomwalk = 2
console "Found my master!"
timeout 1
#location prt_fild08
call {
lock newmove
}
}

#### KOS

automacro kos2 {
status not dead
exclusive 1
overideAI 1
hook player
location not "name for map"
location not "name for map"
location not "name for map"
location not "name for map"
var kos = 1
call kos1
}

macro kos1 {
if (@player(@config (kos_pk)) >= 0) goto kill1
if (@player(@config (kos_pk2)) >= 0) goto kill2
goto end
:kill1
lock move
lock freew
lock newmove
$lastpos = $.pos $.map
$mytarget = @config(kos_pk)
set exclusive 0
do kill @player(@config (kos_pk))
goto end
:kill2
lock move
lock freew
lock newmove
$lastpos = $.pos $.map
$mytarget = @config(kos_pk2)
set exclusive 0
do kill @player(@config (kos_pk2))
:end
}

#### RANDOM WALK SETUP

automacro move {
#overideAI 1
var randomwalk = 1
priority 5
location not "name for map"
location not "name for map"
location not "name for map"
location not "name for map"
timeout 10
call move3
}

automacro newmove {
#overideAI 1
#location gef_fild10, prt_fild08
priority 5
location not "name for map"
location not "name for map"
location not "name for map"
location not "name for map"
var randomwalk = 2
timeout 10
call move2
}

macro move2 {
set exclusive 0
$look = @random ("look 4", "lookp @player($master)", "look 4")
$px = @arg ("$.pos", 1)
$py = @arg ("$.pos", 2)
if ($.map = map name) goto "map name"
if ($.map = map name) goto "map name"
if ($.map = @arg("$homemap", 3)) goto end
goto other
:makenew
$n = @rand(1, 5)
$m = @rand(1, 5)
$posx = @arg ("$.pos", 1)
$posy = @arg ("$.pos", 2)
$eval = @random ("-", "+")
$lastpos = @eval ($px $eval $n) @eval ($py $eval $m) $.map
#if (@player(@config (kos_pk)) >= 0) goto kill1
#if (@player(@config (kos_pk2)) >= 0) goto kill2
do move @eval ($px $eval $n) @eval ($py $eval $m) $.map
goto end

:ss
#if (@player(@config (kos_pk)) >= 0) goto kill1
#if (@player(@config (kos_pk2)) >= 0) goto kill2
$n = @rand (0,1)
$m = @rand(1, 2)
$posx = @arg ("$.pos", 1)
$posy = @arg ("$.pos", 2)
$eval = @random ("-", "-")
#if (@player(@config (kos_pk)) >= 0) goto kill1
#if (@player(@config (kos_pk2)) >= 0) goto kill2
do move @eval ($posx $eval $n) @eval ($posy $eval $m) $.map
#if (@player(@config (kos_pk)) >= 0) goto kill1
#if (@player(@config (kos_pk2)) >= 0) goto kill2
$do = @random ("ss 135", "ss 406", "", "ss 138", "ss 406", "look 4", "ss 135", "ss 406", "ss 406")
do $do
goto end

:cont
#if (@player(@config (kos_pk)) >= 0) goto kill1
#if (@player(@config (kos_pk2)) >= 0) goto kill2
$mrnd = @rand (1, 3)
if ($mrnd = 1) goto move
if ($mrnd = 2) goto ss
if ($mrnd = 3) goto ss
goto end
:move
#if (@player(@config (kos_pk)) >= 0) goto kill1
#if (@player(@config (kos_pk2)) >= 0) goto kill2
if (@arg("$lastpos", 3) != $.map) goto makenew
if (@arg("$lastpos", 1) = 0) goto makenew
$n = @rand(2, 6)
$m = @rand(2, 6)
$posx = @arg ("$.pos", 1)
$posy = @arg ("$.pos", 2)
$eval = @random ("-", "+")
#if (@player(@config (kos_pk)) >= 0) goto kill1
#if (@player(@config (kos_pk2)) >= 0) goto kill2
do @random ("move $lastpos", "move @eval ($posx $eval $n) @eval ($posy $eval $m) $.map")
#if (@player(@config (kos_pk)) >= 0) goto kill1
#if (@player(@config (kos_pk2)) >= 0) goto kill2
$do = @random ("ss 135", "ss 406", "", "ss 138", "ss 138", "look 4", "ss 150", "ss 135", "e ho")
do $do
goto end
:"map name"
$do = @random ("", "ss 406", "", "")
do $do
$xx = @rand (156, 171)
$yy = @rand (354, 360)
$px = @arg ("$.pos", 1)
$py = @arg ("$.pos", 2)
#if (@player(@config (kos_pk)) >= 0) goto kill1
#if (@player(@config (kos_pk2)) >= 0) goto kill2
do move $xx $yy $.map
goto cont
:geffild
$do = @random ("", "ss 406", "", "")
do $do
$xx = @rand (65, 73)
$yy = @rand (308, 327)
#if (@player(@config (kos_pk)) >= 0) goto kill1
#if (@player(@config (kos_pk2)) >= 0) goto kill2
do move $xx $yy $.map2
goto cont
:other
$do = @random ("", "ss 406", "", "")
do $do
$posx = @arg ("$.pos", 1)
$posy = @arg ("$.pos", 2)
$n = @rand(1, 3)
$m = @rand(1, 3)
$eval = @random ("-", "+")
#if (@player(@config (kos_pk)) >= 0) goto kill1
#if (@player(@config (kos_pk2)) >= 0) goto kill2
do move @eval ($posx $eval $n) @eval ($posy $eval $m) $.map
goto cont
:kill1
do kill @player(@config (kos_pk))
$lastpos = $.pos $.map
goto end2
:kill2
do kill @player(@config (kos_pk2))
$lastpos = $.pos $.map
goto end2
:end
if (@player(@config (kos_pk)) >= 0) goto kill1
if (@player(@config (kos_pk2)) >= 0) goto kill2
:end2
}

macro move3 {
set exclusive 0
#if (@player(@config (kos_pk)) >= 0) goto kill1
#if (@player(@config (kos_pk2)) >= 0) goto kill2
$look = @random ("look 4", "lookp @player($master)", "look 4")
$px = @arg ("$.pos", 1)
$py = @arg ("$.pos", 2)
if ($.map = @arg("$homemap", 3)) goto end
goto other
:makenew
$n = @rand(1, 5)
$m = @rand(1, 5)
$posx = @arg ("$.pos", 1)
$posy = @arg ("$.pos", 2)
$eval = @random ("-", "+")
$lastpos = @eval ($px $eval $n) @eval ($py $eval $m) $.map
#if (@player(@config (kos_pk)) >= 0) goto kill1
#if (@player(@config (kos_pk2)) >= 0) goto kill2
do move @eval ($px $eval $n) @eval ($py $eval $m) $.map
goto end

:ss
#if (@player(@config (kos_pk)) >= 0) goto kill1
#if (@player(@config (kos_pk2)) >= 0) goto kill2
$n = @rand (0,1)
$m = @rand(1, 2)
$posx = @arg ("$.pos", 1)
$posy = @arg ("$.pos", 2)
$eval = @random ("-", "+")
#if (@player(@config (kos_pk)) >= 0) goto kill1
#if (@player(@config (kos_pk2)) >= 0) goto kill2
do move @eval ($posx $eval $n) @eval ($posy $eval $m) $.map
if (@player(@config (kos_pk)) >= 0) goto kill1
if (@player(@config (kos_pk2)) >= 0) goto kill2
$do = @random ("ss 135", "ss 406", "", "ss 138", "ss 406", "look 4", "ss 135", "ss 406", "ss 406")
do $do
goto end

:cont
#if (@player(@config (kos_pk)) >= 0) goto kill1
#if (@player(@config (kos_pk2)) >= 0) goto kill2
$mrnd = @rand (1, 3)
if ($mrnd = 1) goto move
if ($mrnd = 2) goto ss
if ($mrnd = 3) goto ss
goto end
:move
#if (@player(@config (kos_pk)) >= 0) goto kill1
#if (@player(@config (kos_pk2)) >= 0) goto kill2
if (@arg("$lastpos", 3) != $.map) goto makenew
if (@arg("$lastpos", 1) = 0) goto makenew
$n = @rand(1, 5)
$m = @rand(1, 5)
$posx = @arg ("$.pos", 1)
$posy = @arg ("$.pos", 2)
$eval = @random ("-", "+")
#if (@player(@config (kos_pk)) >= 0) goto kill1
#if (@player(@config (kos_pk2)) >= 0) goto kill2
do move @eval ($posx $eval $n) @eval ($posy $eval $m) $.map
#if (@player(@config (kos_pk)) >= 0) goto kill1
#if (@player(@config (kos_pk2)) >= 0) goto kill2
$do = @random ("ss 135", "ss 406", "", "ss 138", "ss 138", "look 4", "ss 150", "ss 135", "e ho")
do $do
goto end
:other
$do = @random ("", "ss 406", "", "")
do $do
$posx = @arg ("$.pos", 1)
$posy = @arg ("$.pos", 2)
$n = @rand(1, 3)
$m = @rand(1, 3)
$eval = @random ("-", "+")
#if (@player(@config (kos_pk)) >= 0) goto kill1
#if (@player(@config (kos_pk2)) >= 0) goto kill2
do move @eval ($posx $eval $n) @eval ($posy $eval $m) $.map
goto cont
:kill1
$lastpos = $.pos $.map
do kill @player(@config (kos_pk))

goto end
:kill2
$lastpos = $.pos $.map
do kill @player(@config (kos_pk2))
goto end2
:end
if (@player(@config (kos_pk)) >= 0) goto kill1
if (@player(@config (kos_pk2)) >= 0) goto kill2
:end2
}

##### FREE WILL

automacro freew {
overideAI 1
location not "map name"
location not "map name"
location not "map name"
location not "map name"
var freewill = 1
timeout 45
call freewill
}

macro freewill {
$will = @random ("macro sit", "look", "emo", "macro move2", "look", "emo", "macro move2", "macro attack", "macro san", "macro attack2", "macro san2")
if ($will = macro move2) goto move
if ($will = macro sit) goto sit
if ($will = look) goto look
if ($will = emo) goto emo
if ($will = macro attack) goto atk
if ($will = macro san) goto san
if ($will = macro attack2) goto atk2
if ($will = macro san2) goto san2
goto end
:move
call move2
goto end
:sit
call sit
goto end
:emo
call emo
goto end
:look
call look
:atk
call attack
:atk2
call attack2
:san
call san
:san2
call san2
:end
}

macro look {
if (@player(@config (kos_pk)) >= 0) goto kill1
if (@player(@config (kos_pk2)) >= 0) goto kill2
if (@player($master) >= 0) goto one
goto two
:one
$look = lookp @player($master)
do $look
do $look
do $look
do $look
do $look
goto end
:two
$look = @random ("look 4", "look 3", "look 5", "look 4")
do $look
goto end
:kill1

do kill @player(@config (kos_pk))
$lastpos = $.pos $.map
goto end
:kill2

do kill @player(@config (kos_pk2))
$lastpos = $.pos $.map
goto end
:end
}

macro emo {
if (@player(@config (kos_pk)) >= 0) goto kill1
if (@player(@config (kos_pk2)) >= 0) goto kill2
$look = @random ("e e2", "e e2", "c ....", "e ho", "e e10")
do $look
goto end
:kill1

do kill @player(@config (kos_pk))
$lastpos = $.pos $.map
goto end
:kill2

do kill @player(@config (kos_pk2))
$lastpos = $.pos $.map
goto end
:end
}

macro sit {
if (@player($master) >= 0) goto one
goto two
:one
$look = lookp @player($master)
do $look
goto sit
:two
$look = @random ("look 4", "look 3", "look 5", "look 4", "look 4")
do $look
:sit
$times = @rand (8, 12)
$i = 0
while ($i < $times) as sitloop
pause 3
do sit
do $look
if (@player(@config (kos_pk)) >= 0) goto kill1
if (@player(@config (kos_pk2)) >= 0) goto kill2
$i++
end sitloop
if (@player($master) >= 0) goto emo
goto end
:emo
pause 1
do @random ( "", "e e2", "", "", "e e8", "", "", "", "e ho", "e e10")
goto end
:kill1

do kill @player(@config (kos_pk))
$lastpos = $.pos $.map
goto end
:kill2

do kill @player(@config (kos_pk2))
$lastpos = $.pos $.map
goto end
:end
}




macro san1 {
if (@player($master) >= 0) goto one
goto end
:one
do @random ( "sp 70 $master", "sp 70 $master")
do @random ( "sp 70 $master", "sp 70 $master")
pause 1
do @random ( "", "e e2", "", "", "e e8", "", "", "", "e ho")
:end
}

macro san2 {
# if (@player($master) >= 0) goto one
goto end
:one
do @random ( "ss 70", "ss 70")
do @random ( "ss 70", "ss 70")
pause 1
:end
}

macro attack {

if (@player($master) >= 0) goto one
goto end
:one
do sp 156 $master
do @random ("sp 156 $master", "sp 28 $master", "","sp 156 $master")
do sp 28 $master
pause 2
do @random ( "e heh", "e e2", "", "", "e gg", "c P", "", "c ^^", "c =)", "")
:end
}


macro attack2 {

$randplayer = @rand (0, 1)
if (@player($master) >= 0) goto one
:one
do sp 156 $randplayer 
do @random ("sp 156 $randplayer ", "sp 28 $randplayer ")
do @random ("sp 156 $randplayer ", "sp 28 $randplayer ")
pause 2
do @random ( "e heh", "e e2", "", "", "e gg", "e ho", "", "c xD", "", "")
:end

}


###################
##### SKILLS ######

# PUBLIC

automacro Healer {
var job != 1
pubm /heal|Heal|hp|HP/,6
sp >= 80%
timeout 20
call doheal
}

automacro Buffer {
var job != 1
class high priest
pubm /buff|bufs|Buffs|BUFF|baps|Buf|buffs|agi|bless/,6
sp >= 80%
timeout 20
call dobuff
}

automacro ruwach1 {
var job != 1
pubm /ruwach/,6
timeout 46
call dorwch
}

automacro res99 {
timeout 15
var job != 1
class high priest
pubm /res|resu|ressu|ress/
call Ressurection
}


automacro killme {
timeout 15
pubm /kill me|kill me pls/
call killme2
}

macro killme2 {
pause 2
do kill @player($.lastpub)
}
}

macro Ressurection {
if ($.lastpub = $master) goto one
if ($skills = 1) goto one
goto end
:one 
do ip @inventory (yggdrasil leaf) @player ($.lastpub)
goto over
:end
pause 2
do @random ("c nop", "c nope", "e ??", "e lv2", "e e2", "e ??", "c =/", "c no", "e ??", "", "", "")
:over
pause 2
do @random ("c P", "c ^^", "e heh", "", "", "e e2", "", "e ok", "e e2", "", "")
}

automacro SW3 {
var job != 1
pubm /safety|safe|wall/
timeout 1
call SW4
}


macro SW4 {
if ($.lastpub = Hakuro) goto one
if ($skills = 1) goto one
goto end
:one 
do sp 12 "$.lastpub"
#do sp 24 "$.lastpub"
goto over
:end
pause 2
do @random ("c nop", "c nope", "e ??", "e lv2", "e e2", "e e8", "c =/", "c no", "e ?", "", "", "")
:over
pause 2
do @random ("c P", "c ^^", "e heh", "", "", "e e2", "", "e ho", "e e2", "", "")
}

automacro Buffer2 {
timeout 15
var job != 1
class high priest
pubm /assump|asump|asp/,6
call assump
}

macro assump {
$name = $.lastpub
#if ($.lastpub = Hakuro) goto one
if ($skills = 1) goto one
goto end
:one 
do sp 361 "$.lastpub" 10
#do sp 24 "$.lastpub"
goto over
:end
pause 2
do @random ("c nop", "c nope", "e ??", "e lv2", "e e2", "e e8", "c no", "e gg", "")
:over
pause 2
do @random ("c P", "c ^^", "e heh", "", "", "e e2", "", "e e10", "e e2", "c D", "", "")
}

# PRIVATE

automacro healz {
timeout 15
var job != 1
pm "heal"
pm "hp"
call healz2
}

automacro buffz {
timeout 15
var job != 1
pm /buff/i
call buffz2
}

macro doheal {
if ($.lastpub = $master) goto one
if ($skills = 1) goto one
goto end
:one 
$times = @rand (2, 7)
$i = 0
while ($i < $times ) as healloop
do sp 28 "$.lastpub" 10
$i++
end healloop
goto over
:end
pause 2
do @random ("c nop", "c nope", "e ??", "e lv2", "e e2", "e ??", "c =/", "c no", "e ??", "", "", "")
:over
pause 3
do @random ("c P", "c ^^", "e heh", "", "", "e e2", "", "e gg", "e e2", "", "")
}

macro buffz2 {
if ($.lastpm = $master)goto one
goto end
:one 
do sp 34 "$.lastpm" 10
do sp 29 "$.lastpm" 10
do sp 361 "$.lastpm" 10
goto over
:end
pause 2
do @random ("c nop", "c nope", "e ??", "e lv2", "e e2", "e e8", "c =/", "c no", "e ??", "", "", "")
:over
pause 2
do @random ("c P", "c ^^", "e heh", "", "", "e e2", "", "e gg", "e e2", "", "")
}

macro healz2 {
if ($.lastpm = $master) goto one
goto end
:one 
$times = @rand (6, 12)
$i = 0
while ($i < $times ) as healloop
log loop $i
do sp 28 "$.lastpm" 10
$i++
end healloop
goto end
:end
}

macro dorwch {
do sp 24 "$.lastpub"
}

macro dobuff {
if ($.lastpub = $master) goto one
if ($skills = 1) goto one
goto end
:one 
do sp 34 "$.lastpub" 10
do sp 29 "$.lastpub" 10
goto over
:end
pause 2
do @random ("c nop", "c nope", "e ??", "e lv2", "e e2", "e e8", "c =/", "c no", "e ?", "", "", "")
:over
pause 2
do @random ("c P", "c ^^", "e heh", "", "", "e e2", "", "e gg", "e e2", "", "")

}

automacro SW1 {
var job != 1
pm /^(sw)$/
call SW2
}

macro SW2 {
if ($.lastpm = $master) goto one
goto end
:one 
do sp 12 "$.lastpm"
#do sp 24 "$.lastpm"
goto end
:end
}

automacro Ruwach999 {
var job != 1
console /Player .* .* uses Ruwach on himself/i
var nohide = 1
timeout 65
call {
pause 2
do ss 24
}
}


# FIND CLOACKERS


automacro nohide {
var job != 1
var nohide = 1
console /Player (.*) \((\d+)\) uses Cloaking on himself/i
timeout 25
call {
do sp 24 $.lastMatch2
}
}

automacro nohide2 {
var job != 1
var nohide = 1
console /player (.*) \((\d+)\) uses Hiding on himself/i
timeout 25
call {

do sp 24 $.lastMatch2
}
}

automacro nohide3 {
var job != 1
timeout 12
var nohide = 1
console /player (.*) \((\d+)\) uses Chase Walk on himself/i
call {
do sp 24 $.lastMatch2
}
}


######## COMMANDS / CHAT #########

automacro fs1 {
var job != 1
exclusive 1
pm "duel conf"
class champion
call {
do switchconf ChampDuel.txt
do pm "$.lastpm" switched duel
}

automacro fs2 {
var job != 1
exclusive 1
class champion
pm "main conf"
call {
do switchconf ChampMain.txt
do pm "$.lastpm" switched to main
}
}

automacro fs3 {
var job != 1
class high priest
exclusive 1
pm "party"
call {
do switchconf ChampParty.txt
do pm "$.lastpm" ok party
}
}

automacro fs4 {
class high priest
var job != 1
pm "party"
call {
do switchconf FSparty.txt
do pm "$.lastpm" ok party
}
}

automacro fs5 {
class high priest
var job != 1
pm "main"
call {
do switchconf FSmain.txt
do pm "$.lastpm" switched to main
}
}

automacro walk {
exclusive 1
pm /^(walk)$/
call {
if ($randomwalk = 2) goto off
if ($randomwalk = 1) goto on2
if ($randomwalk = 0) goto on
goto end
:on
release move

$randomwalk = 1
do pm "$.lastpm" Randomwalk v 1 Enabled
goto end
:on2

$randomwalk = 2
do pm "$.lastpm" Randomwalk v 2 Enabled
goto end
:off

$randomwalk = 0
do pm "$.lastpm" Randomwalk Disabled
goto end
:end
}
}

automacro usefp {
exclusive 1
pm "fp"
call {
if ($fp = 1) goto off
if ($fp = 0) goto on
goto end
:on

$fp = 1
do pm "$.lastpm" Using FP Enabled
goto end
:off

$fp = 0
do pm "$.lastpm" Using FP Disabled
goto end
:end
}
}

automacro Follow {
overrideAI 1
exclusive 1
pm /^(follow|fm|go)$/,
call follow2
}

macro follow2 {
do follow $.lastpm
do pm "$.lastpm" Following "$.lastpm" !!
$randomwalk = 1
}

automacro FollowP {
exclusive 1
overrideAI 1
party /^(follow|fm|go)$/
call follow3
}



macro follow3 {
do follow $.lastparty
do p " Following "$.lastparty" !!
$randomwalk = 1
}

automacro kos_no {
exclusive 1
overrideAI 1
pm "stop"
call {
#do pm "$.lastpm" Players: [ @config(kos_pk) | @config(kos_pk2) ] - are no longer my enemies.
do conf kos_pk none
do conf kos_pk2 none
$damage = 0
$pla = none
$kospla = none
do pm "$.lastpm" I stopped.
}
}

automacro kos_duel {
exclusive 1
overrideAI 1
pm "duel"
call {
do conf kos_pk $.lastpm
$freewill = 0
$damage = 10
pause 1
do pm "$.lastpm" @random ( "Lets Have Fun", "Game", "Sure")
pause 1
do @random ("e gg", "c XD", "e e9")
pause 1
do c 3
pause 1
do c 2
pause 1
do c 1
pause 1
do e go
do kill @player(@config(kos_pk))
}
}

automacro kos001 {
exclusive 1
overrideAI 1
pm /^(kos )/i
call {
$kospla = @arg ("$.lastpmMsg", 2)
if (@player($kospla) >= 0) goto kill
goto nopla
:kill
do conf kos_pk2 @config(kos_pk)
do conf kos_pk $kospla
do pm "$.lastpm" kos_pk set to: @config(kos_pk) | kos_pk2 set to: @config(kos_pk2)
do kill @player($kospla)
goto end
:nopla2
$pla = @arg ("$.lastpmMsg", 2)
do pm "$.lastpm" Can't recognize $kospla. Spell his name accurately.
goto end
:nopla
do pm "$.lastpm" Player $kospla doesn't exists.
do pm "$.lastpm" Searching again....
$kospla = @arg ("$.lastpmMsg", 2) @arg ("$.lastpmMsg", 3) @arg ("$.lastpmMsg", 4) @arg ("$.lastpmMsg", 5) @arg("$.lastpmMsg", 6)
if (@player($kospla) >= 0) goto kill
goto nopla2
:end
}
}
}

automacro killpla {
exclusive 1
overrideAI 1
pm /^(kill )/i
call {
$pla = @arg ("$.lastpmMsg", 2)
if (@arg ("$.lastpmMsg", 2) = me) goto killme
if (@player($pla) >= 0) goto kill
goto nopla
:killme
do pm "$.lastpm" I am gonna kill you !!!
do kill @player($.lastpm)
goto end
:kill

do pm "$.lastpm" I am gonna kill $pla
do kill @player($pla)
goto end
:nopla2
$pla = @arg ("$.lastpmMsg", 2)
do pm "$.lastpm" Can't recognize $pla. Spell his name accurately.
goto end
:nopla
do pm "$.lastpm" Player $pla doesn't exists.
do pm "$.lastpm" Searching again....
$pla = @arg ("$.lastpmMsg", 2) @arg ("$.lastpmMsg", 3) @arg ("$.lastpmMsg", 4) @arg ("$.lastpmMsg", 5) @arg("$.lastpmMsg", 6)
if (@player($pla) >= 0) goto kill
goto nopla2
:end
}
}

automacro wait {
exclusive 1
overrideAI 1
pm /^(wait|w)$/,
call wait2
}


macro wait2 {
do conf follow 0
do sit
do pm "$.lastpm" Waiting you at $.map !!
}

automacro skills {
exclusive 1
pm "skill"
call {
if ($skills = 1) goto off
if ($skills = 0) goto on
goto end
:on

$skills = 1
do pm "$.lastpm" Autoskills Enabled
goto end
:off

$skills = 0
do pm "$.lastpm" Autoskills Disabled
goto end
:end
}
}

automacro setfw {
exclusive 1
pm "free"
call {
if ($freewill = 1) goto off
if ($freewill = 0) goto on
goto end
:on

$freewil = 1
do pm "$.lastpm" Free Will Enabled
goto end
:off

$freewill = 0
do pm "$.lastpm" Free Will Disabled
goto end
:end
}
}

automacro status {
exclusive 1
pm "st"
call {
do pm $.lastpm My positon: $.pos $.map. Locked map: $lockedmap Enemies: @config(kos_pk) @config(kos_pk2).
}
}

# 0 - 26

automacro gowarp {
exclusive 1
pm /^(go )/i
call Lockmap77
}

macro Lockmap77 {
$go = @arg ("$.lastpmMsg", 2)
do c @go $go
pause 1
do pm "$.lastpm" Warped to $.map
$location = $.map
$lock = 0
call move2
}

automacro dowarp {
exclusive 1
pm /^(warp )/i
call Lockmap78
}

macro Lockmap78 {
$warp = @arg("$.lastpmMsg", 2) @arg("$.lastpmMsg", 3) @arg("$.lastpmMsg", 4)
do c @warp $warp
pause 1
do pm "$.lastpm" Warped to $.map $.pos
$location = $.map
$lock = 0
call move2
}

automacro dowarpP {
exclusive 1
party /^(warp )/i
call Lockmap79
}

macro Lockmap79 {
$warp = @arg ("$.lastpartyMsg", 2) @arg ("$.lastpartyMsg", 3) @arg ("$.lastpartyMsg", 4)
do c @warp $warp
pause 1
do p Warped to $.map $.pos
$location = $.map
$lock = 0
call move2
}

#### SET LOCKED MAP

automacro lockedmap3go19 {
exclusive 1
overrideAI 1
pm /^(pay)$/,
call {
$lock = 1
$lockedmap = Map_Name
$location = Map_name

if ($follow = 1) goto f
goto next
:f
do follow $master
:next
do pm "$.lastpm" Locked Map: $lockedmap
call Lockmap99
}
}

automacro lockedmap4go15 {
exclusive 1
overrideAI 1
pm /^(br)$/,
call {
$lock = 1
$lockedmap = new_1-1 52 111
$location = new_1-1

if ($follow = 1) goto f
goto next
:f
do follow $master
:next
do pm "$.lastpm" Locked Map: $lockedmap
call Lockmap99
}
}

automacro lockedmap1prt {
exclusive 1
overrideAI 1
pm /^(prt)$/,
call {
$lock = 1
$xxx = @rand (100, 200)
$yyy = @rand (335, 369)
$lockedmap = prt_fild08 $xxx $yyy

$location = map_name
if ($follow = 1) goto f
goto next
:f
do follow $master
:next
do pm "$.lastpm" Locked Map: $lockedmap
call Lockmap99
}
}

automacro lockedmap0home {
exclusive 1
overrideAI 1
pm /^(home)$/,
call {
$lock = 1
do conf follow 0
$lockedmap = $homemap

$location = Map_name
do pm "$.lastpm" Locked Map: $lockedmap
call Lockmap99
}
}

automacro lockedmap2gef {
exclusive 1
overrideAI 1
pm /^(gef)$/,
call {
$lock = 1
$lockedmap = Map_name x, y
$location = Map_name

if ($follow = 1) goto f
goto next
:f
do follow $master
:next
do pm "$.lastpm" Locked Map: $lockedmap
call Lockmap99
}
}


##########################
# Do something when buffed
##########################

macro bemad {
$buffs = 10
:start
$i = 0
while ($i < $buffs ) as buffloop
$nmes = $mes
$mes = @random ("e e5", "c Oo", "sp 156 $.lastMatch2", "sp 78 $.lastMatch2", "", "e gg", "c lol", "e e2", "sp 78 $.lastMatch2")
if ($nmes = $mes) goto start
if ($nmes != $mes) goto end
$i++
end buffloop
:end
pause 2
do $mes
$.lastMatch2 = none
}

macro begood {
$buffs = 10
:start
$i = 0
while ($i < $buffs ) as buffloop
$nmes = $mes
$mes = @random ("c ty", "c thanx", "c thanks", "e lv2", "c ty^^", "c ^^", "c xD", "e thx", "e ho", "c thx")
if ($nmes = $mes) goto start
if ($nmes != $mes) goto end
$i++
end buffloop
:end
pause 2
do $mes
}

macro begood2 {
$buffs = 10
:start
$i = 0
while ($i < $buffs ) as buffloop
$nmes = $mes
$mes = @random ("c ty", "c thanx", "c thanks", "e lv2", "c ty^^", "c ^^", "c xD", "e thx", "buff", "buff", "buff")
if ($nmes = $mes) goto start
if ($nmes != $mes) goto end
if ($mes = buff) goto buff
$i++
end buffloop
:buff
pause 1
do sp 34 $.lastMatch2 10
do sp 29 $.lastMatch2 10
goto end2
:end
pause 2
do $mes
:end2
}

macro buffed02 {
$buffs = 10
:start
$i = 0
while ($i < $buffs ) as buffloop
$nmes = $mes
$mes = @random ("", "", "sp 34 $.lastMatch2 1", "c <.<", "e thx", "e e8", "e e2")
if ($nmes = $mes) goto start
if ($nmes != $mes) goto end
if ($mes = unset) goto end
$i++
end buffloop
:end
pause 2
do $mes
#$.lastMatch1 = none
}

macro buffed01 {
$buffs = 10
:start
$i = 0
while ($i < $buffs ) as buffloop
$nmes = $mes
$mes = @random ("", "", "sp 29 $.lastMatch2 1", "", "c >.>", "e ho", "", "c xD", "e e2")
if ($nmes = $mes) goto start
if ($nmes != $mes) goto end
if ($mes = unset) goto end
$i++
end buffloop
:end
pause 2
do $mes
#$.lastMatch1 = none
}

automacro fped101 {
console /player (.*) \((\d+)\) uses full chemical protection on you.*/i
call begood2
timeout 30
}

automacro buffed11 {
console /player (.*) \((\d+)\) uses blessing on you.*/i
call buffed02
timeout 50
}

automacro buffed12 {
console /player (.*) \((\d+)\) uses increase agi on you.*/i
call buffed01
timeout 50
}


automacro buffed13 {
spell assumptio
timeout 45
call begood
}

automacro buffed14 {
console /player (.*) \((\d+)\) uses provoke on you.*/i
call bemad
timeout 50
}

automacro buffed15 {
console /player (.*) \((\d+)\) uses heal on you.*/i
call begood
timeout 50
}


#####################################
# PLAYER KILL #
#####################################

macro pk_STAY_CALM {
set exclusive 1
do pm "$master" $.lastMatch1 is playing with fire.
$damage++
if ($damage > 2) goto one
goto over
:one
$damage++
pause 1
do @random ("e ?", "e e2", "e gg", "c lol", "", "c aw", "e e2")
call pk_ATTACK_ONCE
:over
}



macro pk_WARN {
set exclusive 1
do pm "$master" $.lastMatch1 is playing with fire.
$damage = @eval($damage + 0.75)
#if ($damage > 5) goto one
if ($damage > 10) goto one
goto over
:one
call KILL_PK
:over
pause 2
do @random ( "", "", "e lv2", "e e2", "", "e gg", "", "e lv", "", "", "e heh", "", "", "c aw", "", "e e2")
}

macro pk_WARN2 {
set exclusive 1
do pm "$master" $.lastMatch1 is playing with fire.
$damage = @eval ($damage + 0.75)
if ($damage > 10) goto one
goto over
:one
call KILL_PK
:over
pause 2
do @random ( "", "c aw", "e lv2", "e e2", "", "e gg", "", "e ?", "e lv", "c lol", "e heh", "e ??", "e ??")

}

macro pk_ATTACK_ONCE {
set exclusive 1
do pm "$master" $.lastMatch1 attacked me.
$damage = @eval ($damage + 2.5)
#if ($damage > 3) goto two
if ($damage > 10) goto two
goto one
:one
do $atk $.lastMatch2
goto over
:two
#pause 2
#do @random ("e gg", "", "e gg", "", "e e2", "", "", "e heh", "", "c aw", "", "c lol", "sp 156 $.lastMatch2", "sp 156 $.lastMatch2")
call KILL_PK
:over
}

macro KILL_DEAD {
set exclusive 1
if ($.lastMatch1 = @config(kos_pk)) goto justkill
if ($.lastMatch1 = @config(kos_pk2)) goto justkill
if ($.lastMatch1 = $master) goto nvm

do conf kos_pk2 @config(kos_pk)
do conf kos_pk $.lastMatch1
do kill $.lastMatch2
do pm "$master" $.lastMatch1 is my enemy !!
goto end
:justkill
do pm "$master" I guess i am dead... $.lastMatch1 killed me @_@
do kill $.lastMatch2
$lastpos = $.pos $.map
goto end
:nvm
do pm "$master" I wont kill my master.
:end
}
}

macro KILL_PK {
set exclusive 1
if ($.lastMatch1 = @config(kos_pk)) goto justkill
if ($.lastMatch1 = @config(kos_pk2)) goto justkill
if ($.lastMatch1 = $master) goto nvm
set exclusive 0
do kill $.lastMatch2
do conf kos_pk2 @config(kos_pk)
do conf kos_pk $.lastMatch1
do pm "$master" $.lastMatch1 is my enemy !!
goto end
:justkill
set exclusive 0
do kill $.lastMatch2
do pm "$master" $.lastMatch1 attacked me @_@
$lastpos = $.pos $.map
goto end
:nvm
do pm "$master" I wont kill my master.
goto end2
:end
#$mes = @random ("e gg", "e e4", "c PWNT")
#if ($nmes = $mes) goto end2
#do $mes
#$nmes = $mes
:end2
}

automacro TargetDied {
exclusive 1
overrideAI 1
priority 0
console /player died: (.*) \((\d+)\).*/i
#console /target lost/i
call {
#do say lol
if (@player($.lastMatch1) = @player($mytarget)) goto taunt
goto end
:taunt
#do say lol
#do c newb
release move
release freew
release newmove
$td = 1
$do = @random ("ss 138", "e gg", "e swt", "ss 138", "look 4", "look 4", "ss 150", "ss 150", "ss 406", "e e2", "e ho", "e swt")
do $do
:end 
}
}

automacro TargetResu {
exclusive 1
overrideAI 1
priority 0
console /player (.*) \((\d+)\) has been resurrected/i
#console /target lost/i
call {
#do say lol
if (@player($.lastMatch1) = @player($mytarget)) goto taunt
goto end
:taunt
#do say lol
#do c newb
call kos1
#$td = 1
#$do = @random ("ss 138", "e gg", "e swt", "ss 138", "look 4", "look 4", "ss 150", "ss 150", "ss 406", "e e2", "e ho", "e swt")
#do $do
:end 
}
}

automacro TargetLost {
exclusive 1
overrideAI 1
priority 0
console /target lost/i
#console /target lost/i
call {
#do say lol
if (@player($.lastMatch1) = @player($mytarget)) goto taunt
goto end
:taunt
#do say lol
#do c newb
release move
release freew
release newmove
$do = @random ("ss 138", "e gg", "e swt", "ss 138", "look 4", "look 4", "ss 150", "ss 150", "ss 406", "e e2", "e ho", "e swt")
do $do
:end 
}
}

#################################
#####SELF DEFEND - ON SKILL#####
#################################

automacro pked378 {
overrideAI 1
timeout 3
####DAMAGE RANGE 100 - 999#########################
console /player (.*) \((\d+)\) uses .* on you - dmg: \b[1-9][0-9]{2}\b/i
call pk_WARN
}

automacro pked554 {
overrideAI 1
####DAMAGE RANGE 2000 - 5999#######################
timeout 1
console /player (.*) \((\d+)\) uses .* on you - dmg: \b[2-5][0-9]{3}\b/i
call pk_STAY_CALM
}



automacro pked959 {
overrideAI 1
priority 1
####DAMAGE RANGE 6000 - 9999#######################
console /player (.*) \((\d+)\) uses .* on you - dmg: \b[6-9][0-9]{3}\b/i
call KILL_PK
}

automacro pked645 {
overrideAI 1
####DAMAGE RANGE 10000 - 99999#####################
console /player (.*) \((\d+)\) uses .* on you - dmg: \b[1-9][0-9]{4}\b/i
call KILL_PK
}

automacro pked764 {
overrideAI 1
exclusive 1
# Asura? =)
####DAMAGE RANGE 100000 - 999999#####################
console /player (.*) \((\d+)\) uses .* on you - dmg: \b[1-9][0-9]{5}\b/i
call {
do kill $.lastMatch2
KILL_DEAD
}

#################################
#####SELF DEFEND - ON MELEE####
#################################


automacro pked356 {
overrideAI 1
####DAMAGE RANGE 10 - 90########################
console /player (.*) \((\d+)\) attacks you - dmg: \b[1-9][0-9]{1}\b/i
timeout 3
call pk_WARN
}


automacro pked303 {
overrideAI 1
timeout 2
####DAMAGE RANGE 100 - 900########################
console /player (.*) \((\d+)\) attacks you - dmg: \b[1-9][0-9]{2}\b/i
call pk_WARN
}

automacro pked101 {
overrideAI 1
timeout 1
####DAMAGE RANGE 1000 - 4000#######################
console /player (.*) \((\d+)\) attacks you - dmg: \b[1-4][0-9]{3}\b/i
call pk_STAY_CALM
}

automacro pked102 {
overrideAI 1
#timeout 1
####DAMAGE RANGE 5000 - 9999#######################
console /player (.*) \((\d+)\) attacks you - dmg: \b[5-9][0-9]{3}\b/i
call KILL_PK
}

automacro pked485 {
overrideAI 1
####DAMAGE RANGE 10000 - 99999#####################
console /player (.*) \((\d+)\) attacks you - dmg: \b[1-9][0-9]{4}\b/i
call KILL_PK
}

##############################
## SELF DEFEND - ON OTHER ##
##############################


automacro pked184 {
overrideAI 1
####DAMAGE RANGE BOMB##########
console /player (.*) \((\d+)\) uses Demonstration (lvl 5) on you .*/i
call {
call KILL_PK
}
}

# Todo make bot recognize if enemy is ranged or not and use pneuma on self
automacro pked18554 {
####DAMAGE RANGE Ranged ##########
overrideAI 1
var job != 1
#timeout 1
exclusive 1
#priority 1
spell Double Strafe, Arrow Repel, Arrow Vulcan, Spear Boomerang, Blitz Beat, Finger Offensive
call {
do move 0 0
do ss 25
call pk_ATTACK_ONCE
}
}



automacro pked5005 {
overrideAI 1
#priority 5
exclusive 1
timeout 1
####DAMAGE RANGE 2000 - 5999#######################
console /player (.*) \((\d+)\) uses Blitz Beat on you .*/i
call {
#$damage = @eval ($damage + 2.5)
do move 0 0
do ss 25
#call pk_WARN2
}
}


automacro pked354597 {
console /player (.*) \((\d+)\) is casting Extremly Fist on you *./i
call {
lock move
lock newmove
lock freew
call KILL_PK
}
}

automacro STRIP {
####FULL STRIP SKILL##############################
console /Player (.*) \((\d+)\) uses full strip on you.*/i
call KILL_PK
}

##################################
###ATTACK SUPPORT - ON SKILL ####
##################################

########### Hakuro ############
automacro PK_Hakuro4373 {
overrideAI 1
console /player Hakuro .* uses Vigor Absorption on player (.*) \((\d+)\)/i
call KILL_PK
}

########### Hakuro ############
automacro PK_Hakuro43788 {
overrideAI 1
console /player Hakuro .* uses Lex Aeterna on player (.*) \((\d+)\)/i
call KILL_PK
}

##########DAMAGE RANGE 1000 - 4999#################
automacro PK_Hakuro313 {
overrideAI 1
console /player Hakuro .* uses .* on player (.*) \((\d+)\) - dmg: \b[1-4][0-9]{3}\b/i
call pk_ATTACK_ONCE
}


##########DAMAGE RANGE 5000 - 9999#################
automacro PK_Hakuro323 {
overrideAI 1
console /player Hakuro .* uses .* on player (.*) \((\d+)\) - dmg: \b[5-9][0-9]{3}\b/i
call {
do kill $.lastMatch2
}
}

###########DAMAGE RANGE 10000 - 999999##############
automacro PK_Hakuro333 {
overrideAI 1
console /player Hakuro .* uses .* on player (.*) \((\d+)\) - dmg: \b[1-9][0-9]{4,5}\b/i
call {
do kill $.lastMatch2
}
}
########### Hakuro^^ ############

##########DAMAGE RANGE 1000 - 4999#################
automacro PK_Hakuro3 {
overrideAI 1
#player Hakuro^^
console /player - Hakuro - .* uses .* on player (.*) \((\d+)\) - dmg: \b[1-4][0-9]{3}\b/i
#console /Hakuro/i
call pk_ATTACK_ONCE
}


##########DAMAGE RANGE 5000 - 9999#################
automacro PK_Hakuro3213 {
overrideAI 1
console /player - Hakuro - .* uses .* on player (.*) \((\d+)\) - dmg: \b[5-9][0-9]{3}\b/i
call {
do kill $.lastMatch2
}
}

###########DAMAGE RANGE 10000 - 999999##############
automacro PK_Hakuro3313 {
overrideAI 1
console /player - Hakuro - .* uses .* on player (.*) \((\d+)\) - dmg: \b[1-9][0-9]{4,5}\b/i
call {
do kill $.lastMatch2
}
}

##################################
##DEFEND SUPPORT - ON MELEE ###
#################################

############ Hakuro ###############

############DAMAGE RANGE 1000 - 3999###########
automacro pked_Hakuro991 {
overrideAI 1
console /player (.*) \((\d+)\) attacks player Hakuro .* - dmg: \b[1-3][0-9]{3}\b/i
call pk_ATTACK_ONCE
}

###########DAMAGE RANGE 4000 - 9999############
automacro pked_Hakuro992 {
overrideAI 1
console /player (.*) \((\d+)\) attacks player Hakuro .* - dmg: \b[4-9][0-9]{3}\b/i
call KILL_PK
}

###########DAMAGE RANGE 10000 - 99999##########
automacro pked_Hakuro993 {
overrideAI 1
console /player (.*) \((\d+)\) attacks player Hakuro .* - dmg: \b[1-9][0-9]{4}\b/i
call {
do kill $.lastMatch2
}
}

############ - Hakuro - ###############

############DAMAGE RANGE 1000 - 3999###########
automacro pked_Hakuro9291 {
overrideAI 1
console /player (.*) \((\d+)\) attacks player - Hakuro - .* - dmg: \b[1-3][0-9]{3}\b/i
call pk_ATTACK_ONCE
}

###########DAMAGE RANGE 4000 - 9999############
automacro pked_Hakuro9922 {
overrideAI 1
console /player (.*) \((\d+)\) attacks player - Hakuro - .* - dmg: \b[4-9][0-9]{3}\b/i
call KILL_PK
}

###########DAMAGE RANGE 10000 - 99999##########
automacro pked_Hakuro9923 {
overrideAI 1
console /player (.*) \((\d+)\) attacks player - Hakuro - .* - dmg: \b[1-9][0-9]{4}\b/i
call {
do kill $.lastMatch2
}
}



##################################
##DEFEND SUPPORT - ON SKILL ###
#################################

################# Hakuro #####################

#######DAMAGE RANGE 1000 - 4999###############
automacro pk_Hakuro771 {
overrideAI 1
console /player (.*) \((\d+)\) uses .* on player Hakuro .* - dmg: \b[1-4][0-9]{3}\b/i
call pk_STAY_CALM
} 

#######DAMAGE RANGE 5000 - 9999###############
automacro pk_Hakuro772 {
overrideAI 1
console /player (.*) \((\d+)\) uses .* on player Hakuro .* - dmg: \b[5-9][0-9]{3}\b/i
call KILL_PK
} 

######DAMAGE RANGE 10000 - 99999############
automacro pked_Hakuro773 {
overrideAI 1
console /player (.*) \((\d+)\) uses .* on player Hakuro .* - dmg: \b[1-9][0-9]{4}\b/i
call {
do kill $.lastMatch2
}
}

######DAMAGE RANGE 100000 - 999999############
automacro pked_Hakuro153 {
overrideAI 1
console /player (.*) \((\d+)\) uses .* on player Hakuro .* - dmg: \b[1-9][0-9]{5}\b/i
call {
do kill $.lastMatch2
}
}

################# - Hakuro - #####################

#######DAMAGE RANGE 1000 - 4999###############
automacro pk_Hakuro7721 {
overrideAI 1
console /player (.*) \((\d+)\) uses .* on player - Hakuro - .* - dmg: \b[1-4][0-9]{3}\b/i
call pk_STAY_CALM
} 

#######DAMAGE RANGE 5000 - 9999###############
automacro pk_Hakuro7722 {
overrideAI 1
console /player (.*) \((\d+)\) uses .* on player - Hakuro - .* - dmg: \b[5-9][0-9]{3}\b/i
call KILL_PK
} 

######DAMAGE RANGE 10000 - 99999############
automacro pked_Hakuro7723 {
overrideAI 1
console /player (.*) \((\d+)\) uses .* on player - Hakuro - .* - dmg: \b[1-9][0-9]{4}\b/i
call KILL_PK
} 

######DAMAGE RANGE 100000 - 999999############
automacro pked_Hakuro1523 {
overrideAI 1
console /player (.*) \((\d+)\) uses .* on player - Hakuro - .* - dmg: \b[1-9][0-9]{5}\b/i
call KILL_PK
} 


############### FP ###############


automacro fptimer {
var allowA = 1
overideAI 1
var fp = 1
status not cp weapon
hp > 25%
call fptrigger
timeout 12
}

macro fptrigger {
do c @warp $homemap
pause 2
do pm $fpbot fp
pause 3
call Lockmap99 
}


#######HP SP############
automacro kittyhp {
var allowA = 1
status not dead
exclusive 1
hp > 0%
hp < 35%
timeout 10
call kittyhpsp
}

automacro kittynohp {
var allowA = 1
hp = 0%
exclusive 1
location payon
timeout 10
call kittynohp2
}


automacro kittysp {
var allowA = 1
hp > 0%
sp <= 15%
exclusive 1
timeout 10
call kittyhpsp
}

automacro kittynosp {
var allowA = 1
exclusive 1
overideAI 1
hp != 0%
sp = 0%
call afterAsurahpsp
}


macro kittynohp2 {
pause 1
do move x y "map_name"
}

macro kittyhpsp {
pause 1
do c @warp Map_name
pause 1
do talk @npc (x y)
pause 1
}


macro afterAsurahpsp {
pause 1
do c @warp Map_name
pause 1
do talk @npc (x y)
pause 1
}
#########LOCK MAP#################


automacro Go_To_Lockmap {
exclusive 1
var fp = 1
var lock = 1
overideAI 1
var allowA = 1
location not "map name"
location not "map name"
location not "map name"
location not "map name"
location not "map name"
hp > 40%
status cp weapon
timeout 5
call Lockmap99
}

automacro Go_To_Lockmap2 {
exclusive 1
overideAI 1
var fp = 0
var lock = 1
var allowA = 1
location not "map name"
location not "map name"
location not "map name"
location not "map name"
location not "map name"
hp > 40%
timeout 5
call Lockmap99
}

macro Lockmap99 {
release move
release freew
release newmove
#$damage = 0
if ($location = Map_name) goto prtfild
goto other
:prtfild


# $xxx = @random ("120", "200")
# $yyy = @rand (325, 345)
$xxx = @random("100", "200")
$yyy = @rand (365, 366)
do c @warp prt_fild08 $xxx $yyy
goto end
:other
do c @warp $lockedmap
:end
set exclusive 0
call move2
}

############ STORAGE ##############

automacro oweight {
exclusive 1
weight >= 70%
timeout 30
call storauto
}

macro storauto {
do autostorage
}

automacro gems {
class high priest
exclusive 1
inventory "Blue Gemstone" = 0
timeout 20
call storauto
}


automacro nogems {
class high priest
var job != 1
exclusive 1
storage "Blue Gemstone" = 0
timeout 10
call {
lock gems
lock nogems
}
}

Buff For Guild

automacro buffAndWarp {
pubm /(ald|alde|sq|pron|prt|HL|pay|asum|heal|santuary|sant|ab|buff|agi|bless)/i
sp >= 70
priority 0
class high priest
exclusive 1
call checkMsg
}
macro checkMsg {
$i = @player ($.lastpub)
$g = @eval (exists $::players{$::playersID[$i]}->{guild} ? $::players{$::playersID[$i]}->{guild}{name} : 'null')
if ($g == Gothic) goto accessGranted
if ($g == V a l k y r i e) goto accessGranted
goto end
:accessGranted
$msg = $.lastpubMsg
$posx = @rand (4, 5, 6, 7)
$posy = @rand (4, 5, 6, 7)
$cellIsFull = 0
do eval $::Macro::Data::varStack{cellIsFull} = 0;foreach (@{$::playersList->getItems()}) { next if (($_->{pos_to}{x} != $posx) || ($_->{pos_to}{y} != $posy));$::Macro::Data::varStack{cellIsFull} = 1; last;}
if ($cellIsFull == 1) goto accessGranted 
$x = @arg ("$.pos", 1)
$y = @arg ("$.pos", 2)
$evalx = @eval ($x + $posx)
$evaly = @eval ($y + $posy)
if ($msg == ALD) goto warpAld
if ($msg == ald) goto warpAld
if ($msg == alde) goto warpAld
if ($msg == ALDE) goto warpAld
if ($msg == SQ) goto warpSq
if ($msg == sq) goto warpSq
if ($msg == GEF) goto warpGef
if ($msg == gef) goto warpGef
if ($msg == HL) goto warpHl
if ($msg == hl) goto warpHl
if ($msg == pay) goto warpHl
if ($msg == asum) goto asum
if ($msg == ASUM) goto asum
if ($msg == agi) goto agi
if ($msg == AGI) goto agi
if ($msg == bless) goto bless
if ($msg == BLESS) goto bless
if ($msg == ab) goto agiBless
if ($msg == AB) goto agiBless
if ($msg == buff) goto agiBless
if ($msg == heal) goto heal
if ($msg == HEAL) goto heal
if ($msg == sant) goto santuary
if ($msg == santuary) goto santuary
if ($msg == SANT) goto santuary
if ($msg == SANTUARY) goto santuary
goto end
:warpAld
do sl 27 $evalx $evaley
pause 1
do warp alde_gld
stop
:warpSq
do sl 27 $evalx $evaly
pause 1
do warp prt_gld
stop
:warpGef
do sl 27 $evalx $evaly
pause 1
do warp gef_fild13
stop
:warpHl
do sl 27 $evalx $evaly
pause 1
do warp pay_gld
stop
:asum
do sp 361 $i 5
stop
:agi
do sp 29 $i 10
stop
:bless
do sp 34 $i 10
stop
:agiBless
do sp 34 $i 10
pause 1
do sp 29 $i 10
stop
:heal
do sp 28 $i 10
pause 0.5
do sp 28 $i 10
pause 0.5
do sp 28 $i 10
pause 0.5
do sp 28 $i 10
stop
:santuary
do sp 70 $i 7
stop
:end
log $msg
stop
}


Untuk yang lain harap anda mengedit nya sendiri.

Setting For Auto-Trade

Most people use Auto-Trade to buy some items they need or want in short time..

1. Make a notepad named autotrade.pl and copy paste this and then put it in plugins folder :

  package autoTrade;
  #ported from messykorexp by Joseph
  #original code by systeman

  use strict;
  use Plugins;
  use Globals;
  use Log qw(message warning error debug);
  use AI;
  use Misc;
  use Network::Send;
  use Utils;

  Plugins::register('autoTrade', 'automated chat room dealing', \&Unload);
  my $hook1 = Plugins::addHook('AI_pre', \&call);
  my $hook2 = Plugins::addHook('parseMsg/pre', \&packet);

  # load table file
  our %trade_lut;
  my $file = "autotrade.txt";
  #my $cfID = Settings::addConfigFile($file, \%trade_lut, \&FileParsers::parseDataFile_lc);
  my $cfID = Settings::addControlFile($file, loader => [\&FileParsers::parseDataFile_lc, \%trade_lut]);
  #Settings::load($cfID);
  undef $file;

  sub Unload {
  Plugins::delHook('AI_pre', $hook1);
  Plugins::delHook('parseMsg/pre', $hook2);
  Settings::removeFile($cfID);
  }

  my $dealTrade;
  my $dealFinalize;
  my $tradeDealAddItem;
  my $itemAddTimeout;

  # TIMEOUTS: you can change these if you want

  # time to wait for them to add items before cancelling?
  my $itemWaitTime = 20;
  # time to wait before accepting deal request?
  my $dealAcceptTime = 2;
  # time to wait before adding zeny once they finalize their item choices?
  my $zenyAddDelay = 3;

  sub packet {
  my $hookName = shift;
  my $args = shift;
  my $switch = $args->{switch};
  my $msg = $args->{msg};

  if ($switch eq "00E9?") {
  my $amount = unpack("L1?", substr($msg, 2,4));
  my $ID = unpack("S1?", substr($msg, 6,2));
  if ($ID > 0) {
  # they added an item, so reset the timeout
  $tradeDealAddItem = 1;
  }
  }
  if ($switch eq "01F4?") {
  #deal request, wait before accepting
  $itemAddTimeout = time;
  }
  if ($switch eq "00E5?" || $switch eq "01F4?") {
  #deal request, wait before accepting
  $itemAddTimeout = time;
  }
  if ($switch eq "00EC") {
  my $type = unpack("C1?", substr($msg, 2, 1));
  if ($type == 1) {
  #they finalize their item selections
  $itemAddTimeout = time;
  }
  }
  }

  sub call {
  AUTOTRADE: {
  if (AI::is("","tradeAuto", "deal") && $config{tradeAuto} && $char->{skills}{NV_BASIC}{lv} > 4) {
  if (AI::action ne "tradeAuto" && AI::action ne "deal" && $::currentChatRoom ne "") {
  message "Begin auto-trade mode.\n", "autoTrade";
  if ($config{dealAuto}) {
  $config{dealAuto} = 0;
  Misc::configModify("dealAuto", $config{dealAuto});
  }
  AI::queue("tradeAuto");
  }

  last AUTOTRADE if !AI::is("tradeAuto","deal");

  if (Utils::timeOut($itemAddTimeout,$dealAcceptTime) && $::incomingDeal{name} && !$::currentDeal{name}) {
  $messageSender->sendDealAccept();
  undef $dealFinalize;
  undef $dealTrade;
  $itemAddTimeout = time;
  message "Sent deal accept, begin trading\n", "autoTrade";
  }
  last AUTOTRADE if (!$::currentDeal{name});
  if (!Utils::timeOut($itemAddTimeout,$itemWaitTime) && $tradeDealAddItem) {
  $itemAddTimeout = time;
  undef $tradeDealAddItem;
  }
  if (($::currentDeal{other_finalize} && Utils::timeOut($itemAddTimeout,$zenyAddDelay)) || Utils::timeOut($itemAddTimeout,$itemWaitTime)) {
  if ($::currentDeal{other} eq ()) {
  message "Other person didn’t add any items, cancelling…\n", "autoTrade";
  $messageSender->sendCurrentDealCancel();
  $itemAddTimeout = time;
  } elsif (!$dealFinalize) {
  my $sumvalue;

  my @currentDealOther;
  foreach (keys %{$::currentDeal{other}}) {
  push @currentDealOther, $_;
  }
  my $max = @currentDealOther;
  for (my $i = 0;$i < $max;$i++) {   my $found = 0;   my $ID = $currentDealOther[$i];   my $name = lc main::itemName($::currentDeal{other}{$ID});   if (defined $trade_lut{$name}) {   message "Add ".$trade_lut{$name}."z x $::currentDeal{other}{$ID}{amount} to deal\n", "autoTrade";   $sumvalue += ($::currentDeal{other}{$ID}{amount} * $trade_lut{$name});   } else {   message "Other person added item which is not in buy list, cancelling…\n", "autoTrade";   $messageSender->sendCurrentDealCancel();
  last AUTOTRADE;
  }
  }
  message "Trading $sumvalue zeny and confirming\n", "autoTrade";
  $messageSender->sendDealAddItem(0, $sumvalue);
  sleep(0.5);
  $messageSender->sendDealFinalize();
  $dealFinalize = 1;
  $itemAddTimeout = time;
  }

  }
  if ($::currentDeal{you_finalize} && Utils::timeOut($itemAddTimeout,$itemWaitTime)) {
  message "Other person didn’t accept the final trade, cancelling…\n", "autoTrade";
  $messageSender->sendCurrentDealCancel();
  $itemAddTimeout = time;
  }
  if (!$dealTrade && $::currentDeal{you_finalize} && $::currentDeal{other_finalize}) {
  message "Accepting final trade\n", "autoTrade";
  $messageSender->sendDealTrade();
  $dealTrade = 1;
  }
  }
  }
  }

  return 1;

2.  open your config.txt and put tradeAuto to 1 and deal auto to 0, so it'll looked like :

dealAuto 0
tradeAuto 1
dealAuto_names
partyAuto 1
partyAutoShare 1
guildAutoDeny 1

3. create another notepad in your controls folder named autotrade.txt , for example :

# [item name] [price]

Crunch Toast 2500000

2. Open your control folder and Put These into your macros.txt :

automacro openchatroom {
map payon
run-once 1
delay 10
call openchat
}

macro openchat {
do chat create "B: Crunch Toast 2,5 million" 2 0 1111
}

Note : its work properly and very well.. i tried it already in OK 2.0.6 , oh yeah almost forgot. . make sure all your notepads save as all files...



Macro For Training Ground

Macro ini digunakan untuk bot di tempat pelatihan novice atau training ground keren na.. ^_^

Di config.txt

lockMap new_1-3 ( ganti dengan yang lain bila ingin ditempat yang lbh gmpg/susah )
lockMap_x
lockMap_y
lockMap_randX
lockMap_randY

Di portals.txt

masukkan list berikut :

new_1-1 148 112 new_1-2 100 9
new_1-2 100 6 new_1-1 148 112
new_2-1 148 112 new_2-2 100 9
new_2-2 38 182 new_1-3 96 21 0 r0
new_2-2 38 182 new_2-3 96 21 0 r0
new_2-2 38 182 new_3-3 96 21 0 r0
new_2-2 38 182 new_4-3 96 21 0 r0
new_2-2 38 182 new_5-3 96 21 0 r0
new_2-2 100 6 new_2-1 148 112
new_3-1 148 112 new_3-2 100 9
new_3-2 38 182 new_1-3 96 21 0 r0
new_3-2 38 182 new_2-3 96 21 0 r0
new_3-2 38 182 new_3-3 96 21 0 r0
new_3-2 38 182 new_4-3 96 21 0 r0
new_3-2 38 182 new_5-3 96 21 0 r0
new_3-2 100 6 new_3-1 148 112
new_4-1 148 112 new_4-2 100 9
new_4-2 38 182 new_1-3 96 21 0 r0
new_4-2 38 182 new_2-3 96 21 0 r0
new_4-2 38 182 new_3-3 96 21 0 r0
new_4-2 38 182 new_4-3 96 21 0 r0
new_4-2 38 182 new_5-3 96 21 0 r0
new_4-2 100 6 new_4-1 148 112
new_4-2 46 172 new_4-2 73 106
new_4-2 73 106 new_4-2 41 172
new_5-1 148 112 new_5-2 100 9
new_5-2 38 182 new_1-3 96 21 0 r0
new_5-2 38 182 new_2-3 96 21 0 r0
new_5-2 38 182 new_3-3 96 21 0 r0
new_5-2 38 182 new_4-3 96 21 0 r0
new_5-2 38 182 new_5-3 96 21 0 r0
new_5-2 100 6 new_5-1 148 112
new_1-2 38 182 new_1-3 96 21 c c r0
new_1-2 38 182 new_2-3 96 21 c c r0
new_1-2 38 182 new_3-3 96 21 c c r0
new_1-2 38 182 new_4-3 96 21 c c r0
new_1-2 38 182 new_5-3 96 21 c c r0

Di macros.txt

masukkan macros berikut :

automacro satu {
location new_1-3
run-once 1
call newSatu
}

macro newSatu {
do conf lockMap new_1-3
stop
release satu
}

automacro dua {
location new_2-3
run-once 1
call newDua
}

macro newDua {
do conf lockMap new_2-3
stop
release dua
}

automacro tiga {
location new_3-3
run-once 1
call newTiga
}

macro newTiga {
do conf lockMap new_3-3
stop
release tiga
}

automacro empat {
location new_4-3
run-once 1
call newEmpat
}

macro newEmpat {
do conf lockMap new_4-3
stop
release empat
}

automacro lima {
location new_5-3
run-once 1
call newLima
}

macro newLima {
do conf lockMap new_5-3
stop
release lima
}

sebelum itu taro char anda di tempat hunt misal nya new_4-3 ,

kemudian jalankan program bot anda dan ketik reload macros maka char anda akan masuk ke lockmap yang telah ditentukan yaitu seperti diatas new_1-3, 

Silakan Menikmati ^_^

Saturday, April 11, 2009

Auto Paket

Ini macro apabila ada player yang meminta paket maka secara otomatis si bot akan memberikan paket agi dan bless kepada si player tersebut...

automacro paket{

pubm /paket/
call paket1
}
macro paket1{
do sp 34 $.lastpub
pause 2
do sp 29 $.lastpub
}

Thx : ~RefLeX!o~ ( FnC Server )

Auto Heal

Ini macro untuk priest, jadi apabila ada org yang minta heal , otomatis si bot akan memberikan heal kepada player tersebut

automacro mintaheal{

pubm /heal/
call giveheal}
 
macro giveheal {
pause 1
do sp 28 $.lastpub
pause 1
do sp 28 $.lastpub
}

Thx : ~RefLeX!o~ ( FnC Server )

Friday, March 20, 2009

Auto-Cultivate

this is just an basic Cultivation Macro

first you need Marine Sphere card...

then config.txt

lockMap Blank
route_randomWalk 0
storageAuto 0

then items_control.txt

Mushroom Spore 30 1 0 1 1

====================================================================

automacro Cultivate {
  location prontera 192 100

  inventory "Mushroom Spore" >= 1
  sp > 90%
  status not Owg 50%
# weight < 50%
  timeout 3
  macro_delay 1.5
  exclusive 1

  run-once 1

  call {

  $Count = 0

  while ($Count <= 20) as exampleloop
  do sl Cultivation 191 100 1
  pause 1.5
  do ss "Magnum Break" 1
  $Count++
  end exampleloop

  do move 190 99

  $Count2 = 0

  while ($Count2 <= 13) as exampleloop2
  $Count2++
  do sm "Cart Revolution" 1 1
  pause 1.5
  end exampleloop2

  $Count3 = 0

  while ($Count3 <= 1) as exampleloop3
  $Count3++
  do ss "Magnum Break" 1
  pause 1.5
  end exampleloop3

  do move 192 100

  release Cultivate
  }
}

====================================================================

this is how its work...
this is my postion
WWWWWWW
WXXXXYXXX
WXXXXXXXX

here where i summon mushroom
WWWWWWW
WXXXMXXXX
WXXXXXXXX

when i cast Magnum Break on the mushroom it will push back to here...
WWWWWWW
WMXXXXXXX
WXXXXXXXX

then i move to here... then kill them with cart rev then magnum break...
WWWWWWW
WMXXXXXXX
WXYXXXXXX

W = Wall
M = Mushroom
Y = You


combo Cart Revolution and Magnum Break for lesser SP consumption...

Brewing Potions

For Alchemist Only and Using Priest or High Priest Support in the process

Note : dont forget to change your setting like this -> storageAuto 1 and lockMap (leave blank)

at config

getAuto Medicine Bowl {
minAmount 0
maxAmount 300
passive 0
}

getAuto Empty Bottle {
minAmount 0
maxAmount 300
passive 0
}

getAuto Immortal Heart {
minAmount 0
maxAmount 300
passive 0
}

at items_control


Alcohol Creation Guide 0 0 0 0 0
Bottle Grenade Creation Guide 0 0 0 0 0
Acid Bottle Creation Guide 0 0 0 0 0
Plant Bottle Creation Guide 0 0 0 0 0
Marine Sphere Creation Guide 0 0 0 0 0
Glistening Coat Creation Guide 0 0 0 0 0
Condensed Potion Creation Guide 0 0 0 0 0
Potion Creation Guide 0 0 0 0 0
Embryo Creation Guide 0 0 0 0 0
Elemental Potion Creation Guide 0 0 0 0 0

Empty Potion Bottle 0 1 0 0 0
Medicine Bowl 0 1 0 0 0
Empty Test Tube 0 1 0 0 0

Stem 0 1 0 0 0
Poison Spore 0 1 0 0 0
Empty Bottle 0 1 0 0 0

Alcohol 0 1 0 0 0
Fabric 0 1 0 0 0

Immortal Heart 0 1 0 0 0

Witch Starsand 0 1 0 0 0

White Potion 25 1 0 1 1
White Potion 0 1 0 0 0
Condensed White Potion 25 1 0 1 1
Condensed White Potion 0 1 0 0 0

##### Alchemist Brewing #####
# Red Potion = 8E 01 F5 01 00 00 00 00 00 00
# Yellow Potion = 8E 01 F7 01 00 00 00 00 00 00
# White Potion = 8E 01 F8 01 00 00 00 00 00 00
# Blue Potion = 8E 01 F9 01 00 00 00 00 00 00
# Adonyne = 8E 01 5D 02 00 00 00 00 00 00
# Aloevera = 8E 01 5E 02 00 00 00 00 00 00
# Red Slim = 8E 01 21 02 00 00 00 00 00 00
# Yellow Slim = 8E 01 22 02 00 00 00 00 00 00
# White Slim = 8E 01 23 02 00 00 00 00 00 00
# Alcohol = 8E 01 CA 03 00 00 00 00 00 00
# Fire Bottle = 8E 01 DF 1B 00 00 00 00 00 00
# Acid Bottle = 8E 01 E0 1B 00 00 00 00 00 00
# Plant Bottle = 8E 01 E1 1B 00 00 00 00 00 00
# Mine Bottle = 8E 01 E2 1B 00 00 00 00 00 00
# Coating Wax = 8E 01 E3 1B 00 00 00 00 00 00

Here The Macro

automacro potzMakerAlcohol {
  sp > 50
  status Blessing
  status Gloria
  status not Owg 50%

  inventory "Alcohol Creation Guide" > 0
  inventory "Medicine Bowl" > 0
  inventory "Empty Bottle" > 0
  inventory "Stem" > 4
  inventory "Empty Test Tube" > 0
  inventory "Poison Spore" > 4

  timeout 1.5
  run-once 1

  call {
  do ss 228 10
  do send 8E 01 CA 03 00 00 00 00 00 00

  pause 0.5

  release potzMakerAlcohol
  }
}

automacro potzMakerFireBottle {
  sp > 50
  status Blessing
  status Gloria
  status not Owg 50%

  inventory "Bottle Grenade Creation Guide" > 0
  inventory "Medicine Bowl" > 0
  inventory "Empty Bottle" > 0
  inventory "Alcohol" > 0
  inventory "Fabric" > 0

  timeout 1.5
  run-once 1

  call {
  do ss 228 10
  do send 8E 01 DF 1B 00 00 00 00 00 00

  pause 0.5

  release potzMakerFireBottle
  }
}

automacro potzMakerAcidBottle {
  sp > 50
  status Blessing
  status Gloria
  status not Owg 50%

  inventory "Acid Bottle Creation Guide" > 0
  inventory "Medicine Bowl" > 0
  inventory "Empty Bottle" > 0
  inventory "Immortal Heart" > 0

  timeout 1.5
  run-once 1

  call {
  do ss 228 10
  do send 8E 01 E0 1B 00 00 00 00 00 00

  pause 0.5

  release potzMakerAcidBottle
  }
}

Auto-Cast Warp Portal

this macro auto-cast warp portal on place that no one standing...

good for support on town and warping parties on WoE


automacro Warping {
  console /\[dist=(.*)\] (.*) \((\d+)\): (.*)warp(1|2|3|4)(.*)$/
  run-once 1
# class 4, 8, 23, 4005, 4009, 15, 4016

  call {
  if (@invamount(Blue Gemstone) == 0) goto nogem

  $dist = $.lastMatch1
  if ($dist > 6) stop
   
  $warpslot = $.lastMatch5
   
  :loop
  $posx = @rand (1,7)
  $posy = @rand (1,7)
  $cellIsFull = 0

  do eval $::Macro::Data::varStack{cellIsFull} = 0;foreach (@{$::playersList->getItems()}) { next if (($_->{pos_to}{x} != $posx) || ($_->{pos_to}{y} != $posy));$::Macro::Data::varStack{cellIsFull} = 1; last;}

  if ($cellIsFull == 1) goto loop
  $mex = @arg ("$.pos", 1)
  $mey = @arg ("$.pos", 2)
  $herex = @eval ($mex + $posx)
  $herey = @eval ($mey + $posy)
  do sl 27 $herex $herey
  timeout 3
  do warp $warpslot
  release Warping

  :nogem
  do c no gem
  release Warping
  }
}

Grape Juice Quest

This is a macro that i got from http://forums.openkore.com

i not tried this macro yet but its work.. dunno if its effecient or not..

Note: Cut/Copy the macro to "macro.txt" in your config folder and don't forget to remove the brackets like "[....]" coz its not have any containt for the macro...

automacro initializeshop {
run-once 1
location payon
call openshop
}
macro openshop {
do openshop
}
[I've tried many things to try to get this automacro to work, as you can see, but I want it to initialize moveit macro when my shop sells out, or I simply have no grape juice left in my card or in my shop]
automacro startgj {
cart "grape juice" == 0
shop "grape juice" == 0
soldout == 1
call moveit
}
[this is my main driver for the macro, it works flawlessly until I reach the actual grape juice quest where on occasion it fails to deposit 2000 grape juice from inventory to cart, although when I retested the macro changing the quantities of grapes and empty bottles taken at a time to be made to 5, it worked100% of the time, a strange bug]
macro moveit {
$vendspot = $.pos [not used idk why i still have it there]
do move 148 212 payon
do talk @npc (147 212)
do store
do store
do buy 11 6000
[buys 6000 grapes]
do move 163 213 payon
do talk @npc (164 213)
pause 2
do talk resp 1
do storage add @inventory (grape) @eval (@invamount (grape) - 2000)
[stores all but 2000 grapes to avoid overweight later on]
do move 163 216 payon
do talk @npc (164 216)
pause 2
do talk resp 1
[warp npc to alberta]
do move 98 40 alberta
do talk @npc (97 40)
do store
do store
do buy 1 2000
do talk @npc (101 47)
pause 2
pause 2
do talk resp 1
do storage add @inventory (empty bottle) 2000
do talk @npc (97 40)
do store
do store
do buy 1 2000
do talk @npc (101 47)
pause 2
pause 2
do talk resp 1
do storage add @inventory (empty bottle) 2000
do talk @npc (97 40)
do store
do store
do buy 1 2000
[has to store bottles in quantities of 2000 to stay under weight limit]
do move 111 129 alberta
do talk @npc (110 129)
pause 2
pause 2
do talk resp 2
pause 2
do talk resp 2
[grape juice quest]
do move 181 143 payon_in03
pause 3
do talk @npc (188 146)
pause 2
do talk resp 0
do talk resp 3
do talk resp 0
pause 2
pause 2
do cart add @inventory (grape juice) 2000
do cart add @inventory (grape juice) 2000
do move 138 321 payon
pause 3
do talk @npc (137 321)
pause 2
do talk resp 1
do storage get empty bottle 2000
do storage get grape 2000
do move 181 143 payon_in03
pause 3
do talk @npc (188 146)
pause 2 
do talk resp 0
do talk resp 3
do talk resp 0
pause 2
pause 2
do cart add @inventory (grape juice) 2000
do cart add @inventory (grape juice) 2000
do move 138 321 payon
pause 3
do talk @npc (137 321)
pause 2
do talk resp 1
do storage get empty bottle 2000
do storage get grape 2000
do move 181 143 payon_in03
pause 3
do talk @npc (188 146)
pause 2
do talk resp 0
do talk resp 3
do talk resp 0
pause 2
pause 2
do cart add @inventory (grape juice) 2000
do cart add @inventory (grape juice) 2000
do move 162 209 payon
pause 5
do openshop
}

Macro Plugin

Do you know about "Macro Plugin" yet ??

I take all of the explanation from here so if you still confused /wah better to look the real post.. /sob 

Installation in OpenKore.

1. Download the macro plugin. 
2. Go to your OpenKore folder (the folder which contains the file openkore.pl). 
3. In that folder, create a subfolder called plugins, if there isn't already one. 
4. Inside the Macro plugin's zipfile, you will find the file macro.pl and the folder Macro. Extract     them to your plugins folder. 
5. In your OpenKore control folder, create a blank file named macros.txt. In this file you will put your macros/automacros.

After installation, your OpenKore file tree should look like this (ignoring openkore's own files): 

====================================================================
openkore
|-- openkore.pl
|-- control
| `-- macros.txt
|-- fields
|-- logs
|-- plugins
| |-- Macro
| | |-- Automacro.pm
| | |-- Data.pm
| | |-- Parser.pm
| | |-- Script.pm
| | `-- Utilities.pm
| `-- macro.pl
|-- src
`-- tables
====================================================================

Note (about Installation) : This only work in OpenKore v2.02 and up, there's no more VisualKore if i'm correct.. :/

Ok, after you done with the Installation now we can move to the Commands.

Commands 


macro [options] [-- parameter(s)] 

Runs macro .

Option                   Value                   Description 
-repeat                      n         repeat the macro n times 
-overrideAI         (none)     override openkore's AI 
-macro_delay       delay     override global macro_delay for this macro 
-exclusive            (none)     do not allow automacros to cancel this macro 
-orphan               method    use method for handling orphaned macros 


Parameters for the macro can be specified after a double dash (--). These parameters are saved to the variables $.param1 to $.paramN. Example: 

====================================================================
macro foo {
 log Parameter 1 is $.param1
 log Parameter 2 is $.param2
}
====================================================================

When called as macro foo -- foo bar it would print out 

====================================================================
[macro] Parameter 1 is foo
[macro] Parameter 2 is bar

====================================================================

macro list 

Lists all available macros. 
macro stop 

Stop current macro. 
macro pause 

Interrupts the running macro. 
macro resume 

Resumes an interrupted macro. 
macro version 

Print version number. 
macro reset [] 

Resets all run-once automacros or the specified automacro . 
macro status 

Shows whether or not a macro is currently running. If that's the case it shows the delay for the next command, the current line, overrideAI setting, whether or not it has finished and whether or not the macro registered to AI queue 


Configuration files 

control/macros.txt 

Put your macros and automacros in here. 

control/timeouts.txt 

Add macro_delay and set it to the number of seconds you want the plugin to pause between commands. 

control/config.txt

Variable                            Value                       Description
macro_nowarn                  0               enable or disable the annoying warnings
                                             1               when not using call in your automacro(s) 
macro_orphans           terminate
                                       reregister                see orphaned macros section
                                  reregister_safe  
macro_file                  filename           file containing the macros ("macros.txt" by default) 
macro_allowDebug            0              console-check also processes openkore's debug messages
                                              1              (default: 0). Warning: slows down the plugin.

Before writing macros 

Make sure to read this manual entirely.
If you want to use openkore commands in your macro read about console commands. Note that few commands like manipulating the ai queue are not allowed.
Finally, read the announcements. They might contain useful examples of use. 


Macro syntax 
macro foo {
  do this..
  and that..
  yattayatta..
}

In theory, you can use any console command in a macro. I tested this plugin for buying silver arrows, talking to npc and pm'ing people. Lazy people could use this plugin for completing the amatsu dungeon quest or something like that. 


do  

Let openkore run . 
Example:

 macro foo {
  do move 123 234 prontera
  do sit
  do c "hello world"
 }



log  

Sends to console. 
Example:

macro foo {
  log This line logs a text to console.
  log All your base are belong to us!
}

pause [] 

Pauses for one or seconds. 
Example:

 macro foo {
  log I'm here and...
  pause 10
  log now I'm here.
 }



call [] 

Calls a macro [ times]. When is finished the current macro continues. 
release ( | all) 

Reenables a locked automacro ("run-once" keyword or locked by "lock") or reenables all automacros when using release all 
lock ( | all) 

Locks an automacro and disables it's checks. To locks all automacros, use lock all 
stop 

Immediately terminates the running macro 
set


Variable declaration and usage 

You can define and work with own variables.
To set a variable use $variable = value, to recall the value use $variable.
It is possible to increment and to decrement a variable using $variable++ or $variable--.
For calculation use @eval. To extract the first item of a comma-separated list use 
macro foo {
  $list = element one,element two,foo,bar,baz
  $var = [$list]
  log var contains $var (element one)
  log list contains $list (element two,foo,bar,baz)
}

Note that variable names must begin with a letter and must not contain anything other than letters and digits. 
Example:

macro foo {
  $var1 = world
  $var2 = hello
  $var3 = $var2 $var1
  log next line will yell out "hello world . world . hello"
  do c $var3 . $var1 . $var2
  $var4 = 47
  log \$var4 is $var4
  $var4++
  log \$var4 is $var4
  $var4 = @eval ($var4 + 52)
  log \$var4 is $var4
}

Special variables 

There are special readonly variables which begin with a dot. 
$.map - the map you're on ("prontera") 
$.pos - your current position ("123 234") 
$.time - current time as unix timestamp ("1131116304") 
$.datetime - current date and time ("Fri Nov 4 15:59:36 2005") 
$.hp - current hp 
$.sp - current sp 
$.lvl - current base level 
$.joblvl - current job level 
$.spirits - current number of spirit spheres 
$.zeny - current amount of zeny 
$.status - current statuses in a comma-separated list 
$.lastLogMsg - the text that triggered the last automacro condition "console" 
$.lastpub - the name of the player who triggered the last automacro condition "pubm" 
$.lastpubMsg - what he wrote 
$.lastpm - the name of the player who triggered the last automacro condition "pm" 
$.lastpmMsg - what he wrote 
$.lastguild - the name of the player who triggered the last automacro condition "guild" 
$.lastguildMsg - what he wrote 
$.lastparty - the name of the player who triggered the last automacro condition "party" 
$.lastpartyMsg - what he wrote 
$.lastMonster - the name of the monster which triggered the last automacro condition "monster" 
$.lastMonsterPos - the last known position of that monster ("123 234 prontera") 
$.lastMatchN - backreferences for the last regexp match 
$.paramN - command line parameters (see commands) 
$.caller - name of the last triggered automacro 
$.hooksave - value of a hash key (argument that's given with hook) 
$.weight - return the current weight of the character 
$.maxweight - return the maximum weight of the character 
Nested variables 

You can define dynamic or nested variables. 
Example:

macro foo {
  $var = foo
  log \$var is "foo"
  ${$var} = bar
  log \$\$var is \$foo is "bar"
}

Flow control and labels 

While all high level programming languages have constructs like "if .. then", "while", "repeat", "for .. next", "do .. while" and function calls their common denominators are "if", "goto" and "while". That's why the macro plugin only supports these three keywords. Since there are no (visible) line numbers you'll need to use labels which can be defined by a colon followed by the name of the label. 
Example for a "while" construct:

macro foo {
  $i = 0
  log the next lines will loop 11 times (0 .. 10)
  while ($i <= 10) as exampleloop
  log loop $i
  $i++
  end exampleloop
}

Example:

macro foo {
  $i = @random ("1", "2", "3")
  if ($i == 1) goto one
  if ($i == 2) goto two
  log i is three.
  goto end
  :one
  log i is one
  goto end
  :two
  log i is two
  :end
}

Note: goto labels cannot contain anything other then letters and digits. Example: warp_to_payon does not work, it must be something like warpToPayon.

Conditions            Condition Meaning 
      <                                less than 
    <=                    less than or equal to 
     ==                              equal to 
     >=                  greater than or equal to 
     >                             greater than 
    !=                              not equal to 
      ~               is element of  

Special keywords 
@npc ( ) 
            Expands to NPC's ID who's located at (,), or to -1 if the NPC was not found. 
@inventory () 
            Searches your inventory for and returns ID or -1 if the item was not found. 
@Inventory () 
            same as @inventory but returns all matching IDs as a comma-separated list or -1 if the item was not found 
@cart () 
            searches your cart for and returns ID or -1 if the item was not found 
@Cart () 
            same as @cart but returns all matching IDs as a comma-separated list or -1 if the item was not found 
@storage () 
            searches your storage for and returns ID or -1 if the item was not found 
@Storage () 
            same as @storage but returns all matching IDs as a comma-separated list or -1 if the item was not found 
@player () 
            looks for a player and returns ID or -1 if the player was not found 
@vender () 
            looks for a vender and returns ID or -1 if the vender was not found 
@store () 
            looks for an item in a store and returns ID or -1 if the item was not found 
@random (""[, ""[, ...]]) 
            returns randomly one of the given arguments 
@rand (, ) 
            returns a random number between (and including) and  
@invamount () 
            returns the amount of the given in inventory 
@cartamount () 
            returns the amount of the given in cart 
@shopamount () 
            returns the amount of the given in shop 
@storamount () 
            returns the amount of the given in storage 
@eval () 
            evaluates the given  
@arg ("", ) 
            returns the th word of or an empty string if the word index is out of range 
@config () 
           returns the value of specified in config.txt 
@venderitem () 
           looks for an item in a players shop and returns ID or -1 if the item was not found. 
@venderprice () 
           looks for an item in a players shop and returns its price. 


"Chaining" commands 

You can run multiple commands one after another without having to wait for openkore's ai or macro_delay or whatever. Just enclose these commands with [ and ]. 
Example (with numbered lines):

0 macro foo {
1      do whatever
2      log yet another line
3     [
4             do something
5             do something else
6             log foo
7      ]
8      log done
9 }
 

Line 3 starts the chaining mode. This line has no delay. Lines 4, 5 and 6 are run as soon as the previous command has finished with no delay and they cannot be interrupted. Line 7 stops the chaining mode and line 8 will be run $macro_delay seconds after that. 


Simple macro example 
Example:

macro foo {
  $foobegin = $.pos
  do move 168 128 prt_in
  do talk @npc (172 130)
  do store
  do store
  do buy @store (Silver Arrow) 10000
  do move 280 198 prontera
  do talk @npc (282 200)
  do talk cont
  do talk resp 1
  do storage add @inventory (Silver Arrow) @eval (@invamount (Silver Arrow) - 1000)
  do move $foobegin
}

When invoked via the command "macro foo [times]" the macro does the following: 
- store our current position in "foobegin" 
- move to 168 128 prt_in (weapon shop) 
- talk to the npc which is located at 172 130 (weapon dealer) 
- type "store" twice to show what he sells 
- buy 10,000 silver arrows. 
- move to 280 198 prontera (Prontera east gate) 
- talk to kafra 
- talk cont and talk resp 1 opens the storage 
- add all but 1000 silver arrows to storage and finally 
- return to where we were before running this macro

Automacro syntax 
Example:

automacro foo {
  bar
  baz, yatta
  call macroname
}
automacro mi {
  moo
  xyz
  call {
  do this
  do that
  }
}

Automacros are macros that will be automatically triggered when certain given conditions match. 
map  
Triggers when your current map is . 


location [not] [ ]] [, ...]

Triggers when you are [not] at the specified location. 
           When neither nor are given it triggers when you are [not] on . 
           When are not given it triggers when you are [not] on at (,). 
           When both and are defined it triggers when you are on somewhere between , (upper left) and , (lower right, where < and >  
           Comma-separated arguments are treated as OR conditions: 
           Example:
                        location geffen, prontera 123 234
           triggers when you are either in geffen or in prontera at 123 234. 
           Multiple lines are treated as AND conditions:
           Example:
                       location not geffen
                       location not prontera
           triggers when you are neither in geffen nor in prontera. 


mapchange (|any) [, ...] 
Triggers when changing map to . If the argument is any then it triggers on any map change. 
Comma-separated arguments are treated as OR conditions. 


hp [%] 
triggers when your hp match (absolute value) or percent (relative value). 
Multiple lines are treated as AND Conditions. 


sp [%] 
triggers when your sp match (absolute value) or percent (relative value). 
Multiple lines are treated as AND conditions. 


spirit  
triggers when your spirits match . 
Multiple lines are treated as AND conditions. 


weight [%] 
triggers when your weight matches (absolute value) or percent (relative value). 
Multiple lines are treated as AND conditions. 


cartweight [%] 
triggers when your cart weight matches (absolute value) or percent (relative value). 
Multiple lines are treated as AND conditions. 


zeny  
triggers when your zeny amount matches . 
Multiple lines are treated as AND conditions. 


soldout  
triggers when the amount of sold out item slots in your shop matches . 
Multiple lines are treated as AND conditions. 


status [not] [, ...] 
triggers when you are [not] . 
The statuses "dead" and "muted" are supported additionally. 
Comma-separated arguments are treated as OR conditions. 
Multiple lines are treated as AND conditions. 


inventory "" [, ...] 
triggers when you have of in your inventory. 
Comma-separated arguments are treated as OR conditions. 
Multiple lines are treated as AND conditions. 


storage "" [, ...] 
triggers when you have of in your storage. 
Comma-separated arguments are treated as OR conditions. 
Multiple lines are treated as AND conditions. 


cart "" [, ...] 
triggers when you have of in your cart. 
Comma-separated arguments are treated as OR conditions. 
Multiple lines are treated as AND conditions. 


shop "" [, ...] 
triggers when you have of in your shop. 
Comma-separated arguments are treated as OR conditions. 
Multiple lines are treated as AND conditions. 


base  
triggers when your baselevel matches . 
Multiple lines are treated as AND conditions. 


job  
triggers when your joblevel matches . 
Multiple lines are treated as AND conditions. 


class  
triggers when your jobclass is  


spell [, ...] 
triggers when someone casts on you or you are in it's scope. 
Comma-separated arguments are treated as OR conditions. 


monster [, ...] 
triggers when is near. 
When triggered the special variables $.lastMonster and $.lastMonsterPos are set. 
Comma-separated arguments are treated as OR conditions. 
Multiple lines are treated as AND conditions. 


notMonster [, ...] 
triggers when a monster appears that is not in the list. 
Comma-separated arguments are treaded as AND conditions. 


aggressives  
triggers at of aggressives. 
Multiple lines are treated as AND conditions. 


player (""|//[i]) [, ] 
triggers when is on screen or not more than blocks away. 
Multiple lines are treated as AND conditions. 


equipped [] (|none) [, ...] 
triggers when or none is equipped [in slot ] 
Slots are topHead, midHead, lowHead, leftHand, rightHand, robe, armor, shoes, leftAccessory, rightAccessory and arrow. 
Comma-separated arguments are treated as OR conditions. 
Multiple lines are treated as AND conditions. 


var (unset| ) 
triggers when is either unset or matches . 
Multiple lines are treated as AND conditions. 


varvar (unset| ) 
triggers when is either unset or matches . 
Multiple lines are treated as AND conditions. 


console (""|//[i]) 
triggers when is received on console or the text received matches . 
The i switch means the regexp is case insensitive. 
Sets $.lastLogMsg. 


pm (""|//[i]) [, ] 
triggers when is received by pm [from ] or the text received matches . 
The i switch means the regexp is case insensitive. 
Sets $.lastpm and $.lastpmMsg. 


pubm (""|//[i]) [, ] 
triggers when a public message [within a distance of ] is received and it is or matches  
The i switch means the regexp is case insensitive. 
Sets $.lastpub and $.lastpubMsg. 


party (""|//[i]) 
triggers when is received by partychat or the text received matches . 
The i switch means the regexp is case insensitive. 
Sets $.lastparty and $.lastpartyMsg. 


guild (""|//[i]) 
triggers when is received by guildchat or the text received matches . 
The i switch means the regexp is case insensitive. 
Sets $.lastguild and $.lastguildMsg. 


hook  
triggers when openkore calls . 


save  
(use in combination with hook) 
saves the value of in a variable $.hooksave1 to $.hooksave 


run-once (0|1) 
When set to 1 the automacro will be deactivated after being triggered. 
Use the macro command release to reenable this automacro. 


overrideAI (0|1) 
When set to 1 the macro ignores openkore's AI. This means it won't pause upon "move" or "status dead". 


delay  
Waits for seconds before calling the corresponding macro. 


timeout  
Wait at least for seconds before this automacro can be triggered again. 


macro_delay  
Overrides the global macro delay setting for the called macro. 


priority  
Choose which automacros should be checked before others. The smaller is is the sooner the automacro gets checked. If priority is not given, the priority is assumed to be 0 (zero: check first). 


exclusive (0|1) 
Automacros which have exclusive set cannot be interrupted by other automacros. 
As of macro 1.3.0 running macros can be interrupted by automacros by default. To disallow that behaviour either set this option or use the command line option -exclusive 


set  
Sets variable to . You can have multiple set lines per automacro. 


call  
Calls macro when the automacro is triggered. 


call { 
 
} 
Runs when the automacro is triggered. 


orphan  
Sets the method of how to deal with orphaned macros.

Automacro Example 
Example:

automacro checkshop {
  location prontera
  soldout >= 3
  delay 60
  call reopenshop
}

macro reopenshop {
  do closeshop
}


This automacro is triggered when you have a shop open in Prontera and there are three or more items sold out. When triggered, it waits for one minute then calls the macro "reopenshop" which closes your shop. If you have shopAuto_open or autoshop set to 1, it will be re-opened after a certain time.

Comments 

The macro files allow comments, i.e. lines that are ignored by the macro plugin. Lines starting with a # will be treated as comment. 
Example:

# this is a comment line

Orphaned macros 

It may happen - for example by using ai clear while a macro is running - that a macro becomes orphaned. That means the macro object exists but cannot continue because it requires the AI queue to contain the entry "macro" (or "deal") at the first place. When the AI queue gets cleared, the "macro" entry vanishes.
Before 1.0.2 this problem had to be solved by manually typing "macro stop". With 1.0.2 and up you may select which mechanism should be used to resolve that issue. There are three methods: terminate terminates the macro (equivalent to macro stop) 
reregister re-registers to AI queue, overriding other entries. 

This means to force the continuation of the macro. 
reregister_safe re-registers to AI queue when AI gets idle. 

This means the macro will continue when all other tasks are done. 

Understanding and Writing Macros 

This is a supplement to this manual, and was initially posted by openkore129 here. Please post any relevant queries or comments on this section there. 

I assume you already know how to use console commands and understand how they work. If not, before going further read through all console commands and try out ones like a, ai, move, cart get, storage add, talk, deal, take, direction commands, sl, sm, relog, pm and others. 

Automacros 

Automacros are macro which automatically trigger when certain conditions are met, just like how blocks in config.txt trigger depending on the conditions set in them. 

The point of automacros is that you use them to check for conditions. When the condition is fulfilled you can either respond to it in the automacro or call a macro to do it. The format for automacros is... 
automacro {
  condition 1
  condition 2
  …...
  …...
  call {
  command 1
  command 2
  …..
  …..
  }
  timeout (if necessary)
}

For example, suppose you're playing manually but your slave priest is on Kore, and you want it to warn you if its running out of sp, you can use an automacro like this.... 
automacro sp {
  sp < 200
  call {
  do c sp low
  }
  timeout 10
}

Taking it line by line, 

automacro sp { - you need to put automacro to tell kore that its an automacro. Then you put the name of the macro, in this case its “sp”. Then you need to put an opening bracket “{“ which tells Kore that the automacro's code begins there. 

Sp < 200 – After the “{“, you put the conditions on successive lines. Here there is only one condition and I think its clear that the condition is that sp should be below 200. 

call { – The word “call” tells Kore that now you're going to be putting commands, not conditions. The opening bracket “{“ tells Kore that the commands will start now. These commands are the ones that will get carried out when the conditions are met, here when sp goes below 200. 

do c sp low – “Do” tells Kore that this is a commands, some to be done. After “do”, just leave a space and type in the console command you want to execute exactly the way you do in the Kore console. 

} – This closing bracket “}” tells Kore that the commands have ended. 

timeout 10 – This isn't a condition or a command, it works the same way it works in normal Kore blocks, so this automacro cannot trigger within 10 seconds of it already having been triggered. I ALWAYS put timeouts, so even if my conditions are faulty, the automacro doesn't spam and mess up whatever my bot is doing. Otherwise if your automacro is messed up then you could die or something, so its better to put an appropriate timeout. 

} – This closing bracker “}” tells Kore that your automacro code has ended. 

So basically whenever, the bot's sp goes below 200, it says in public chat “sp low”. This also has the advantage of making your bot not look like a bot =p. 

Here's another macro which illustrates how you can use macros to handle weird situations which Kore is not equipped to deal with. When fighting against metalings, the often strip you and then your oh-so-smart bot punches! To get around this, put the weapon you use in default auto equip and use this macro. 
automacro strip {
  status Strip Weapon
  call {
  do tele
  do relog 10
  }
  timeout 10
}

Taking it line by line.... 

automacro strip { - Tell Kore this is an automacro, and it's name is "strip". The '{' tells Kore the code of the automacro starts here. 

status Strip Weapon - The only condition in this macro. This checks your list of statuses for the status "Strip Weapon" 

call { - The word "call" and "{" tells Kore that the commands to be executed start after the '{' 

do tele - 'do' tells Kore that what comes after is a console command to be carried out. Here the command is "tele" so you teleport away from the Metaling, so that incase you lag or something, you aren't killed while executing the next instruction which is..... 

do relog 10 - Tells Kore to now relog, so that when you login again, your "strip weapon" status will be cleared. 

} - '}' Tells Kore the commands have ended. 

timeout 10 - Ensures automacro is not spammed, and 10 seconds is enough time to execute the automacro. So after 10 seconds, if for some reason you are still stripped, this automacro will trigger again. However, if you relogin and are stripped within 10 seconds, then macro will not trigger till the 10 seconds are up. 

} - '}' tells Kore the macro code has ended. 

Summarising, on being stripped, you teleport away from the monster and then relogin, with a timeout of 10 seconds to ensure that the automacro is not spammed. Since the weapon you're using is filled in in the default weapon option, after relogging Kore will automatically re-equip that weapon. 

Lets try a more complicated macro. If you have a priest, you would want it to warp back to its lockmap or the nearest warp-able map near its lockmap. This macro does it. From the savemap, the bot takes the same route to the lockmap. So the first map outside the town, just set it to move to a designated tile, and cast warp on a nearby tile, and then more to the tile. You will need delays to allow the spell to be cast and commands to be completed. 
automacro warp {
  map gef_fild07
  inventory "Blue Gemstone" > 0
  call {
  do ai manual
  pause 1
  do move 319 187
  do sl 27 316 188
  pause 2
  do warp 1
  pause 1
  do move 316 188
  do ai on
  }
  timeout 20
}

Taking it line by line, 

automacro warp { - As explained, the automacro's name is warp, and “{“ indicates that the automacro begins. 

map get_fild07 - The first condition, the automacro will only trigger if the map is gef_fild07. 

Inventory “Blue Gemstone” > 0 - Second condition, ensures there is atleast one blue gemstone in the inventory so that warp portal can be cast. Obviously you need a getAuto in config.txt for the gemstones. 

Call { - Tells Kore, that the commands start here. 

do ai manual - Frequently, I use this command in the more complicated and longer macros, so that Kore doesn't get diverted into doing something else while your macro is running, for example, attacking a monster or gathering up an item. 

Pause 1 - Inserts a delay of 1 second before the next command is carried out, VERY IMPORTANT. If you don't use delays then Kore can and will miss steps in the macro and the result is a mess. 

do move 319 187 - The “move” console command is used to move your bot to a set location. 

do sl 27 316 188 - The “sl” console command is used to make your priest cast warp portal on a convenient spot near your location, in this case (316,188). 

pause 2 - Very Important. A delay of 2 seconds is put, allowing enough time to cast warp portal. If you priest has low dex, this delay should be increased. 

Do warp 1 - Console command “warp” is used to select memo location 1. 

pause 1 - 1 second delay to allow the portal to form. 

do move 316 188 - Move to the portal and Voila! You have been warped to the map. 

Do ai on - You set ai to manual at the beginning of this macro, so now you need to turn it on. 

} - Closing bracket indication end of commands. 

Timeout 20 - Ensures that the bot does not spam the automacro. The timeout should be large enough to allow the completion of the automacro, so that the automacro does not trigger while the macro is executed. 

} - Closing bracket indicates end of automacro code. 

Note the use of appropriate delays and timeouts in this automacro. 


The macro plugin also has many useful built in variables which give you your position for example. Its all listed in the macro manual. I just want to show how to extract your position from these variables. 

$.pos gives you your position. Now to get your x and y coordinates the code is, 
  $px = @arg ("$.pos", 1)
  $py = @arg ("$.pos", 2)

If you have a “monster” condition in your automacro, $.lastmonsterpos gives the position of that monster. To extract the x and y coordinates the code is, 
  $mx = @arg ("$.lastMonsterPos", 1)
  $my = @arg ("$.lastMonsterPos", 2)

Run Once Frequently, the run once condition is used instead of a timeout. It allows the automacro to run only once, so that automacro isn't spammed. To get the automacro to be run again, a release command needs to be executed. However, sometimes due to a rogue situation the macro can hang and the release macro isn't executed. This means your automacro is effectively stuck. To get around this I use a timeout instead of using run-once. 


The normal macros In the 2 examples above, I've done everything using automacros. So you're probably wondering what the point of macros is, if everything can be done using automacros. Well, not everything can be done using automacros. For example, I don't think you can use macro variables such as $.pos in an automacro. So, if you get errors like “not an automacro variable” it means that cannot be done in an automacro and has to be done in a macro. 

Regular Expressions Sometimes, in a macro you need to compare say the names of characters near you to see if it matches a certain name. This is where regular expressions come in handy. If you're new to macros, you can read this later as it can be a bit complicated, the more advanced regexps can look hellish =P Visit http://www.regular-expressions.info/quickstart.html where its explained fairly well. I'm just going to put down some basics here. 
$.lastpubMsg = /(A|a)uto (S|s)torage/

Here $.lastpubMsg is your macro variable holding the last public chat message. A regular expression can just be plain text so it could have been /auto storage/ or /auto/ and Kore would have checked if the public chat contained "auto storage" or "auto". 

However here we have used the "|" symbol which means "or". Notice 'A' and 'a' are contained in brackets with a '|' between them. It means both 'auto' and 'Auto' are checked for. Similarly both 'storage' and 'storage' are checked for. Now suppose you want to check for repetition, say 'aauto storage' also, then you can use /(a+|A+)uto (S|s)torage/. Notice I've used a '+'. This tells Kore that the character it is directly after, here 'a' or 'A', should be present one or more times. So even if someone says "aaaaaaaaaauto storage' it will be valid. Other checks like the '+' are 
Match 0 or more times eg. /(a*|A*)uto Storage/ so "ato storage" will also work 

+ Match 1 or more times eg. as above ? Match 1 or 0 times eg /(a?|A?)uto Storage/ so "ato storage" and "auto storage" work but "aaaauto storage" won't 

So if you want to check for "Kobold" just do /Kobold/ and if "Kobold" is anywhere in the string, it will be valid. For Kobold-1 and Kobold-2 only it will be /Kobold-(1|2)/. 

Regexps can also come in handy when you're using the "console //" condition in automacros, if you need to check for a variety of trigger texts. 

These is just the basics, I recommend referring to link provided above if you need to make a more complicated regexp. 

How to write a macro Now that you have some idea of what a macro is, try writing one....
-Figure out under exactly what conditions you want your automacro to trigger
-Logically think out the steps your bot needs to perform in the automacro. Go step by step over this carefully.
-Ensure you have inserted appropriate pauses between the steps.
-Ensure you have a timeout or a run-once in your macro to prevent spamming of it.
-Now put the code in macros.txt and start the bot or reload macros.txt. If all is fine you won't get any error messages. But if there is a problem in the syntax, say you missed out a “}”, then you will get an error message and the macro won't work. Figure out what the error is, correct it, and reload macros.txt again to check if you corrected it properly or not.


Todos/Known bugs/Known limitations 
automacro check console ignores the following domains: macro and cvsdebug. 
do not use closing brackets ")" in keyword arguments unless it's the closing bracket for an argument. For example: @random ("foo", "bar", "@eval (4 + 5)", "yatta") is allowed, @random ("foo", "bar", ":-)", "yatta") is not. 

If there are any bugs, please report them to me. Use at your own risk, I won't give any guarantee that this script works as described. So if the example above buys 10.000 main gauche, I'm not responsible for this (this won't happen, but just to be on the safe side..^^). Hope that's all. Have fun.

Development version (SVN) 

The development version can be found in the OpenKore SVN repository. 

Windows users should read the SVN guide. 

Linux users can run the following commands to get the development version from SVN: 

svn co https://openkore.svn.sourceforge.net/svnroot/openkore/plugins/macro/trunk/ 

Older releases: https://openkore.svn.sourceforge.net/svnroot/openkore/plugins/macro/tags/ 


Extras 

The SVN version includes two extra files: 

recorder.pl
a standalone plugin for openkore that can be used to record macros (only commandline). 

mconv.pl
a (yet incomplete) program to convert 0.8.x and 0.9.x macros to 1.x.x.