Wednesday, May 16, 2012

Custom Map

FLD Creation Guide
How to extract custom maps and create FLD file

(note: short version)

1. Extract the map (gat and rsw)
2. Copy both to OpenKore\fields\tools
3. Download Perl or Strawberry Perl
4. Execute script: gat_to_fld.pl
5. Copy created .fld data to OpenKore\fields

You can either execute the script by using:

a perl interpreter of choice
the perl interpreter kore uses: start.exe

cd to kore's root folder
run the following command:

C:\Openkore-SVN>start.exe ! .\fields\tools\gat_to_fld.pl

Note: in this example the root folder was: C:\Openkore-SVN, yours can be different depending on where you have installed kore.

You Need Perl

ServerType

ServerType

serverType
Network parser module to use with your server.

File:Development.png The following documentation describes a feature that was greatly changed in SVN trunk (latest development version) since the last release.
It may work differently or not be available if you're using 2.0.7 or any older version.


Contents
[hide]

1 ServerTypes overview
1.1 Supported
1.2 Legacy
2 Determining kRO serverType
2.1 Compilation Date
2.2 Server Version
2.3 Packet Appearance
2.4 Notes
3 Links

ServerTypes overview
Supported

Named serverTypes can be loaded since r6870 and begin to appear in r7066 (not counting kRO serverType tree which started all that madness).
Server servertype
Official, Korea kRO_RagexeRE_0 8_1
Official, Taiwan twRO 21, 22
Official, Japan none
Official, Thailand tRO 21
Official, China none
Official, International iRO 22
Official, Philippines pRO 22
Official, Indonesia idRO 22
Official, Malaysia mRO 22
Official, Brazil bRO (Odin) 0
bRO_Thor (Thor) 22
Official, Russia rRO 0
Official, France fRO 0
Official, Middle East aRO 22
Private servers kRO_RagexeRE_*
kRO_Sakexe_* *


File:Development.png Implementation of this feature is expected to become outdated with server updates.
As OpenKore is a free project, if you stumble upon such updates, you are expected to fix the problem and contribute your changes back. Usually, server supporters will do that, but there isn't any for random private servers, and some official ones may not always be covered.
Legacy

Numeric serverTypes (0-22, 8_1-8_5) are outdated and aren't being updated to follow server updates, so they probably will not work correctly - that's a real reason to update from OpenKore 2.0.7 and stop using them, if you don't want to update them by yourself. Don't complain that there's just "some problems" with them if you don't have solutions too.

They're kept in OpenKore for use with really outdated official and private servers.

serverType 0 is also used as a base for serverTypes for official servers (except kRO).
Determining kRO serverType

OpenKore 2.0.7 and previous versions does not have kRO serverType and aren't capable of loading it without changes in source. To configure for an up to date pserver, you need svn trunk (or 2.1 when it becomes released), not 2.0.7.

Only official servers have their own serverType, so other servers (private ones) must find the server's executable compilation date and use the appropriate kRO serverType (newer versions) or Sakray serverTypes (older versions)

Currently, kRO serverTypes syntax is:

kRO_RagexeRE___

And Sakray ones is:

kRO_Sakexe___

You can find all serverType files in src/Network/Receive. Only serverTypes whose files actually do exist would work.
Compilation Date

Executable's compilation date can be changed, so don't really rely on it.

1. Download IpeViewer [1].

2. Open it and go the File > Open or just press F2. Select your server's executable.




3. Go to PE Header tab.

http://www.openkore.com/images/7/7e/ServerType-header.PNG



4. Beside the Time Data Stamp box, see the executable's compilation date.




5. Find the most suitable serverType file in src/Network/Receive/kRO.

For example, if the date was January 26, 2010, file name would be RagexeRE_2010_01_26a.pm.




6. Set serverType to "kRO_" and file name without extension.

For example, if file name was RagexeRE_2010_01_26a.pm, serverType would be kRO_RagexeRE_2010_01_26a.

If there is no file with exact compilation date, try the ones near to that date, or the latest available.
Server Version

Server version changes when there are incompatible changes in protocol (usually master_login packet changes at that point). Try serverTypes corresponding to the server's version. Use eAthena's packet_db as reference.
Packet Appearance

Since there are packets being continually introduced, you may inspect packets (and packet lengths) used on the server (either from already generated recvpackets.txt or from warnings on unknown packets). Use eAthena's packet_db as reference.
Notes

If you bot on a private server that uses eAthena, DO NOT use kRO_RagexeRE_0, as it is only meant to be used for the official kRO server.


Links

OpenKore's serverType files
eAthena's packet_db.txt
rAthena's packet_db.txt

Sunday, May 13, 2012

Packet Length Extractor

Packet Length Extractor

If you're having server problems, such as:

Packet Tokenizer: Unknown switch: xxxx
Getting disconnected after a few seconds
NPCs, players and monsters are not recognized by Kore (shown as Unknown)

Then generating a new recvpackets.txt might solve the problem. It's advisable to always extract the recvpackets before running Openkore. The file must be on tables folder.

The network data that the server sends to Kore, is a byte stream. Kore must be able to recognize messages inside that byte stream to be able to do something with it. But the size of the messages can vary from to server to server. Recvpackets.txt contains information about the size of each message, so Kore can correctly split the byte stream into messages.
Contents
[hide]

1 RO Tools
1.1 Usage
2 Packet Extractor
3 Packet Extractor v3
3.1 Usage
4 Notes

RO Tools

JCV's RO Tools v1.0.3 (Link down as of Jan 19, 2012. See instructions below for OpenPacketExtractor)

It's better to use JCV's RO Tools as it is more up to date and have some fixes for newer clients. Also it's much easier to maintain, but it has undesirable and outdated options in addition to the Openkore packet extractor.
Usage

Open RO Tools.
Click in the button with ... beside the box. Search for your's server executable (not server patcher) and open it.
File:button.PNG
On Extractor Type, check Full Disarm box.
File:full.PNG
Click on Start button and wait it to finish.
File:start.PNG
After it finishes, it will ask for you to save the file. Save it on tables folder, inside your Openkore's root folder. Override current file if needed.

Packet Extractor

OpenKore Packet Length Extractor v1.1.0 (Link down as of Jan 19,2012)
Also in OpenKore SVN.

Packet Extractor v3

In OpenKore SVN. (See kLab's forum post on Open Packet Extractor for more details.)

Packet extractor branch to work with new insert server list here clients.
Usage

Run packet_extract.pl with your ragexe file name as an argument. It will generate extractor.exe.
Run extractor.exe (works with wine on non-Windows) which will output recvpackets contents to STDOUT.

Notes

Recvpackets file can be renamed as long as recvpackets option on servers.txt is set accordingly. (See Connectivity Guide)
There may be problems extracting the recvpackets if your server's client has some kind of protection. You should deal with it (like unpack if binary is packed) before using packet extractor, if it fails to find anything.

Happy Mother Day's

Selamat Hari Ibu Untuk Semua Ibu Atas Muka Bumi Ni.
Jasa Anda Semua Amat Dihargai.
Duit Tak Banyak Nak Beli Barang Untuk Mak Aku.
Jadi Tak Leh Nak Beli Hadiah Lah.
Kesian Aku.
Tahun Depan La Plak Kot

Full Chemical Protection

automacro paket {
console /\[(jarak|dist)=(.*)\] (.*) \((\d+)\): (f|fcp|FCP)$/
exclusive 1
run-once 1
call {

$distance = $.lastMatch2
$namaPlayer = $.lastMatch3
$playerID = $.lastMatch4
$playerguild = @eval (exists $::players{$::playersID[$playerID]}->{guild} ? $::players{$::playersID[$playerID]}->{guild}{name} : 'null')

#Nama guild yg mau  FCP
$guild1 =
$guild2 =
$guild3 =
$guild4 =
$player1 =

if ($playerguild == $guild1) goto oke
if ($playerguild == $guild2) goto oke
if ($playerguild == $guild3) goto oke
if ($playerguild == $guild4) goto oke
if ($namaPlayer == $player1) goto oke
goto lain

:oke

if ($distance > 2 ) goto jauh

do sp 479 $playerID 5

goto end

:jauh
do e com

goto end
:lain
do c Ank Bukan Geng Aku P Belah...

:end

release paket
}
}

automacro sp {
console /\[(jarak|dist)=(.*)\] (.*) \((\d+)\): (fcp|FCP)$/
sp < 10%
exclusive 1
run-once 1
call kering
}

macro kering {
do c Tunggu Sat Sp Abis Neh $.sp
pause 0.2
release sp
}

Gospel With pubm

automacro paket {
pubm "gospel"
exclusive 1
run-once 1
call pket
}

macro pket{
do ss 369 10
release paket
}



Taip "gospel" bot akan buff player anda
Kalau Nak Bot Buff Tanpa Guild ,
Ganti $guild1 menjadi $player1
cth: $player1 = nama char kamu yg akan di beri buff


setelah diganti $guild1 menjadi $player1 kita harus tukar juga  if ($playerguild == $guild1) goto oke menjadi if ($namaPlayer == $player1) goto oke.

Contoh Bot Tukar Jadi Players

automacro link {
console /\[(jarak|dist)=(.*)\] (.*) \((\d+)\): (spirit|soul|\*Flag\s\d\*)$/
sp > 10%
call linker
}

macro linker {
$distance = $.lastMatch2
$namaPlayer = $.lastMatch3
$id = $.lastMatch4
$playerguild = @eval (exists $::players{$::playersID[$id]}->{guild} ? $::players{$::playersID[$id]}->{guild}{name} : 'null')

#Nama player yg mau di paket
$player1 =
$player2 =
$player3 =
$player4 =
$player5 =

if ($namaPlayer == $player1) goto oke
if ($namaPlayer == $player2) goto oke
if ($namaPlayer == $player3) goto oke
if ($namaPlayer == $player4) goto oke
if ($namaPlayer == $player5) goto oke
goto bukan

if ($id < 0) stop
if ($distance > 11) goto jauh

:oke
$jobID = @eval ($::players{$::playersID[$id]}->{jobID})
if ($jobID = 7) goto knight
if ($jobID = 13) goto knight
if ($jobID = 4008) goto knight
if ($jobID = 4014) goto knight
if ($jobID = 12) goto assassin
if ($jobID = 4013) goto assassin
if ($jobID = 10) goto smith
if ($jobID = 4011) goto smith
if ($jobID = 14) goto paladin
if ($jobID = 21) goto paladin
if ($jobID = 4015) goto paladin
if ($jobID = 4022) goto paladin
if ($jobID = 4012) goto sniper
if ($jobID = 11) goto sniper
if ($jobID = 16) goto professor
if ($jobID = 4017) goto professor
if ($jobID = 8) goto priest
if ($jobID = 4009) goto priest
if ($jobID = 15) goto champion
if ($jobID = 4016) goto champion
if ($jobID = 4010) goto wizard
if ($jobID = 4018) goto stalker
if ($jobID = 18) goto creator
if ($jobID = 4019) goto creator
if ($jobID = 4020) goto clown
if ($jobID = 4021) goto clown
if ($jobID = 19) goto clown
if ($jobID = 20) goto clown
if ($jobID = 4047) goto star
if ($jobID = 4049) goto soul
if ($jobID = 23) goto snoob
goto jauh

:jauh
do c $namaPlayer Jangan Jauh2 donk...
stop
release link
:bukan
do e ??
stop
release link

:snoob
do sp 451 $id
stop
release link
:star
do sp 448 $id
stop
release link
:soul
do sp 461 $id
stop
release link
:knight
do sp 452 $id
stop
release link
:priest
do sp 454 $id
stop
release link
:wizard
do sp 453 $id
stop
release link
:smith
do sp 458 $id
stop
release link
:sniper
do sp 460 $id
stop
release link
:assassin
do sp 457 $id
stop
release link
:paladin
do sp 450 $id
stop
release link
:champion
do sp 447 $id
stop
release link
:professor
do sp 449 $id
stop
release link
:creator
do sp 445 $id
stop
release link
:clown
do sp 455 $id
stop
release link
:stalker
do sp 456 $id
stop
release link
}