Code: Select all
automacro cm {
weight < 99%
inventory "Steel" < 669
inventory "Tsurugi [1]" > 0
priority 4
run-once 1
delay 1
call cm
}
macro cm {
$steel = @invamount (Steel)
$tsu = @eval(@invamount (Tsurugi [1]))
$steelamount = @eval(@eval(@invamount (steel)) / 10)
$i = @eval($tsu + $steelamount)
$cweight = $.weight
$mweight = @eval($.maxweight)
$avweight = @eval($mweight - $cweight)
$rmndr = @eval ($avweight % 120)
$buy = @eval(@eval (@eval (@eval($avweight - $rmndr) / 120) - 1 + $i) * 10)
if (($steel < $buy) && (@invamount (Tsurugi [1]) > 0)) goto cm
goto end
:cm
$si = 55
$upbound = @eval($si + $tsu)
log $upbound
do stand
pause 1
log upper bound is $upbound
while ($si <= $upbound) as cmloop
#log $si of $upbound
if ($si > 9) goto convertToHex
goto hex
:convertToHex
$deci = $si
$rmndr = @eval ($deci % 16)
$quo = @eval (@eval($deci - $rmndr) / 16)
if ($rmndr = 10) goto A
if ($rmndr = 11) goto B
if ($rmndr = 12) goto C
if ($rmndr = 13) goto D
if ($rmndr = 14) goto E
if ($rmndr = 15) goto F
goto hex
:A
$rmndr = A
goto hex
:B
$rmndr = B
goto hex
:C
$rmndr = C
goto hex
:D
$rmndr = D
goto hex
:E
$rmndr = E
goto hex
:F
$rmndr = F
goto hex
:hex
if ($quo > 0) goto hex1
if ($quo = 0) goto hex2
goto scm
:hex1
if (rmdnr = 0) goto norem
$hex = $quo$rmndr
goto scm
:norem
$norem = 0
$hex = $quo$norem
goto scm
:hex2
$hex = 0$rmndr
goto scm
:scm
#log $hex
if (@invamount (Tsurugi [1]) < 1) goto end
#do send 13 01 01 00 BE 09 D8 7F 50 00
do send E4 07 10 00 00 00 00 00 01 00 00 00 $hex 00 01 00
$si++
end cmloop
:end
release all
}
automacro buyT {
weight <= 87%
inventory "Tsurugi [1]" < 1
priority 1
location prt_in 168 128
run-once 1
exclusive 1
delay 3
call buy
}
macro buy {
$weight = $.weight
#lock loweight
$steel = @eval(@eval(@invamount (steel)) / 10)
$tsu = @invamount (Tsurugi [1])
$i = @eval($tsu + $steel)
$cweight = $.weight
$mweight = @eval($.maxweight * .89)
$avweight = @eval($mweight - $cweight)
$rmndr = @eval ($avweight % 120)
$buy = @eval (@eval (@eval($avweight - $rmndr) / 120) - 1 + $i)
log $i < $buy
#while ($i <= 29) as loop
do talk 0
pause 1
do store
pause 2
#pause 0.5
while ($i <= $buy) as buyloop
do buy 13
#log $i of $buy
$i++
$cweight = $.weight
end buyloop
#do north
pause 1
do charselect
if ($weight > 86%) goto buy
goto cm
:buy
release all
:cm
lock buyT
call cm
stop
#release buyT
}
#-------------------------------------
automacro ovweight {
#weight 97%
inventory "Steel" >= 669
exclusive 1
#priority 1
run-once 1
call ow
}
macro ow {
do ss "Cart Boost"
pause 2
do move prontera 277 199
pause 3
do talknpc 282 200 r1
pause 2
do storage add @inventory (Steel)
pause 1
do storage close
release all
}
automacro loweight {
priority 4
weight < 9%
inventory "Tsurugi [1]" < 1
run-once 1
exclusive 0
call loweight
}
macro loweight{
do move prt_in 168 128
pause 1
release all
}
#-----------------------------------
automacro dc {
console /Disconnected from map server/i
run-once 1
exclusive 1
call {
do reload macro
release all
}
}
automacro tm {
console /Timeout on map server/i
run-once 1
exclusive 1
call {
do reload macro
release all
}
}
#automacro ov8 {
#weight > 87%
#exclusive 1
#run-once 1
#priority 1
#delay 1
#call putToCart
#}
#macro putToCart {
#release all
#}
automacro rlodWhenYouMust {
console /You must be/i
exclusive 1
run-once 1
call {
do macro stop
pause 1
do reload macro
release all
}
}
automacro rlodWhenYouMust11 {
console /connecting /i
exclusive 1
run-once 1
call {
do macro stop
pause 1
do reload macro
release all
}
}
automacro sp {
sp < 2%
run-once 1
exclusive 1
call sp
}
macro sp {
do move prontera 201 188
pause 1
do move 204 192
pause 2
do talknpc 61 141 r1
release all
}
This is the last macro I used for steel macro, its in prontera.
You just need to change numbers depending on your chars capability of carry items.
About the value of variable "$hex", sometimes I don't use rPE to recapture the right hex for it, I had a clue if I need to increase or decrease its value. Just experiment. But if really can't tell/guess, use rPE to see what's the right value.
My bot does 30k steel every 2~3hour, depending if there would be malfunction due to sudden change of the value of "$hex", but it rarely happened. Do you how? It's about the "macro delay" at the timeouts, change its value to 0, and add bigger pause where its needed such as storing items.
About
buying store
Code: Select all
automacro bstore {
console /You are now in the game/i
run-once 1
delay 2
call {
do ss "Buying Store"
pause 1
do send "Your Captured Packet"
release all
}
}
it's easy right? Just make another automacro or edit the above automacro for your bot to reconnect in a period of time to check if it needs to store items to the storage before doing buying store.
It's just about "TRIAL AND ERROR"