How do I....?
Posted: Fri Dec 20, 2019 7:26 am
I'm trying to make a script that changes my equipped weapon upon accessing a certain address. The question I have is, how would I create something like a drop-down list, or a specific, typed-in value, that will only be injected upon the script being called?
So, an axe is equipped, but upon refreshing the screen, I want it to equip a sword. I know the IDs for both, the sword and the axe, but changing either one at the specific pointer will cause a crash. Having it change upon refresh may not. I need to create a variable that I can change and the script can then call on it.
I know how to use globalalloc() to create a variable that can be called upon to access a pointer at an offset, so that the table can give access to a pointer for manipulation directly or for troubleshooting/testing. I know how to use label() to create a variable that can be turned on or off, like:
Then, separately:
Enabling infPoints on ticking the box will allow the script to not jump to the end, and will inject my script. Prior to that, just activating the initial script will do nothing. However, with a globalalloc() at the top, I can call on the pointer in a separate line as well.
I just wish I could write in a value, then have the script check that value when it's called upon. Something like:
I know how to move a value into a variable, I just did that last part for explanation of what I'm going for, in case I haven't been clear enough. Any help is appreciated. Thank you.
So, an axe is equipped, but upon refreshing the screen, I want it to equip a sword. I know the IDs for both, the sword and the axe, but changing either one at the specific pointer will cause a crash. Having it change upon refresh may not. I need to create a variable that I can change and the script can then call on it.
I know how to use globalalloc() to create a variable that can be called upon to access a pointer at an offset, so that the table can give access to a pointer for manipulation directly or for troubleshooting/testing. I know how to use label() to create a variable that can be turned on or off, like:
Code: Select all
[Enable]
...
label(infPoints)
...
cmp [infPoints],1
jne @f
...
@@:
...
infPoints:
dd 0
...
registersymbol(infPoints)
[Disable]
unregistersymbol(infPoints)
Code: Select all
[Enable]
infPoints:
dd 1
[Disable]
dd 0
I just wish I could write in a value, then have the script check that value when it's called upon. Something like:
Code: Select all
...
cmp [chgWeap],1
jne @f
mov [eax],[var]
chgWeap:
dd 0
@@:
...