Jump to content

[L2Net]Script help


H3llB0y

Recommended Posts

Hi all, can someone help me?

 

I'm trying to use this script for sell crops at manor:

 

//////////////////////////////////////////////////////////////////

 

 

 

DEFINE_GLOBAL int ID_Seda 6543

DEFINE_GLOBAL int Ilos 177

 

 

/////////////////////////////////////////////////////////////////////

///////////////////// Manor /////////////////////////////////////////

// 1 - gludio ///2 - dion // 3 - giran // 4 - oren // 5 -aden

// 6 - innadril // 7 -  goddard // 8 - rune // 9 - schuttgard

 

DEFINE_GLOBAL int Man_nr 7

 

////////////////////////////////////////////////////////////////////

//// Anti anti bot

define_global int AAB 0 // 1-on 0-off

define_global int aab_sleep 100

////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////

/////////////// Dont change anything below /////////////////////////

////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////

define int slep_ran 0

GET_RAND slep_ran 0 70

aab_sleep = aab_sleep + slep_ran

Define string Man_name "Manor Manager"

Define int temp_spr1 0

Define int dyst_man

PRINT_TEXT "-------------------------------------------------------------------"

PRINT_TEXT "AUTO Sell crops v1.1b EPILOGUE by AdiFenix"

PRINT_TEXT "-------------------------------------------------------------------"

IF target_name != Man_name

COMMAND "/Target <&Man_name&>"

ENDIF

sleep 500

IF target_name == Man_name

DISTANCE dyst_man CHAR_X CHAR_Y CHAR_Z TARGET_X TARGET_Y TARGET_Z

if dyst_man < 150

 

 

IF ID_Seda >= 5000

IF ID_Seda <= 6568

 

ITEM_COUNT temp_spr1 "<&ID_Seda&>"

sleep 500

if temp_spr1 < Ilos

PRINT_TEXT "You typed too much crops to sell =  <&Ilos&> in inv u have =  <&temp_spr1&>  - Script Stopped"

 

ELSE

PRINT_TEXT " Starting monitoring manor system .... "

DEFINE_GLOBAL int zaeve 0

call prepare_1

ENDIF

else

PRINT_TEXT " Are u sure its CROP ID ? Check it please ! - Script Stopped"

endif

else

PRINT_TEXT " Are u sure its CROP ID ? Check it please ! - Script Stopped"

endif

 

else

PRINT_TEXT " You need to be closer to Manor manager !! - Script Stopped"

endif

else

PRINT_TEXT " I dont see -  Manor manager - Script Stopped"

endif

END_SCRIPT

 

 

 

FUNCTION prepare_1

 

SET_EVENT "<&SCRIPTEVENT_SERVERPACKETEX&>" "<&SYSTEM_CURRENTFILE&>" Buy_fun 120

 

 

zaeve = 1

 

do

NPC_DIALOG "bypass -h manor_menu_select?ask=9&state=<&ID_Seda&>&time=0"

sleep 900

loop zaeve == 1

 

 

RETURN VOID

 

FUNCTION Buy_fun

 

Define int Man_ok 0

Define int temp_seed 0

Define int ile_man 0

Define int temp_manor 0

Define int ilo_sed 0

Define int price 0

Define int temp_uid 0

packet.READ_BYTE null

packet.READ_INT16 null

packet.READ_INT32 temp_seed

if temp_seed == ID_Seda

packet.READ_INT32 ile_man

for a 0 "<&ile_man&>" 1

packet.READ_INT32 temp_manor

if temp_manor == Man_nr

// 4 (32 bit)

packet.READ_INT64 ilo_sed

packet.READ_INT64 price

packet.READ_BYTE null

PRINT_TEXT " Slots available =  <&ilo_sed&> Price <&price&>"

Man_ok = 1

ELSE

packet.READ_INT64 null

packet.READ_INT64 null

packet.READ_BYTE null

ENDIF

NEXT

IF Man_ok == 1

IF ilo_sed < Ilos

Ilos = ilo_sed.clone

PRINT_TEXT "Matching ...  "

ENDIF

INVEN_GET_UID temp_uid "<&ID_Seda&>"

if aab == 1

sleep "<&aab_sleep&>"

endif

inject "D0 02 00 01 00 00 00 <&temp_uid.GET_HEX32&> <&ID_Seda.GET_HEX32&> <&Man_nr.GET_HEX32&> <&Ilos.GET_HEX32&> 00

 

00 00 00"

// 4 bits ?

PRINT_TEXT " Sended = you should get the mats now"

zaeve = 0

ENDIF

else

PRINT_TEXT " DEBUG:ERROR WITH PACKET??? TID <&temp_seed&> SID = <&ID_Seda&> "

endif

 

 

 

RETURN VOID

 

I use last version of L2Net with High Five client, but when i use the function Script Editor------->Run-------> "Run syntax check" i get this error:

 

* Error at line 19: an Int value was expected as parameter.*

Error at line 32: an Int value was expected as parameter.

 

Can someone tell me what's the problem with it plz?

Link to comment
Share on other sites

// Manor 1.6 by AdiFenix

//////////////////////////////////////////////////////////////////

DEFINE_GLOBAL Arraylist SED_ID 0

DEFINE_GLOBAL Arraylist ILO 0

DEFINE_GLOBAL Arraylist MAN 0

DEFINE_GLOBAL Arraylist u_id 0

/////////////////////////////////////////////////////////////////////

///////////////////// Manor /////////////////////////////////////////

// 1 - gludio ///2 - dion // 3 - giran // 4 - oren // 5 -aden

// 6 - innadril // 7 -  goddard // 8 - rune // 9 - schuttgard

///////////////////////////////////////////////////////////////////////

 

 

SED_ID.add #I6544 //Complete

ILO.add #I200 

MAN.add #I4 

 

SED_ID.add #I6543

ILO.add #I280

MAN.add #I4

 

SED_ID.add #I6543

ILO.add #I280

MAN.add #I3

 

////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////

/////////////// Dont change anything below /////////////////////////

////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////

DEFINE_GLOBAL int zaeve 0

DEFINE_GLOBAL int ok 0

DEFINE_GLOBAL int check_last 0

DEFINE_GLOBAL int Gmsg 0

Define int temp_spr1 0

Define string Man_name "Manor Manager"

Define int dyst_man 0

///////////////////////

if SED_ID.count != ILO.count

PRINT_TEXT " Data corrupt  ! - Script Stopped"

Jump_to_label koni

else

if SED_ID.count != MAN.count

PRINT_TEXT " Data corrupt  ! - Script Stopped "

Jump_to_label koni

endif

ENDIF

 

 

for a 0 "<&ILO.count&>" 1

ITEM_COUNT temp_spr1 "<&SED_ID.a&>"

sleep 250

if temp_spr1 < ILO.a

PRINT_TEXT "You typed too much crops to sell =  <&ILO.a&> in inv u have =  <&temp_spr1&>  - Script Stopped"

Jump_to_label koni

ENDIF

next

 

for a 0 "<&man.count&>" 1

if man.a < 1

PRINT_TEXT " manor nr ---??? - check data ! - Script Stopped"

jump_to_label koni

ENDIF

if man.a > 9

PRINT_TEXT " manor nr +++??? - check data ! - Script Stopped"

jump_to_label koni

ENDIF

next

 

IF target_name != Man_name

COMMAND "/Target <&Man_name&>"

ENDIF

sleep 500

IF target_name == Man_name

DISTANCE dyst_man CHAR_X CHAR_Y CHAR_Z TARGET_X TARGET_Y TARGET_Z

if dyst_man > 150

PRINT_TEXT " You need to be closer to Manor manager !! - Script Stopped"

jump_to_label koni

endif

ELSE

PRINT_TEXT " I dont see -  Manor manager - Script Stopped"

jump_to_label koni

ENDIF

/////////////////////////////////////////////

define int temmm 0

for a o "<&SED_ID.count&>" 1

INVEN_GET_UID temmm "<&SED_ID.a&>"

u_id.add temmm.clone

 

next

 

 

 

 

PRINT_TEXT "-------------------------------------------------------------------"

PRINT_TEXT "AUTO Sell crops v1.6 EPILOGUE by AdiFenix"

PRINT_TEXT "-------------------------------------------------------------------"

 

SET_EVENT "<&SCRIPTEVENT_SERVERPACKETEX&>" "<&SYSTEM_CURRENTFILE&>" Buy_fun 120

SET_EVENT "<&SCRIPTEVENT_SERVERPACKET&>" "<&SYSTEM_CURRENTFILE&>" sysmas 98

sleep 500

Call prepare_1

 

 

do

sleep 977

loop zaeve < SED_ID.count

 

 

Label koni

 

 

END_SCRIPT

 

 

 

FUNCTION prepare_1

define int zm1 0

ok = 1

do

Gmsg = 0

NPC_DIALOG "bypass -h manor_menu_select?ask=9&state=<&SED_ID.0&>&time=0"

do

sleep 5

loop Gmsg == 0

if ok == 1

sleep 542

endif

loop  ok != 0

 

if SED_ID.count > 1

sleep 542

for i 1 "<&SED_ID.count&>" 1

 

 

check_last = 1

NPC_DIALOG "bypass -h manor_menu_select?ask=9&state=<&SED_ID.i&>&time=0"

 

 

do

sleep 2

loop check_last == 1

sleep 542

NEXT

endif

 

 

 

RETURN VOID

 

FUNCTION Buy_fun

ok = 0

Gmsg = 1

Define int Man_ok 0

Define int temp_seed 0

Define int ile_man 0

Define int temp_manor 0

Define int ilo_sed 0

Define int price 0

Define int temp_uid 0

packet.READ_BYTE null

packet.READ_INT16 null

packet.READ_INT32 temp_seed

FOR b 0 "<&SED_ID.count&>" 1

if temp_seed == SED_ID.b

packet.READ_INT32 ile_man

IF ile_man == 0

PRINT_TEXT "Manor with this type of croops (<&temp_seed&>) = 0 "

endif

for a 0 "<&ile_man&>" 1

packet.READ_INT32 temp_manor

if temp_manor == man.b

packet.READ_INT64 ilo_sed

packet.READ_INT64 price

packet.READ_BYTE null

PRINT_TEXT " Slots available =  <&ilo_sed&> Price <&price&> ID = <&temp_seed&>"

IF ilo_sed < ILO.b

inject "D0 02 00 01 00 00 00 <&u_id.b.GET_HEX32&> <&temp_seed.GET_HEX32&> <&temp_manor.GET_HEX32&> <&ilo_sed.GET_HEX32&> 00 00 00 00"

ELSE

inject "D0 02 00 01 00 00 00 <&u_id.b.GET_HEX32&> <&temp_seed.GET_HEX32&> <&temp_manor.GET_HEX32&> <&ilo.b.GET_HEX32&> 00 00 00 00"

ENDIF

ELSE

packet.READ_INT64 null

packet.READ_INT64 null

packet.READ_BYTE null

PRINT_TEXT "Diferent man.: <&temp_manor&> for <&temp_seed&> "

ENDIF

NEXT

 

 

endif

next

 

if check_last == 1

check_last = 0

endif

zaeve = zaeve + 1

RETURN VOID

 

 

FUNCTION sysmas

define int man_mani 879

define int temp_id 0

packet.read_byte null

packet.read_int32 temp_id

if temp_id == man_mani

Gmsg = 1

endif

 

 

RETURN VOID

Link to comment
Share on other sites

I found this script and i tried to moify it, but i'm not so experienced in l2Net Scripts:

 

 

////////////////////////////////////////

 

////////////////////////////////////////

//

// MANOR SETTINGS

// Define the id of the seed

DEFINE INT SEEDID 6765

// Define the id of the harvester

DEFINE INT HARVID 5125

 

////////////////////////////////////////

//

// INTERNAL VARIABLES [DO NOT CHANGE]

DEFINE_GLOBAL INT ZERO 0

DEFINE_GLOBAL INT TARGET_SEEDED 0

DEFINE_GLOBAL INT TARGET_IN_RANGE 0

 

////////////////////////////////////////

 

LABEL START

 

////////////////////////////////////////

 

PRINT_TEXT "=================================="

PRINT_TEXT "        Seeding Script v1"

PRINT_TEXT "=================================="

PRINT_TEXT " Starting in 3 seconds..."

 

SLEEP 3000

 

DO

  PRINT_TEXT "Targetting mob..."

  TARGET_NEAREST

  CALLSUB ATTACK

  PRINT_TEXT "Harvesting mob..."

  USE_ITEM "<&HARVID&>"

  TARGET_SEEDED = 0

LOOP TRUE

 

////////////////////////////////////////

 

END_SCRIPT

 

////////////////////////////////////////

 

SUB ATTACK

 

PRINT_TEXT "Attacking mob..."

 

IF TARGET_CUR_HP > 0

  ATTACK_TARGET

ENDIF

 

DO

        PRINT_TEXT "Seeding mob..."

      USE_ITEM "<&SEEDID&>"

      TARGET_SEEDED = 1

  ELSE

      SLEEP 500

  ENDIF

LOOP TARGET_SEEDED == 0

 

RETURNSUB

 

////////////////////////////////////////

 

When i start this script, my character seed the mob, and then in Bot Chat i see this:

 

14.01.51 :[Harvesting mob...

14.01.51 :[seeding mob...

14.01.51 :[Attacking mob...

 

Written many many times, and suddenly my character doesn't obey at my commands.....

 

Can anyone tell me if, and where, i made a mistake?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • rename the l2.bin into l2.exe
    • L2LIVE.PRO- Dynamic Mid-rates Essence Seven Signs GRAND OPENING - July 5, 20:00 GMT+3 (EEST) TEST SERVER IS OPEN - COME AND CHECK IT OUT TODAY! Join our community and be part of it at: https://www.l2live.pro https://discord.gg/k3NMgR4Dmu   Server description * EXP/SP: Dynamic (x1- x100 based on your level, *before* Sayha and EXP buffs * Adena: x50 / Item Drop: x10 / Fishing EXP increased / Attribute EXP increased * Simplified gameplay to stay in the loop while not spending hours and hours farming * Starter Pack containing very useful items for beginners * MP replenishing potions with auto-consumption * No overpowered donations L2LIVE shop * All spellbook coupons, pet spellbook coupons and master books are sold via Game Assistant * Additionally you can buy SP pouches, enchanted talismans, pet training guides and various other consumables for Adena and L-Coin * More items such as cloaks, more talismans, agathions, belts, pendants, enchantment scrolls of various grades, evolution stones, etc will be added! Shop server as a shortcut, and all retail-like ways of earning items are still here! L-Coins * Drops with small change and in random amounts from Lv60+ monsters  * All raidbosses drop random amount of L-Coin Pouches generating up to 420 Lcoin per unit. **Grand Olympiad and Events** * Grand Olympiad is held week day * Format is 1v1, unlimited weekly fights  * Heroes are declared weekly at Sunday * There are three automated events - TvT, CTF and Deathmatch, running at evenings * Orc Fortress, Battle with Balok, Keber Hunter, Archievements Box, Daily Gift Calendar provisional events are active too Custom user commands * .offlineplay command, your character will keep playing till death or server restart * .offlineshop command, keeps your shop sitting until all items are purchased * .apon / .apoff - enable/disable HP/MP autoconsume And lots of other small improvements are waiting for you!   Join our community and be part of it at: https://www.l2live.pro https://discord.gg/k3NMgR4Dmu
  • Topics

×
×
  • Create New...