• Silahkan bergabung dengan chat kami di Telegram group kami di N3Forum - https://t.me/n3forum
  • Welcome to the Nyit-Nyit.Net - N3 forum! This is a forum where offline-online gamers, programmers and reverser community can share, learn, communicate and interact, offer services, sell and buy game mods, hacks, cracks and cheats related, including for iOS and Android.

    If you're a pro-gamer or a programmer or a reverser, we would like to invite you to Sign Up and Log In on our website. Make sure to read the rules and abide by it, to ensure a fair and enjoyable user experience for everyone.

Macro

sangga

TK A
Level 1
ini plugins nya save dgn extensi autotrade.pl
<div class='codetop'>NYIT-NYIT CODE</div><div class='codemain' style='height:300px;white-space:pre;overflow:auto'>package autoTrade;

#ported from messykorexp by Joseph
#original code by systeman

use strict;
use Plugins;
use Globals;
use Log qw(message warning error debug);
use AI;
use Misc;
use Network::Send;
use Utils;

Plugins::register('autoTrade', 'automated chat room dealing', \&Unload);
my $hook1 = Plugins::addHook('AI_pre', \&call);
my $hook2 = Plugins::addHook('parseMsg/pre', \&packet);

# load table file
our %trade_lut;
my $file = "autotrade.txt";
#my $cfID = Settings::addConfigFile($file, \%trade_lut, \&FileParsers:arseDataFile_lc);
my $cfID = Settings::addControlFile($file, loader => [\&FileParsers:arseDataFile_lc, \%trade_lut]);
#Settings::load($cfID);
undef $file;

sub Unload {
Plugins::delHook('AI_pre', $hook1);
Plugins::delHook('parseMsg/pre', $hook2);
Settings::removeFile($cfID);
}

my $dealTrade;
my $dealFinalize;
my $tradeDealAddItem;
my $itemAddTimeout;

# TIMEOUTS: you can change these if you want

# time to wait for them to add items before cancelling?
my $itemWaitTime = 12;
# time to wait before accepting deal request?
my $dealAcceptTime = 2;
# time to wait before adding zeny once they finalize their item choices?
my $zenyAddDelay = 3;

sub packet {
my $hookName = shift;
my $args = shift;
my $switch = $args->{switch};
my $msg = $args->{msg};

if ($switch eq "00E9") {
my $amount = unpack("L1", substr($msg, 2,4));
my $ID = unpack("S1", substr($msg, 6,2));
if ($ID > 0) {
# they added an item, so reset the timeout
$tradeDealAddItem = 1;
}
}
if ($switch eq "01F4") {
#deal request, wait before accepting
$itemAddTimeout = time;
}
if ($switch eq "00E5" || $switch eq "01F4") {
#deal request, wait before accepting
$itemAddTimeout = time;
}
if ($switch eq "00EC") {
my $type = unpack("C1", substr($msg, 2, 1));
if ($type == 1) {
#they finalize their item selections
$itemAddTimeout = time;
}
}
}

sub call {
AUTOTRADE: {
if (AI::is("","tradeAuto", "deal") && $config{tradeAuto} && $char->{skills}{NV_BASIC}{lv} > 4) {
if (AI::action ne "tradeAuto" && AI::action ne "deal" && $::currentChatRoom ne "") {
message "Begin auto-trade mode.\n", "autoTrade";
if ($config{dealAuto}) {
$config{dealAuto} = 0;
Misc::configModify("dealAuto", $config{dealAuto});
}
AI::queue("tradeAuto");
}

last AUTOTRADE if !AI::is("tradeAuto","deal");

if (Utils::timeOut($itemAddTimeout,$dealAcceptTime) && $::incomingDeal{name} && !$::currentDeal{name}) {
$messageSender->sendDealAccept();
undef $dealFinalize;
undef $dealTrade;
$itemAddTimeout = time;
message "Sent deal accept, begin trading\n", "autoTrade";
}
last AUTOTRADE if (!$::currentDeal{name});
if (!Utils::timeOut($itemAddTimeout,$itemWaitTime) && $tradeDealAddItem) {
$itemAddTimeout = time;
undef $tradeDealAddItem;
}
if (($::currentDeal{other_finalize} && Utils::timeOut($itemAddTimeout,$zenyAddDelay)) || Utils::timeOut($itemAddTimeout,$itemWaitTime)) {
if ($::currentDeal{other} eq ()) {
message "Other person didn't add any items, cancelling...\n", "autoTrade";
$messageSender->sendCurrentDealCancel();
$itemAddTimeout = time;
} elsif (!$dealFinalize) {
my $sumvalue;

my @currentDealOther;
foreach (keys %{$::currentDeal{other}}) {
push @currentDealOther, $_;
}
my $max = @currentDealOther;
for (my $i = 0;$i < $max;$i++) {
my $found = 0;
my $ID = $currentDealOther[$i];
my $name = lc main::itemName($::currentDeal{other}{$ID});
if (defined $trade_lut{$name}) {
message "Add ".$trade_lut{$name}."z x $::currentDeal{other}{$ID}{amount} to deal\n", "autoTrade";
$sumvalue += ($::currentDeal{other}{$ID}{amount} * $trade_lut{$name});
} else {
message "Other person added item which is not in buy list, cancelling...\n", "autoTrade";
$messageSender->sendCurrentDealCancel();
last AUTOTRADE;
}
}
message "Trading $sumvalue zeny and confirming\n", "autoTrade";
$messageSender->sendDealAddItem(0, $sumvalue);
sleep(0.5);
$messageSender->sendDealFinalize();
$dealFinalize = 1;
$itemAddTimeout = time;
}

}
if ($::currentDeal{you_finalize} && Utils::timeOut($itemAddTimeout,$itemWaitTime)) {
message "Other person didn't accept the final trade, cancelling...\n", "autoTrade";
$messageSender->sendCurrentDealCancel();
$itemAddTimeout = time;
}
if (!$dealTrade && $::currentDeal{you_finalize} && $::currentDeal{other_finalize}) {
message "Accepting final trade\n", "autoTrade";
$messageSender->sendDealTrade();
$dealTrade = 1;
}
}
}
}

return 1;</div>

config.txt: tradeAuto 1

di file autotrade.txt. :

# [item name] [price]
Zargon 5
Jellopy 1
Witherless Rose 20000
Elunium 50000
 

adi11

PAUD
Level 1
makro buatan kk guk2 yang buat quiver kok ga jalan ya aneh neh gw pake open kore 2.0.5.1
mohon pencerahan donk malah tulisannya calulate to route terus bingungg
 

adi11

PAUD
Level 1
@sangga
kok aneh ya ga jalan tuh ga bisa trade
kamu pake openkore versi brp kl bole link nya juga bener2 aneh
 

sangga

TK A
Level 1
link apa na yg aneh ??
di autotrade nya ditulis barang2 apa aja yg mau ditrade ..
gk bs nya dimana kk ??
 

adi11

PAUD
Level 1
@sangga
gini gw uda coba trade pake char laen ternyata pas gw masukin barang lgsg di trade tapi ga ada barangnya padahal da gw tulis di auto trade

kamu pake oper kore versi brp kl bole minta link nya buat dl openkorenya
 

mikuni

Belum Sekolah
Level 1
permisi mau tanya-tanya tentang macro avoid yang ada di bagian [Share]Macro neh.

bgini gmn yah caranya biar di bagian set Move itu angkanya random ? soalnya saya dah coba berbagai angka tp bermasalah klo mapnya itu sempit2 dan berliku soalnya slalu "cannot calculate a route" dikarenakan move yang ditujukan ke coordinat berada diluar map yang tidak bisa dilewati bot, trus saya juga mendapati klo dia lagi avoid kok monster nya ga ditabok dolo, botnya malah calculate route terus ampe bisa sukses movenya.

ato mungkin ada setingan lain gitu buat avoid di map map yang jalannya sempit?

thanks sebelumnya.
 

sangga

TK A
Level 1
macro itu dimaksudkan kyk gini :
bot itu akan membeli barang sesuai dengan harga yg tertera di autotrade.txt
jadi bknya dia yg ngasih barangnya --"
openkorenya sama kok ..
 

twocurious

TK B
Level 2
@ All yang bisa..

dari tadi gua baca dari depan sampe belakang rata2 minta macro buat warp, terus buat trade, buff, storage, skills...

klo dari gua nih ya...

ada gak yang misalnya kita config bot kita pindah lokasi map, terus langsung cari npc terdekat buat simpos... :smiley_beer:
 

kentangbusuk

1 SD
Level 2
@om ferry
gak ada om disitu sblom wa nanya dsni wa dah cek dsana.
barusan jg wa cek lg gak ad.
adnya yg auto trade yg pake pub...
bkn vending.
 

bandjoel

TK A
Level 1
automacro cek {
console /menambahkan Item untuk Transaksi/
run-once 1
exclusive 1
call cekcacaca
}

macro cekcacaca {
if ($item == Strawberry) goto straw

:straw
$jumlah = @eval ($item*1000)
do deal add z $jumlah
pause 1


Kok WAktu di trans 1 StrawBerry malah Smua Zeny Abis di makan...

ada yang bisa bantu ?
 

sangga

TK A
Level 1
@bandjoel : pake openkore 2.0.5 ? itu plugin utk openkore 2.0.5 ..

trs klo ttg macronya yg diatas, coba liat seluruh macros.txt nya, ntar kita koreksi rame² :)
 

momocha3

TK B
Level 1
hei macro itu ada download tambahan ato cuma buat txt baru aja di config???
wa kaga ngerti macro sama sekali....
 
Top