Forums
GStrader for service @gstorage - Printable Version

+- Forums (https://uaro.kiev.ua/forum)
+-- Forum: uaRO (https://uaro.kiev.ua/forum/forumdisplay.php?fid=1)
+--- Forum: uaOpenKore (https://uaro.kiev.ua/forum/forumdisplay.php?fid=43)
+---- Forum: Macros (https://uaro.kiev.ua/forum/forumdisplay.php?fid=44)
+---- Thread: GStrader for service @gstorage (/showthread.php?tid=37)



GStrader for service @gstorage - Sergio - 21-04-2024

Currently I have completed the first stage of a large macro. You can download from the main repository:
https://github.com/uaOpenKore/uOKfiles/tree/main/macros/GStrader
Below I will describe in more detail the logic of the macro to make it easier for beginners to understand. 

Macros available:
macro-GStrader-pay_arche.txt
macro-GSbrewer-pay_arche.txt

The files-lists are available:
equipsFselling.txt
itemsFholding.txt
itemsFselling.txt
potionsFcreating.txt

additional files:
sortGStrader.sh
itemsFexcluding.txt


RE: GStrader for service @gstorage - Sergio - 05-05-2024

Preparation for script usage:

To connect the macro, add a line like this to the macro.txt file:
Code:
!include macro-GStrader-pay_arche.txt -> macros.txt


The ironic character must be saved in Cafe pay_arche

Config.txt:
Code:
saveMap pay_arche

Should not contain blocks buyAuto
Inventory replenishment should only be specified through getAuto
Automatic selling should be disabled, and NPC should not be defined:
Code:
sellAuto 0
#sellAuto_npc payon_in02 87 34


The auto-storage should be minimally described:
Code:
storageAuto 1
#storageAuto_npc pay_arche 55 123
#storageAuto_password
storageAuto_notAfterDeath 0
storageAuto_keepOpen 0
storageAuto_useChatCommand @gstorage
relogAfterStorage 0
minStorageZeny 0


Defining the macro behavior:
Code:
macro_orphans reregister


For quick and correct usage of the shared storage, I use such timeouts.txt:
Code:
ai_storageAuto 0.1
ai_storageAuto_giveup .5
macro_delay .01
ai 0

Example of the used items_control.txt:
Code:
all 0 1 0
Awakening Potion 5 1 0
Butterfly Wing 6 1 0
Fly Wing 10 1 0
Meat 30 1 0



RE: GStrader for service @gstorage - Sergio - 05-05-2024

equipsFselling.txt - List of equipment for selling
itemsFholding.txt - List of items for selling excess, to avoid overflowing Kafra
itemsFselling.txt - List of items to be completely sold
potionsFcreating.txt - Priority of brewing potions for alchemist


RE: GStrader for service @gstorage - Sergio - 05-05-2024

sortGStrader.sh - Unix script for sorting and cleaning lists, not needed for OpenKore operation
itemsFexcluding.txt


RE: GStrader for service @gstorage - Sergio - 05-05-2024

Description of the macro macro-GStrader-pay_arche.txt

Recommended character: Merchant with skills:
- 10 Enlarge Weight Limit
- 10 Discount
- 10 Overcharge
Cart is not used.

Be prepared that for the initial filling of consumables in gstorage, OpenKore may spend a large amount (5-10 million) Zeny!

You can use a character of any class, but there may be problems with weight overload!

Basic functions written in Perl:
sub _s_readFs
sub _s_getItem
sub _s_delItem

These functions are necessary for reading lists and organizing a convenient stack for lists.

All macros are protected by the exclusive parameter.

The auto-macro triggers when OpenKore starts, and every 6000 seconds after that.
Code:
automacro _Auto_GStarde {
    exclusive 1
    delay 3
    timeout 6000
    call StarGS
}


Main macro that can be manually launched: macro StarGS
Code:
macro StarGS {
    do timeout macro_delay .01
    set exclusive 1
    do conf lockMap pay_arche
    pause 1
    do tele 2
    pause 1
    do move pay_arche 109 134
    do autostorage
    call _h_i
    call _s_e
    call _s_i
    call _buy_i
    call _ref_start
    do autostorage
    do conf lockMap pay_dun01
    do tele 2
    pause 2
    do move pay_dun00
}

The macro returns the character to the save point, and takes it to the trading spot with the butcher.

Then it sells excess items according to the itemsFholding.txt list. Next, it sells equipment listed in equipsFselling.txt - this list is for individual items. The bot will take items from storage one by one and sell them.

After that, the bot sells everything according to the itemsFselling.txt list - i.e., if an item needs to be retained, it must be excluded from this list.

After all sales, the bot will proceed to the _buy_i function - this function will make the bot enter the Tools Dealer's building and purchase goods according to the list.

Code fragment:
Code:
if (@storamount(Butterfly Wing) < 1000 ) {
    do storage close
    call _b_R --14 300
    goto startCheck
}

Meaning, OpenKore will buy Butterfly Wings until there are fewer than 1000 in the storage. Purchasing is done by the _b_R macro-function, which takes 2 parameters: the first parameter is the ID of the item in the NPC list, and the second parameter is the purchase batch. Thus, the bot will fill the storage up to 1299 units of the item.

If an item needs to be excluded from the purchase, then the block needs to be commented out with "#". And if you need to add some item, then you can copy any of these blocks and configure it accordingly.

The last macro _ref_start will make the bot approach the forge in Payon and upgrade all Rough Oridecon and Rough Elunium.

After that, the bot returns to the save point and executes the code:
Code:
do conf lockMap pay_dun01
do move pay_dun00
You can change it so that the bot goes to fight mobs in another location.


RE: GStrader for service @gstorage - Sergio - 05-05-2024

Description of the macro macro-GSbrewer-pay_arche.txt

A character of the Alchemist class is required!

The skills of Homunculi are not yet working on our server. According to the calculator at https://ratemyserver.net/brew_calc.php, it is stated that the chance of brewing is influenced by Vanilmirth's Skill. As far as I could understand, this is the skill Homun Resurrection. This point needs to be clarified according to the current server code. If possible, I will study the formula embedded in the server's source code. But at the moment, the Bioethics skill can be obtained by talking to the Alchemist at the Platinum Skills NPC in Prontera!

This script replicates the work of the macro macro-GStrader-pay_arche.txt but has 2 enhancements:

The first enhancement is in the _buy_i macro. It calls an additional macro _buy_ci. Through this, OpenKore will purchase additional items necessary for brewing potions. The presence of these items is unique to our server!

The second enhancement is that before processing Oridecon and Elunium, the bot will brew potions according to the _create_potions macro.

The macro turned out to be large but very easy to understand:

potionsFcreating.txt - This list defines the order of potion brewing! To stop the list, use the entry END!

The script will try to store Guides in an individual storage instead of gstorage.

It won't be possible to brew Embryo until I find the code for sending the packet on the OpenKore forum. When there is the opportunity and the need, I will catch the necessary packet and add the required packet code to the macro.

It should be understood that the Alchemist will only be able to buy ingredients for brewing such potions as Blue, White, Yellow, Red. All other components need to be obtained by oneself or bought from other players.


RE: GStrader for service @gstorage - nazar - 29-10-2024

можна макрос на варку блю потів?


RE: GStrader for service @gstorage - Sergio - 29-10-2024

дивися топік:

Macros available:
macro-GStrader-pay_arche.txt
macro-GSbrewer-pay_arche.txt - https://github.com/uaOpenKore/uOKfiles/blob/main/macros/GStrader/macro-GSbrewer-pay_arche.txt