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
metalmarine
Noob
Noob
Posts: 13
Joined: 16 May 2011, 10:41
Noob?: No

Change material and Buying Store skill through macro

#1 Post by metalmarine »

TITLE: Change material and Buying Store skill through raw packet with the help of packet sniffer
Sub:

First, we need to learn about using console "send" command, with the help of rPE; and also rPE(any packet sniffer) itself. You just have to learn capturing the right packets. Also our official client(the one we're playing) must be GG(GameGuard) disabled or else we can't inject the rPE and we can't use this.

HERE ARE THE TOOLS I USED:
http://www.4shared.com/file/Hk0eLeJa/rPE.html
http://www.4shared.com/file/UYzAy7yT/hex_organizer.html ----- it's for giving spaces on raw packets, because when I copy hex string from rPE it has no spaces. Efficient with Buying Store.

BUYING STORE

The process involving rPE is packet capturing. We must know at least as simple as injecting rPE to your RO client, then capturing your prefered packets. when you have the set of packets, for example in BUYING STORE skill, when you captured the packets, copy and paste it in your macro file using "do send" command:

Code: Select all

do send xx xx xx xx ....  
Yes, there should be space after two characters. If you want to change items that you want to buy, you should capture new set of packets again. Yet, you could also just edit the packets you currently have if your adept on memorizing things, but it is much easier to just get new set of hex, just to be sure.

When you are in your console, type "skills" to know what's the name of Buying Store in your kore's skill table. Then, send the packets, like this:

Code: Select all

macro buyStore {
do ss [name of skill/ID of skill]
do send xx xx xx xx ....  
}
You won't be able to supervise your buying store, so make sure that it won't get DC or make sure whenever it get dc it automatically do again the macro.

TIPS:
•To use your captured packet efficiently, You must limit your buying zeny down to half or less, because when your zeny is lower than the zeny you have encoded we can't use the same packets, because it doesn't reflect on your zeny on the server.
•Also manage your "squelchDomains" in your config so that you get lesser lag.

VIDEO TUTORIAL (this is how I do it)
http://www.youtube.com/watch?v=zILhA-G3Rms


CHANGE MATERIAL

NOTE: You won't learn any new recipe through this process or using any 3pp(3rd party program).
TIP: Unlike BUYING STORE, this skill can be used without activating its skill, just like arrow crafting, but this doesn't work when your overweight than 90%.

Just like on Buying Store we also need to capture the right packets, there are two kinds of recipes:

1. The fixed packet recipe
Such as Combinations like

Code: Select all

9 Alcohol = 50 Orcish Voucher + 40 Skel Bone 
2 Witch Starsand = 10 Insect Feeler + 15 Chung Jah 
6 Necklace of Oblivion = 25 Raccoon Doll + 35 Moth Dust 
4 Hand of God = 10 Scorpion Tail + 30 Jack o' Pumpkin 
8 Phracon = 40 Frog Spawn + 40 Glass Bead
....
They're fixed recipes. You can't find any new recipe with this macro or using updated bot with Change material patch, because the recipes resides on the server. In Change material you can increase the ratio of raw materials, so it is just much easy if you manually convert it ingame.

2. Equip Type(incrementing packet) recipe
As of now there is very few recipes, like Tsurugi[1] = 10Steel, Guard[0]= 1Coal. This is what I worked hard on how fix it. Through macro, the hurdle here is that we need to create a code that will increment hex numbers. I haven't yet decipher out what is $hex in here:

Code: Select all

FOR STEEL
do send E4 07 10 00 00 00 00 00 01 00 00 00 $hex 00 01 00

Based on my analysis, it is the number order of the item(raw material) in your inventory, but still I'm not sure about it. After few weeks, I already quit playing RO, I didn't try to decipher it.

I finished the hex increment code that time, and earned about 4-5b zeny in almost a month by letting my pc ON 18hrs a day and wasting my time watching/waiting for steels to fill 30k on storage and vending it out. Then our electric bill came, and I got a heavy scolding from my father... hahaha, that time 1million zeny is 1peso, now 1peso is 2million zeny. Too bad I didn't invest those zeny because my father cut our internet connection.

Just ask questions, I just hope that I could answer it. I'll make some screen shots later.
Last edited by metalmarine on 20 May 2011, 09:18, edited 2 times in total.

EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: Change material and Buying Store skill through macro

#2 Post by EternalHarvest »

metalmarine wrote:We must know at least as simple as injecting rPE to your RO client, then capturing your prefered packets. when you have the set of packets, for example in BUYING STORE skill, when you captured the packets, copy and paste it in your macro file using "do send" command
Then, server inventory indexes (which are probably used here) change for some reason and your buying store is completely screwed.
This is what I worked hard on how fix it. Through macro, the hurdle here is that we need to create a code that will increment hex numbers. I haven't yet decipher out what is $hex in here:

Code: Select all

FOR STEEL
do send E4 07 10 00 00 00 00 00 01 00 00 00 $hex 00 01 00

Code: Select all

  /* this+0x0 */ short PacketType
  /* this+0x2 */ short PacketLength
  /* this+0x4 */ enum ItemListWinPacket::Type Type // len 4
  /*
    TYPE_CHANGEMATERIAL =  0x0,
    TYPE_EL_ANALYSIS_DISASSEMBLY =  0x1,
    TYPE_EL_ANALYSIS_COMBINATION =  0x2,
  */
  /* this+0x8 */ enum ItemListWinPacket::Action Action // len 4
  /*
    ACTION_CANCEL =  0x0,
    ACTION_OK =  0x1,
  */
  /* this+0xc */ unsigned short MaterialList[...]
So, "$hex 00 01 00" is something identifying item, be it server inventory index or item typeID.

Before relying on these packets, they need to be implemented in Network and Commands, so they will automatically use correct item identifiers and stuff.

kaldabog
Plain Yogurt
Plain Yogurt
Posts: 83
Joined: 08 Sep 2010, 13:45
Noob?: No

Re: Change material and Buying Store skill through macro

#3 Post by kaldabog »

Image
Last edited by kaldabog on 31 May 2011, 06:26, edited 1 time in total.

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

Re: Change material and Buying Store skill through macro

#4 Post by metalmarine »

I added a video tutorial(I hope will help you) on my first post for BUYING STORE.

@eternalharvest
ah....?????? I real didn't understand it. I hope your team would continue providing us(noob) support for very technical issues like that.

@kalbadog
sorry for the late reply, and yeah you hit the jackpot, but just like stated above its just like arrow crafting, you don't need to activate the skill, you just need need to have the skill and the job(be Genetic) to send the packet right. It's on the buying store that needs to initiate the skill first.

Your productivy depends on your character's weight capacity, the more weight you can carry, the more productive your bot is. So, Genetics with high str and maxed gym pass has the advantage for this.

Btw, I'll pm you my messy codes, could you pm yours pls?

hmmm.... about our codes, how about we share our algorithm or pseudocode(this sounds more justifiable) in the forum?

Well, this is just a temporary solution, so let's just wait for the developers to bring up the solution updates for this matter.


EDIT: Hmmm... Just to give my full support, I'll share my code(the change material code)

Code: Select all

automacro cm {
weight < 90%                                          #CM doesn't work if you're 90% overw8
inventory "Steel" < 409                               #when steels are over the said number, we need to storage it
inventory "Tsurugi [1]" > 0                           #there should be a tsurugi in your inv
#priority 4
#sp > 2%
run-once 1
delay 1
call cm
}

macro cm {
$steel = @invamount (Steel)                           #number of steel in inventory
$tsu = @eval(@invamount (Tsurugi [1]))                #number of tsurugi in inventory

$steelamount = @eval(@eval(@invamount (steel)) / 10)  #steel divided by 10 divisibility
$i = @eval($tsu + $steelamount)                       #amount of steel(by 10) and tsurugi in total

$cweight = $.weight                                   #current weight
$mweight = @eval($.maxweight)                         #max weight
$avweight = @eval($mweight  - $cweight)               #available weight
$rmndr = @eval ($avweight % 120)                      #excess weight that isn't enough to lift a 
                                                      #tsurugi - used to truncate decimals 

$buy = @eval(@eval (@eval (@eval($avweight - $rmndr) / 120) - 1 + $i) * 10) #get number of available tsurugi that can be carried
                                                                            

if (($i < $buy) && (@invamount (Tsurugi [1]) > 0)) goto cm   #if current steels(by 10s) are still lower than the limit 
                                                             #and you still have tsurugi, then continue
goto end                                              #if the the condition above isn't true, end the process.    
  :cm                                                 
  $si = 42                                            #the most important variable, this is the count(in decimal) of your items, 
                                                      #you must use rPE to know what's the starting 
                                                      #order(1st Tsurugi's number when you sniff the packet the 1st CMed Tsurugi),
                                                      #because when you reconnect it starts again with this value
                                                      
  $upbound = @eval($si + $tsu)                        #maximum change material skill to do, its your total item in hand
  log $upbound
    do stand
    pause 1
    log upper bound is $upbound
    while ($si <= $upbound) as cmloop                 #the loop, while the number of your items(excluding the tsurugis) 
                                                      #haven't yet reached your max items, do the loop
    #log $si of $upbound


###########CONVERTING TO HEX PROCESS, just search the net to know how to convert decimal to hex value


if ($si > 9) goto convertToHex                    #if the decimal $si is greater than 9, then we have to convert it to its hex value
    goto hex

:convertToHex
$deci = $si                                           #pass the $si value to variable $deci
$rmndr = @eval ($deci % 16)                           #get the remainder of divident $deci by dividing by the divisor 16
$quo = @eval (@eval($deci - $rmndr) / 16)             #get the quotient by truncating the decimals first
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                    #goto hex1 we need to evaluate the remaining decimals
if ($quo = 0) goto hex2                    #decimals are already eliminated
goto scm

:hex1
if (rmdnr = 0) goto norem
$hex = $quo$rmndr                          #the value won't reach FF(256) and the code can't convert more than FF(255) value, 
                                           #because the current version of the plugin don't support special function I needed. 
goto scm                                   #so, the solution I opted was to concatenate the hex and
                                           #the quotient-hex to produce an XX(hex value) formed value.
:norem
$norem = 0
$hex = $quo$norem
goto scm

:hex2
$hex = 0$rmndr                   


: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
}

Lol'ed at it, I tried to give comment on every line, but its been a long time since I made it, I'm having a headache til now posting it. I had a hard time remembering why did I do some codes. I hope that I inserted comment on what the variable was to be.

Ok, here's what I want to have for posting this, could someone enhance it or I just like to see how other's will do it, I think the programming I learned after a year graduating without programming job tarnished my point of view in programming.

renewal
Noob
Noob
Posts: 1
Joined: 12 Jun 2011, 09:54
Noob?: Yes

Re: Change material and Buying Store skill through macro

#5 Post by renewal »

can you show me the full config of change material?

auto change material
auto storage
auto buy

please help :?

kaldabog
Plain Yogurt
Plain Yogurt
Posts: 83
Joined: 08 Sep 2010, 13:45
Noob?: No

Re: Change material and Buying Store skill through macro

#6 Post by kaldabog »

renewal wrote:can you show me the full config of change material?

auto change material
auto storage
auto buy

please help :?
the code is already there too much spoon feeding not good

botl33rz
Noob
Noob
Posts: 3
Joined: 19 Jun 2011, 08:54
Noob?: Yes

Re: Change material and Buying Store skill through macro

#7 Post by botl33rz »

does this work? i copy and pasted this code and my character just keeps on disconnecting.. Can you please post a guide on how to use this? For us not programmers it's very hard to understand.. :(

kaldabog
Plain Yogurt
Plain Yogurt
Posts: 83
Joined: 08 Sep 2010, 13:45
Noob?: No

Re: Change material and Buying Store skill through macro

#8 Post by kaldabog »

botl33rz wrote:does this work? i copy and pasted this code and my character just keeps on disconnecting.. Can you please post a guide on how to use this? For us not programmers it's very hard to understand.. :(
I'm also not a programmer I just read, try, read, try until I get the basics and have what I need :D
the reason likely it keeps on disconnecting is because of wrong hex value this is already a guide you just need to "READ" and understand

p.s. I didn't copy and paste the codes because its too complex for me I just get the basics and create my own logic for the macro

botl33rz
Noob
Noob
Posts: 3
Joined: 19 Jun 2011, 08:54
Noob?: Yes

Re: Change material and Buying Store skill through macro

#9 Post by botl33rz »

kaldabog wrote:
botl33rz wrote:does this work? i copy and pasted this code and my character just keeps on disconnecting.. Can you please post a guide on how to use this? For us not programmers it's very hard to understand.. :(
I'm also not a programmer I just read, try, read, try until I get the basics and have what I need :D
the reason likely it keeps on disconnecting is because of wrong hex value this is already a guide you just need to "READ" and understand

p.s. I didn't copy and paste the codes because its too complex for me I just get the basics and create my own logic for the macro
So your code is different from this one? Can you please post your code? or maybe the right packet to send?

kaldabog
Plain Yogurt
Plain Yogurt
Posts: 83
Joined: 08 Sep 2010, 13:45
Noob?: No

Re: Change material and Buying Store skill through macro

#10 Post by kaldabog »

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.

Post Reply