Skip to content

Instantly share code, notes, and snippets.

@cydh
Last active November 14, 2018 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cydh/7b77580fc50b8f8b508c38dca296325a to your computer and use it in GitHub Desktop.
Save cydh/7b77580fc50b8f8b508c38dca296325a to your computer and use it in GitHub Desktop.
Macro Collection for Change Material skill (GN_CHANGEMATERIAL) 1. Exchange Skel-Bone & Orcish Voucher to Alchol 2. Tsurugi [1] to Steel 3. Guard to Coal | (c) Cydh/PServeRO
# Macro Collection for Change Material skill (GN_CHANGEMATERIAL)
# 1. Exchange Skel-Bone & Orcish Voucher to Alchol
# 2. Tsurugi [1] to Steel
# 3. Guard to Coal
#
# PLEASE MAKE SURE YOUR OPENKORE IS SUPPORTED BY cm COMMAND, OR
# TRY USE THIS MY BRANCH: https://github.com/cydh/openkore/tree/feature/skill_exchange_item
#
# (c) Cydh/PServeRO
# HOW TO USE:
# 1. Make sure all ingredients are in inventory,
# 2. Type this command 'macro doConvAlchol' on console.
macro doConvAlchol {
log doConvAlchol
$product = Alchol
$combItems = 2
# 50 Orcish Voucher, 40 Skel-Bone
$mat1 = Orcish Voucher
$mat2 = Skel-Bone
$per1 = 50
$per2 = 40
call checkItems
pause 0.5
if ($amt1 >= $per1 && $amt2 >= $per2 && $weight < 90) {
do ss GN_CHANGEMATERIAL
}
}
# HOW TO USE:
# 1. Make sure all ingredients are in inventory,
# 2. Type this command 'macro doConvSteel' on console (this macro doesn't provide auto-buy Tsurugi [1] from NPC).
macro doConvSteel {
log doConvSteel
$product = Steel
$combItems = 1
# 1 Tsurugi [1]
$mat1 = Tsurugi [1]
$per1 = 1
call checkItems
pause 0.5
if ($idx != 1 && $amt1 >= $per1 && $weight < 90) {
do ss GN_CHANGEMATERIAL
}
}
macro doBuyTsurugi {
$npc = @npc(172 130)
if ($npc == -1) stop
do talk $npc
pause 2
do store
pause 2
$weight = @eval($.weight * 100 / $.maxweight)
while ($weight < 87 && $.zeny > 52000) as loop
do buy 13
pause 1
$weight = @eval($.weight * 100 / $.maxweight)
end loop
}
# HOW TO USE:
# 1. Make sure all ingredients are in inventory,
# 2. Type this command 'macro doConvCoal' on console (this macro doesn't provide auto-buy Guard from NPC).
macro doConvCoal {
log doConvCoal
$product = Coal
$combItems = 1
# 1 Guard
$mat1 = Guard
$per1 = 1
call checkItems
pause 0.5
if ($idx != 1 && $amt1 >= $per1 && $weight < 90) {
do ss GN_CHANGEMATERIAL
}
}
macro doBuyGuard {
$npc = @npc(172 132)
if ($npc == -1) stop
do talk $npc
pause 2
do store
pause 2
$weight = @eval($.weight * 100 / $.maxweight)
while ($weight < 88 && $.zeny > 1000) as loop
do buy 0
pause 1
$weight = @eval($.weight * 100 / $.maxweight)
end loop
}
automacro doExchangeItem {
delay 1
# NOTE: You maybe need change this console line to trigger this automacro
#console "Anda menggunakan Change Material pada diri sendiri (Lv: 1)"
console "Change Material is ready. Use command 'cm' to continue."
call {
if ($combItems == 2) {
call checkItems
do cm $idx1 $per1,$idx2 $per2
call checkItems
pause 0.5
if ($amt1 >= $per1 && $amt2 >= $per2 && $weight < 90) {
call doConvAlchol
}
} elsif ($combItems == 1) {
call checkItems
do cm $idx1 $per1
call checkItems
pause 0.5
if ($amt1 >= $per1 && $weight < 90) {
call doConvSteel
}
}
}
}
macro checkItems {
$idx1 = @inventory($mat1)
$idx2 = @inventory($mat2)
$amt1 = @invamount($mat1)
$amt2 = @invamount($mat2)
$weight = @eval($.weight * 100 / $.maxweight)
log checkItems: \$weight:$weight \$idx1:$idx1 \$amt1:$amt1 \$idx2:$idx2 \$amt2:$amt2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment