dudes , i don't understand anything :((( ... for me is nothing clearly with auto-enchanter ... where i must put this ?
//edited and tweaked by mpj123
//testing, bug solutions and just being cool, MeatWod
INCLUDE StdLib\inventory.l2c
//Settings
DEFINE STRING ITEMNAME "WEAPON HERE/ARMOR HERE" //Item name, don't write the SA SA
DEFINE STRING ITGRADE S //Item grade (s80=s)
DEFINE STRING ENCHNAME "Scroll: Enchant Weapon (S)" //Enchant name
DEFINE STRING ENCHANT 12 //Max enchant
DEFINE INT CURENCHANT 0 //Current enchant, change line 38 too
DEFINE INT DELAY 1100 //Delay of all actions in MS
//Some definitions
DEFINE INT SUCCESSENCHANTED 0
DEFINE STRING CRYSTAL "Crystal: <&ITGRADE&> Grade"
DEFINE INT CRYID 0
DEFINE INT CRYCOUNT 0
DEFINE INT CRYCOUNT2 0
ITEM_GET_ID CRYID "<&CRYSTAL&>"
DEFINE STRING ITNAME 0
DEFINE INT ENCHID 0
DEFINE INT ENCHCOUNT 0
DEFINE INT ENCHUID 0
DEFINE STRING ENCHCODE 0
DEFINE STRING ITEM 0
DEFINE ARRAYLIST INVEN_AL 0
GET_INVENTORY INVEN_AL
//Calc enchant unique id
ITEM_GET_ID ENCHID "<&ENCHNAME&>"
INVEN_GET_UID ENCHUID "<&ENCHID&>"
ENCHCODE = ENCHUID.GET_HEX32
DEFINE STRING ENCH "19 <&ENCHCODE&> 00 00 00 00"
//Start actions
FOREACH I Inventory INVEN_AL
ITNAME = INVEN_AL.I.NAME
IF ITNAME == ITEMNAME
CALLSUB ENCHANT
PRINT_TEXT "<&ENCHCOUNT&> enchants remaining."
CURENCHANT = ZERO
ENDIF
NEXTEACH
PRINT_TEXT "<&SUCCESSENCHANTED&> are currently enchanted successfully to <&ENCHANT&>"
PRINT_TEXT "Done"
SCRIPT_END
SUB ENCHANT
DEFINE bytebuffer my_bb 256
my_bb.WRITE_BYTE #i95
my_bb.WRITE_INT32 INVEN_AL.I.ID
my_bb.WRITE_INT32 #i0
WHILE ZERO == ZERO
ITEM_COUNT CRYCOUNT "<&CRYID&>"
IF CURENCHANT < ENCHANT
ITEM_COUNT ENCHCOUNT "<&ENCHID&>"
IF ENCHCOUNT > ONE
CURENCHANT = CURENCHANT + ONE
PRINT_TEXT "Your weapon is enchanting to <&CURENCHANT&>"
INJECT "<&ENCH&>"
SLEEP "<&DELAY&>"
my_bb.TRIM_TO_INDEX
injectbb my_bb
SLEEP 300
ITEM_COUNT CRYCOUNT2 "<&CRYID&>"
IF CRYCOUNT2 > CRYCOUNT
DELETE my_bb
RETURNSUB
ELSE
IF CURENCHANT == ENCHANT
SUCCESSENCHANTED = SUCCESSENCHANTED + #i1
ENDIF
ENDIF
ELSE
PRINT_TEXT "Enchant is over."
PRINT_TEXT "<&SUCCESSENCHANTED&> are currently enchanted successfully to <&ENCHANT&>"
SCRIPT_END
ENDIF
ELSE
PRINT_TEXT "Successfully enchanted."
DELETE my_bb
RETURNSUB
ENDIF
WEND
RETURNSUB
:| please help a little cheatr like me ..thx