Change material and Buying Store skill through macro

Philippines

Moderators: waferbaron, Moderators

Forum rules
This server is currently not maintained and tables folder (including connection info) is outdated. Read the wiki for instructions on how to update those information. Please contribute your updated info. Contact Cozzie to join the team as a regular server supporter.
Message
Author
botl33rz
Noob
Noob
Posts: 3
Joined: 19 Jun 2011, 08:54
Noob?: Yes

Re: Change material and Buying Store skill through macro

#11 Post by botl33rz »

kaldabog wrote:
botl33rz wrote: So your code is different from this one? Can you please post your code? or maybe the right packet to send?
Read the first post every item has different packet.
I'm trying to change material Tsurugi[1] to Steel, I used WPE to sniff the packets and the packets posted by Metalmarine is correct, but theres a number that always changes, the "$hex" value above always changes.. What do I do? his code does not work, my bot just keeps on getting disconnected.

EDIT: As I have observed in my bot, it gets disconnected before doing the command "do stand" it doesn't even reach the do send "packet" command yet, so probably it's not that the packet is wrong that's why i'm getting disconnected.. what can be the problem? My brain has been drained of it's juice already thinking of what's wrong with the code.. O.o

EDIT:EDIT: nevermind what I said, I've made it work already! :) Thanks BTW! ^__^

Sophos
Human
Human
Posts: 22
Joined: 20 Jul 2009, 01:58
Noob?: Yes

Re: Change material and Buying Store skill through macro

#12 Post by Sophos »

Code: Select all

FOR STEEL
do send E4 07 10 00 00 00 00 00 01 00 00 00 $hex 00 01 00
You could tell the packets of other items to use this skill? :D
[]s

SophoS

xo-vant
Noob
Noob
Posts: 1
Joined: 11 Mar 2010, 08:29
Noob?: Yes

Re: Change material and Buying Store skill through macro

#13 Post by xo-vant »

do i need openbuy store to get the hexed code of item?

sky320rey
Human
Human
Posts: 27
Joined: 13 May 2008, 04:23
Noob?: No
Location: Here, There, Everywhere!

Re: Change material and Buying Store skill through macro

#14 Post by sky320rey »

very useful macro. thanks for the share. :D

roshen
Noob
Noob
Posts: 1
Joined: 26 Jan 2012, 14:12
Noob?: Yes

Re: Change material and Buying Store skill through macro

#15 Post by roshen »

automacro buystore {
console /....../1 <<<<<< can you guide me more about this part, don't know what is this for and if it is necessary that i should change it???
run-once 1
call buy
}

metalmarine
Noob
Noob
Posts: 13
Joined: 16 May 2011, 10:41
Noob?: No

Re: Change material and Buying Store skill through macro

#16 Post by metalmarine »

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"

c4c1n6kr3m1
The Way Of Human
The Way Of Human
Posts: 150
Joined: 24 Mar 2012, 04:13
Noob?: Yes

Re: Change material and Buying Store skill through macro

#17 Post by c4c1n6kr3m1 »

what is the code for "Coal"?
i can not use rpe, client recognise it and closed in my server

jbauson
Human
Human
Posts: 20
Joined: 16 Apr 2008, 02:46

Re: Change material and Buying Store skill through macro

#18 Post by jbauson »

I tried checking the HEX for Tsurugi [1] using rPE and then do the increment in a chat-triggered macro
The macro is doing a loop and send the packet below:

Code: Select all

do send E4 07 10 00 00 00 00 00 01 00 00 00 XX 00 01 00
Well, it worked for like 7-9 times, until all the Tsurugi [1] in my inventory has been processed. And since I have this another script that will buy Tsurugi [1] when empty, I need to recheck from rPE again and start with the loop.

For some reason, the HEX checker on the shared code on this thread is not working for me, it will only return 2A or 2B.

(Note: Doing this method on X-kore)

Post Reply