Q: scanning for specific inscriptions

07/20/2022 23:31 Globi1#1
Hi
I've been reading in the forum and using some bots since like 2015.

Now I'm doing some salvage research. Therefore I need my bots to keep m4m inscriptions. Right now I'm using the public vaettir bot.

Inspired by a thread called [GWA2] ModStructs For Perfect Items by Underavelvetmoon, I collected some Mod Structs for Items with m4m and other inscriptions.

Here are the Mod Structs of the same item with the mentioned inscriptions according to GWToolbox++.
inscription+15vshexnonem4m
Mod Struct (identifier, arg1, arg2)0x27981D0C (10136 29 12)0x27981D0C (10136 29 12)0x27981D0C (10136 29 12)
 0x24B80100 (9400 1 0)0x24B80100 (9400 1 0)0x24B80100 (9400 1 0)
 0x24080139 (9224 1 57)0x24080139 (9224 1 57)0x24080139 (9224 1 57)
 0x25300272 (9520 2 114)0x25300272 (9520 2 114)0x25300272 (9520 2 114)
 0x246801E5 (9320 1 229)0x246801E5 (9320 1 229)0x246801E5 (9320 1 229)
 0x24080143 (9224 1 67)0x24080143 (9224 1 67)0x24080143 (9224 1 67)
 0x25300287 (9520 2 135)0x25300287 (9520 2 135)0x25300287 (9520 2 135)
 0x21580007 (8536 0 7)0x21580007 (8536 0 7)0x21580007 (8536 0 7)
 0x24080163 (9224 1 99) 0x2408021F (9224 2 31)
 0x253202C6 (9522 2 198) 0x2532043E (9522 4 62)
 0x2258000F (8792 0 15) 0x2608001D (9736 0 29)
 0xA7A81107 (42920 17 7)0xA7A81107 (42920 17 7)0xA7A81107 (42920 17 7)
 0xC0000000 (49152 0 0)0xC0000000 (49152 0 0)0xC0000000 (49152 0 0)

The 3 highlighted strings appear identically in every item with m4m insc I checked.

So I tried a modified CanSell():

Code:
Func CanSell($aItem)
	Local $LMODELID = DllStructGetData($aitem, "ModelId")
	Local $LRARITY = GetRarity($aitem)
	Local $ModStruct = GetModStruct($aItem)
	Local $MeasureforMeasure = StringInStr($ModStruct, "2532043E", 0, 1) ; modstruct for "measure for measure" inscription
	If $LRARITY == $RARITY_Gold Then
	   If $LMODELID == 2274 Then ; ruby maul
		  Return False
	   ElseIf $MeasureforMeasure > 0 Then ; measure for measure insc
		  Return False
	   Else
		  Return True
	   EndIf
	EndIf
    etc.
EndFunc
I tried both "2408021F" and "2532043E" but the bot always sells items with m4m inscriptions. Didn't bother with the 3rd string yet as I assume my approach is wrong.

Could anyone help me to get this modification to work please. I would like to be able to add other inscriptions like forget me not or aptitude not attitude in the future myself.

thx in advance
10/19/2022 15:14 Globi1#2
I'll answer my own question in case anyone is looking for a solution too.

The string is reversed in TB (or the other way around, dunno, I'm no data scientist).

an example:
TB: 0x 24 08 02 1F (thats measure for measure)
string a bot spits out: 1F 02 08 24

You see the pattern, just split the TB output in pairs of 2 characters and reverse the order, now they work for your bots.