Skip to content

Instantly share code, notes, and snippets.

@cydh
Last active June 10, 2016 23:19
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/31e6a0f7f377ce314cd2e969ff250d94 to your computer and use it in GitHub Desktop.
Save cydh/31e6a0f7f377ce314cd2e969ff250d94 to your computer and use it in GitHub Desktop.
Macro to Exchange Material (GN_CHANGEMATERIAL) | Creating Alchol/Alcohol by each 50 Orcish Voucer + 40 Skel-Bone | 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.com
# Macro to Exchange Material (GN_CHANGEMATERIAL)
# Creating Alchol/Alcohol by each 50 Orcish Voucer + 40 Skel-Bone
#
# 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.com
macro doConvAlchol {
log doConvAlchol
# 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
}
}
automacro doConvAlchol_ {
#delay 1
# NOTE: You maybe need change this console line to trigger this automacro
console "Anda menggunakan Change Material pada diri sendiri (Lv: 1)"
call {
do cm $idx1 $per1,$idx2 $per2
call checkItems
pause 0.5
if ($amt1 >= $per1 && $amt2 >= $per2 && $weight < 90) {
call doConvAlchol
}
}
}
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
}
#macro doConvAlchol {
# log doConvAlchol
#
# # 50 Orcish Voucher, 40 Skel-Bone
# $mat1 = Orcish Voucher
# $mat2 = Skel-Bone
# $per1 = 50
# $per2 = 40
#
# $idx1 = @inventory($mat1)
# $idx2 = @inventory($mat2)
# $amt1 = @invamount($mat1)
# $amt2 = @invamount($mat2)
# $weight = @eval($.weight * 100 / $.maxweight)
#
# log doConvAlchol: \$weight:$weight \$idx1:$idx1 \$amt1:$amt1 \$idx2:$idx2 \$amt2:$amt2
# while ($amt1 >= $per1 && $amt2 >= $per2 && $weight < 90) as loop_doConvAlchol
# do ss GN_CHANGEMATERIAL
# pause 2
# do cm $idx1 $per1,$idx2 $per2
#
# $idx1 = @inventory($mat1)
# $idx2 = @inventory($mat2)
# $amt1 = @invamount($mat1)
# $amt2 = @invamount($mat2)
# $weight = @eval($.weight * 100 / $.maxweight)
#
# log loop_doConvAlchol: \$weight:$weight \$idx1:$idx1 \$amt1:$amt1 \$idx2:$idx2 \$amt2:$amt2
# end loop_doConvAlchol
#
# log loop_doConvAlchol [DONE] Alchol:@invamount(Alchol) \$weight $weight
#}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment