Page 1 of 1

help with script lock plz

PostPosted: Tue Oct 07, 2008 4:21 pm
by troy
i made mhs table addres:
1.blood=game.exe+50
2.bloodbase=game.exe+60

q:how to script to make on hotkey pressing so blood=bloodbase in table?
give exmple plz.thx . sorry bad english

PostPosted: Tue Oct 07, 2008 9:19 pm
by L. Spiro
It is not necessary to make a script to lock these.

Just add both addresses to the list such that one is A and one is B, then make 2 Hotkeys such that Hotkey0 locks A and unlocks B, and Hotkey1 unlocks A and locks B.


L. Spiro

PostPosted: Wed Oct 08, 2008 1:33 am
by WhiteHat
Maybe, this is what he wants (?):

Code: Select all
VOID Lock ( MHS_ADDRESS aAddress, INT iItemSize )
{
   extern DWORD e_dBlood     = { "", aAddress };       // Blood = game.exe+0x50
   extern DWORD e_dBloodBase = { "", aAddress+0x10 };  // BloodBase = game.exe+0x60
   
   if ( e_dBlood < e_dBloodBase ){
      e_dBlood = e_dBloodBase;
   }
}


CMIIW on script errors...

PostPosted: Wed Oct 08, 2008 12:22 pm
by L. Spiro
Most likely that is what he wants. I am jetlagged.


L. Spiro

PostPosted: Wed Oct 15, 2008 8:20 pm
by troy
yes the script i wants.my thanks you!
questions done

Re: help with script lock plz

PostPosted: Wed Jan 20, 2010 2:05 pm
by radical dreamer
I've never used the script function before now, and I was having difficulty understanding how to use this information for my particular situation, and WhiteHat gave me this solution:

VOID Lock ( MHS_ADDRESS aAddress, INT iItemSize )
{
extern SHORT MMHPos = { "", aAddress }; // MMHPos = zsnesw.exe+0x32BE45
extern SHORT CycleHPos = { "", aAddress + 0x2F0 }; // CycleHPos = zsnesw.exe+0x32C135

MMHPos = CycleHPos; // Directly Lock MMHPos to CycleHPos
}

With this, I now understand how it is supposed to work, but it is not working for me. I may be doing something wrong, here's what I'm doing:

Right click on my MMHPos code, hit "Modify Selected".
Then I go to the Script Lock tab, and I paste that script in there, and press "OK".
The script doesn't give me a compile error. So I look at my addresses in MHS, and compare the two. CycleHPos should be copying the value of MMHPos to itself, but it isn't.

Am I missing a step?

Re: help with script lock plz

PostPosted: Wed Jan 20, 2010 5:15 pm
by L. Spiro
CycleHPos is not copying MMHPos. MMHPos is copying CycleHPos.

And you need to activate the script lock when you close the dialog.


L. Spiro

Re: help with script lock plz

PostPosted: Wed Jan 20, 2010 5:38 pm
by radical dreamer
Oh ok I see, need to switch it around CycleHPos = MMHPos.

In any case, I'm unsure on how to activate the script lock. If you mean to check the box "use script to apply lock", then I have done that, and it doesn't activate.

*EDIT*
Wait, it's working now. I think flipping those two around did the trick. :-)
Thank you both!