How do I....?

S

Sigan

Expert Cheater
Joined
May 26, 2017
Messages
151
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:
Code:
<i>
</i>[Enable]
...
label(infPoints)
...
  cmp [infPoints],1
  jne @f
  ...
@@:
...
infPoints:
  dd 0
...
registersymbol(infPoints)
[Disable]
unregistersymbol(infPoints)
Then, separately:
Code:
<i>
</i>[Enable]
infPoints:
  dd 1
[Disable]
  dd 0
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:
Code:
<i>
</i>...
  cmp [chgWeap],1
  jne @f
  mov [eax],[var]
  chgWeap:
    dd 0
 @@:
 ...
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.
 
S

Sigan

Expert Cheater
Joined
May 26, 2017
Messages
151
Am I asking this in the wrong place, or are the serious scripters just not responding to things like this? I mean, I kinda understand... I tend to write my tables, post them, then start a different table. Just hoping to get the attention of someone that really knows what they're doing, and what I'm trying to do.

If you don't know how to help me with how to write the code, could you point me to a forum or place where I can get that help? Thank you.
 
kantoboy69

kantoboy69

Expert Cheater
Table Maker
Joined
Aug 30, 2019
Messages
90
allocate memory for your items
alloc(myitems, $100)
alloc(myselecteditem, 4)
registersymbol(myitems)
registersymbol(myselecteditem)

// assuming save a set of two items and address is 32bit

myitems:
dd 00 00 00 00 // just to initialize some part of it

myitems+0 = sword1
myitems+4 = shield 1

myitems+8 = sword2
myitems+A = shield 2

myitems+C = sword3
myitems+10 = shield 3

So on drop down just have 0, 8, c as index for set1 set2 set3
so in theory when you set it to set 2 which is 8
then fetch myitems+myselecteditem for sword 2 and myitems+myselecteditem+4 for shield 2
 
S

Sigan

Expert Cheater
Joined
May 26, 2017
Messages
151
Thanks for the response :) I appreciate that.
 
Top