Thanks Toga.
I will make your time investment appreciated by reinvesting in this community.
In ignorance and lack of under standing and knowledge, 64 bytes for newmem holds enough room for the supplied code.
I would like the script to stay in the same memory area succeeding newmem.
When no alloc for conditionals, the aob is ruined (enabling and disabling the script destroys/overwrites some bytes in the game memory).
When "newmem: ret", item usage does not decrease (good outcome).
May be this should be adjusted to affect the math in stead of ret-ing.
I will race you for the solution!
If you are available to share your screen while debugging, I would be able to watch the process and learn.
Thanks for your intent and engagement.
EDIT:
WOOHOO! I got the quantity symbol and no decrease to work together using this!
Now I will seek to cmp inf_items_type! (Still need this part in conjunction)
[ENABLE]
//66 ?? ?? ?? C3 ?? 8B ?? ?? C1 ?? ?? A8 ?? 75 ?? 88
aobscanmodule(hkItems,$process,66xxxxxxxxxx8bxxxxc1xxxxa8xx75xx88) // should be unique
alloc(newmem,64,hkItems)
alloc(inf_items_quantity,2)
label(return)
label(hkItemsbkp)
registersymbol(hkItems)
registersymbol(hkItemsbkp)
registersymbol(inf_items_quantity)
newmem:
cmp word ptr [inf_items_quantity], 0
je retReturn
mov dx, [inf_items_quantity]
hkItemsbkp:
readmem(hkItems, 5)
jmp return
hkItems:
jmp newmem
retReturn:
ret
return:
[DISABLE]
hkItems:
readmem(hkItemsbkp, 5)
unregistersymbol(*)
dealloc(*)
EDIT:
I messed up a jne/je which is why the item type compare code was not as expected.
Now, when !(selected item type), !(decrease). This is not expected behaviour.
Still tinkering...
[ENABLE]
//66 ?? ?? ?? C3 ?? 8B ?? ?? C1 ?? ?? A8 ?? 75 ?? 88
aobscanmodule(hkItems,$process,66xxxxxxxxxx8bxxxxc1xxxxa8xx75xx88) // should be unique
alloc(newmem,128,hkItems)
alloc(inf_items_type,2)
alloc(inf_items_quantity,2)
label(return)
label(hkItemsbkp)
registersymbol(hkItems)
registersymbol(hkItemsbkp)
registersymbol(inf_items_type)
registersymbol(inf_items_quantity)
newmem:
cmp byte ptr [inf_items_type], 1
je not_ammo
cmp byte ptr [inf_items_type], 2
je ammo
jmp quantity
not_ammo:
cmp [rcx+784],#2 //offset 2 is ammo
jne quantity
jmp return
ammo:
cmp [rcx+784],#2 //offset 2 is ammo
je quantity
jmp return
quantity:
cmp word ptr [inf_items_quantity], 0
je noDecrease
mov dx, [inf_items_quantity]
hkItemsbkp:
readmem(hkItems, 5)
jmp return
hkItems:
jmp newmem
noDecrease:
ret
return:
[DISABLE]
hkItems:
readmem(hkItemsbkp, 5)
unregistersymbol(*)
dealloc(*)
EDIT:
I ran a small debug check where I commented out ret in noDecrease, and the items are still not decreasing l o f l.
That ret should have been the cause of items not decreasing. I am still tinkering. Don't know what's going on yet..
Taking a detour for now. Here's current table. We're looking at "Auto Assemble script" above "No Item Usage Decrease" and "Inf Items".
.