Howto Catch the ITEM NAME from EQ Item LINK

Third party software discussion goes here.
User avatar
moguay
Posts: 170

Howto Catch the ITEM NAME from EQ Item LINK

Post#1 » Sat Jan 02, 2016 2:33 pm

In EQ, the items link is coded with this data structure : 0048DA0000....0000C9151EB8Magic Red Ornament"

To catch the Name we can grab the link with macro event and make some String manipulation.
below the solution for make that :

Code: Select all

/varset ItemName ${ItemName.Right[${Math.Calc[${ItemName.Length} - 51]}].Left[-1]}


If you implement a finditem function in your macro, you can make some search or manipulation directly from the item EQ Link

Below my FindItem function which uses this tips, (need to be adapted for you) :

Code: Select all

Sub command-finditem
    /if (${Netbots[${MasterName}].ID}) {
        /declare bct_command string local bct ${MasterName}
    } else {
        /declare bct_command string local bcaa
    }
    /varset CommandParam ${CommandParam.Right[${Math.Calc[${CommandParam.Length} - 51]}].Left[-1]}
   
    /if (${Find}) {
            /docommand /${bct_command} //docommand /${echo} -Total Qty: ${Cr}${Int[${Find.Name[${CommandParam}]}]}${Cx} - ${Ct}${Me.CleanName}${Cx} - ${Cg}${CommandParam}${Cx}
    } else {
        /if (${FindItemCount[${CommandParam}]} || ${FindItemBankCount[${CommandParam}]}) {
            /docommand /${bct_command} [+${Notice}+]Notice[+x+]: "Item found <${CommandParam}> Total([+r+]${Int[${Math.Calc[${FindItemCount[${CommandParam}]}+${FindItemBankCount[${CommandParam}]}]}]}[+x+]) in Bag(${If[${ChatIn.Equal[bct]} && ${FindItemCount[${CommandParam}]},[+g+],]}${FindItemCount[${CommandParam}]}[+x+]), in Bank(${If[${ChatIn.Equal[bct]} && ${FindItemBankCount[${CommandParam}]},[+g+],]}${FindItemBankCount[${CommandParam}]}[+x+])"
        } else {
            /docommand /${bct_command} [+${Warning}+]Warning[+x+]: "Item containing the name <${CommandParam}>" not found
        }
    }
/return


Below the 2 captures (the command and the result)
Attachments
FindItem_From_Link.jpg
FindItem_From_Link.jpg (23.88 KiB) Viewed 1388 times
FindItem_From_Link_Result.jpg
FindItem_From_Link_Result.jpg (21.03 KiB) Viewed 1388 times

User avatar
moguay
Posts: 170

Re: Howto Catch the ITEM NAME from EQ Item LINK

Post#2 » Thu Jan 14, 2016 9:08 pm

To help, i quickly make a alias for global finditem, fully compatible with Item EQ link

in order to make it compatible and usable to all macroquest users who have not necessarily made macro.

For use it, paste this in EQ
And launch with: /finditem Orb of the Crimson Bull

Code: Select all

/noparse /alias /finditem /multiline @ /echo [Finditem] @ /timed 2 /multiline ; /if (${stritem.Find[000]}) /varset stritem ${stritem.Right[${Math.Calc[${stritem.Length} - 51]}].Left[-1]}; /bcaa //if (${stritem.Length}) /bc in Bag([+r+]${FindItemCount[${stritem}]}[+x+]), in Bank([+r+]${FindItemBankCount[${stritem}]}[+x+]); /bcaa //varset stritem @ /bcaa //multiline ; /if (!${Defined[stritem]}) /declare stritem string global ; /varset stritem

small explication of this mico code,
- this alias make a global var and capture, parse the parameter behind your command
- launch 2 milliseconds after the return of this var analysis on all bots
the trick, the beauty of this command is to have thought to capture the parameter to the end, so it is pushed on the variable itself
look at why I set the timer before and the statement at the very end (/declare stritem string global ; /varset stritem)

Other Tips for /noparse user
it is possible to help for data exchange and command to use a escape character which works as /noparse with the advantage of operating on a specific part

if you made for exemple this command, TankName and FindItem is analysis on your caster

Code: Select all

/bct ${TankName} //casting "${FindItem[=Lucid Gauntlets of View].Name}" item
so if you add "\", FindItem is analysis on your alt Tank

Code: Select all

/bct ${TankName} //casting "$\{FindItem[=Lucid Gauntlets of View].Name}" item


Other Tips for var declare
global, Variables of global scope ALWAYS exist until they are deleted or macroquest ends
outer, Variables of outer scope exist while a macro is running
local (default), Variables of local scope only exist while within a macro function or "Sub"

For the latter, I have managed to make a amazing feat in Everquest to maintain timer even after a crash, deco ...
Like so that I am able to manage the extremely long timer even after reboot machines.
A big thank you to Ryanosky for allowing me to imagine such a trick, and server for all her wonderful crash in raid
So to put it simply, I create as variables and permanant timer.

User avatar
moguay
Posts: 170

Re: Howto Catch the ITEM NAME from EQ Item LINK

Post#3 » Sun May 15, 2016 7:37 pm

A small preview of the new feature of finditem function,
- ordered by name
- total sum
- background data exchange between bots (no spam in EQBCS, stat for optimise help to optimise code)
- can be use on global macro for advanced use
Analysis items in inventory, bank and forged
Compete search, partial and by item type (see the second screen)

Macro Code Preview

Code: Select all

Sub command-DataFindItemResult
    | Item Name Var
    /if (${CommandParam.Find[000]}) /varset CommandParam ${CommandParam.Right[${Math.Calc[${CommandParam.Length} - 51]}].Left[-1]}
    /declare ItemName string local ${CommandParam.Arg[1,|]}
   
    /if (${DataFindItem.Equal[CLEAR]}) {
        | Clear DataFindItem
        /netdata ${DataFindItem}=
    } else {
        | Send to NetBot Data Exchange an INIT value
        /netdata ${DataFindItem}=INIT
        /delay 5 (${NetBots[${Me.CleanName}].Data[${DataFindItem}].Equal[INIT]})
       
        | Send to NetBot Data Exchange the ItemName and Quantity
        /netdata ${DataFindItem}=${CommandParam.Arg[1,|].Replace[ ,_]}/${Find.Name[${ItemName}]}
        /delay 5 (${NetBots[${Me.CleanName}].Data[${DataFindItem}].NotEqual[INIT]})
    }

/return

Sub command-finditem
    | Item Name Var
    /if (${CommandParam.Find[000]}) {
        /declare ItemName string local ${CommandParam.Arg[1,|].Right[${Math.Calc[${CommandParam.Length} - 51]}].Left[-1]}
    } else {
        /declare ItemName string local ${CommandParam.Arg[1,|]}
    }
   
    | auto bctcmd for old request
    /declare bct_command string local bcaa
    /if (${Netbots[${MasterName}].ID}) /varset bct_command bct ${MasterName}
   
    | NetNote AttackID exchange
    /if (!${Select[${NetBots[${Me.CleanName}].Data[${DataFindItem}]},NULL]} && ${Find}) {

        /call FindItem ${CommandParam}
       
    } else /if (${Find}) {
        /docommand /${bct_command} //docommand /${echo} -Total Qty: ${Cr}${Int[${Find.Name[${ItemName}]}]}${Cx} - ${Ct}${Me.CleanName}${Cx} - ${Cg}${ItemName}${Cx}
    } else {
        /if (${FindItemCount[${ItemName}]} || ${FindItemBankCount[${ItemName}]}) {
            /docommand /${bct_command} [+${Notice}+]Notice[+x+]: "Item found <${ItemName}> Total([+r+]${Int[${Math.Calc[${FindItemCount[${ItemName}]}+${FindItemBankCount[${ItemName}]}]}]}[+x+]) in Bag(${If[${ChatIn.Equal[bct]} && ${FindItemCount[${ItemName}]},[+g+],]}${FindItemCount[${ItemName}]}[+x+]), in Bank(${If[${ChatIn.Equal[bct]} && ${FindItemBankCount[${ItemName}]},[+g+],]}${FindItemBankCount[${ItemName}]}[+x+])"
        } else {
            /docommand /${bct_command} [+${Warning}+]Warning[+x+]: "Item containing the name <${ItemName}>" not found
        }
    }
   
/return

Sub FindItem
    | Item Name Var
    /if (${CommandParam.Find[000]}) {
        /declare ItemName string local ${CommandParam.Arg[1,|].Right[${Math.Calc[${CommandParam.Length} - 51]}].Left[-1]}
    } else {
        /declare ItemName string local ${CommandParam.Arg[1,|]}
    }
    | FindItem Mode
    /declare ItemMode string local ${CommandParam.Arg[2,|]}

    | Function Var
    /declare i int local
    /declare TimerTimeout timer local 5s
    /declare ItemTotal int local 0
    /declare ItemCompar int local 0
    | Statistic Timer
    /declare Timertest timer local 5m
   
    | bots call Data exchange by event
    /bca DataFindItemResult ${ItemName}
    | self call Data exchange by function
    /call command-DataFindItemResult
   
    /for i 1 to ${Math.Calc[${NetBots.Client.Count[ ]}+1]}
        :waitingDataFind
        /if (${TimerTimeout}) {
            | Waiting all netbot data return Value
            /if (${NetBots[${NetBots[${NetBots.Client.Arg[${i}]}].Name}].Data[${DataFindItem}].Arg[1,/].Replace[_, ].NotEqual[${ItemName}]} || ${NetBots[${NetBots[${NetBots.Client.Arg[${i}]}].Name}].Data[${DataFindItem}].Equal[INIT]}) {
                /delay 1
                /goto :waitingDataFind
            } else {
                /if (${i} == 1) /varset ItemCompar ${Int[${NetBots[${NetBots[${NetBots.Client.Arg[${i}]}].Name}].Data[${DataFindItem}].Arg[2,/]}]}
               
                /if (!${ItemMode.Length} || ${ItemMode.Equal[NULL]}) {
                    | Local Prompt by toons
                    /docommand /${echo} -Qty: ${Cr}${Int[${NetBots[${NetBots[${NetBots.Client.Arg[${i}]}].Name}].Data[${DataFindItem}].Arg[2,/]}]}${Cx} - ${Ct}${NetBots[${NetBots.Client.Arg[${i}]}].Name}${Cx} - ${Cg}${ItemName}${Cx} - (stat:${Cg}${Math.Calc[(3000-${Timertest})/10]}${Cx}s)
                } else /if (${ItemMode.Find[LOWER]} && ${ItemCompar} > ${Int[${NetBots[${NetBots[${NetBots.Client.Arg[${i}]}].Name}].Data[${DataFindItem}].Arg[2,/]}]}) {
                    | Catch the minimum Qty on all toons
                    /varset ItemCompar ${Int[${NetBots[${NetBots[${NetBots.Client.Arg[${i}]}].Name}].Data[${DataFindItem}].Arg[2,/]}]}
                } else /if (${ItemMode.Find[UPPER]} && ${ItemCompar} < ${Int[${NetBots[${NetBots[${NetBots.Client.Arg[${i}]}].Name}].Data[${DataFindItem}].Arg[2,/]}]}) {
                    | Catch the maximum Qty on all toons
                    /varset ItemCompar ${Int[${NetBots[${NetBots[${NetBots.Client.Arg[${i}]}].Name}].Data[${DataFindItem}].Arg[2,/]}]}
                }
                | Total Calculation
                /varcalc ItemTotal ${ItemTotal} + ${Int[${NetBots[${NetBots[${NetBots.Client.Arg[${i}]}].Name}].Data[${DataFindItem}].Arg[2,/]}]}
               
            }
        }
    /next i
   
    /if (!${ItemMode.Length} || ${ItemMode.Equal[NULL]}) {
        | Local Prompt Total
        /docommand /${echo} -Total Qty: ${Cr}${Int[${ItemTotal}]}${Cx} - ${Cr}ALL${Cx} - ${Cg}${ItemName}${Cx} - (stat:${Cg}${Math.Calc[(3000-${Timertest})/10]}${Cx}s)
    }
   
    | bots call Data exchange Clear
    /bca DataFindItemResult CLEAR
    | self call Data exchange Clear
    /call command-DataFindItemResult CLEAR
   
    /if (${ItemMode.Find[LOWER]} || ${ItemMode.Find[UPPER]}) /return ${ItemCompar}

/return ${Int[${ItemTotal}]}

EQBCS Terminal Preview

Code: Select all

[Guismo] to [Guismo]: finditem 000A70000000000000000000000000000000000000AA4EBA09Lillu's Magical Distiller
<Guismo>  [*ALL*] DataFindItemResult Lillu's Magical Distiller
<Guismo>  [*ALL*] DataFindItemResult CLEAR
Attachments
NewFindItem.jpg
NewFindItem.jpg (227.02 KiB) Viewed 1276 times

Return to “Third party software”

Who is online

Users browsing this forum: No registered users and 1 guest

cron