kay0 wrote: ↑Sat Apr 20, 2019 11:55 pm
ospider wrote: ↑Sun Nov 25, 2018 1:02 am
Thanks so much for the great table
I have a question
Is there a way to make the walk key toggleable (As in pressing CapsLock once to always walk, press again to disable)?
YES PLEASE!
The game doesn't have to option to toggle walk so it would be awesome if you/anyone could help us make the walk key toggleable.
copy and paste the following "codes" ONto your table, i.e.,
1. SELECT ALL the codes below, press Ctrl-C
2. on the table, activate
enable, highlight
walk key (click on that line once).
3. press Ctrl-V. you should see
walk key .2 script appear below
walk key script.
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<CheatTable>
<CheatEntries>
<CheatEntry>
<ID>12573</ID>
<Description>"walk key .2"</Description>
<Options moHideChildren="1"/>
<LastState Activated="1"/>
<Color>FF0000</Color>
<VariableType>Auto Assembler Script</VariableType>
<AssemblerScript>[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
aobscanmodule(runSpeedCalOnRunAOB,SOTTR.exe,F3 0F 58 ** ** 41 0F 2F C8 F3 0F 11 ** ** 76 ** C7 ** ** ** ** ** ** 48)
registersymbol(runSpeedCalOnRunAOB)
label(bWalkKeyMethod)
registersymbol(bWalkKeyMethod)
label(bWalkKeyPressed)
registersymbol(bWalkKeyPressed)
label(bWalkKeyID)
registersymbol(bWalkKeyID)
label(dCustMaxSpeed)
registersymbol(dCustMaxSpeed)
alloc(newmem,2048,runSpeedCalOnRunAOB+5)
label(returnhere)
label(originalcode_walkkey)
registersymbol(originalcode_walkkey)
label(exit)
newmem: //this is allocated memory, you have read,write,execute access
//place your code here
mov rdx,bWalkKeyMethod
cmp byte ptr [rdx],1
lea rdx,[rdx+4]
jne movemaxspeedmanipulate
cmp byte ptr [rdx],1
jne walkkeynotpressing
cmp byte ptr [rdx+1],1
je toggleend
mov byte ptr [rdx+1],1
xor byte ptr [rdx+2],1
jmp toggleend
walkkeynotpressing:
cmp byte ptr [rdx+1],0
je toggleend
mov byte ptr [rdx+1],0
toggleend:
lea rdx,[rdx+2]
movemaxspeedmanipulate:
cmp byte ptr [rdx],1
jne end
mov rdx,dCustMaxSpeed
movss xmm8,[rdx]
end:
originalcode_walkkey:
readmem(runSpeedCalOnRunAOB+5,9)
//comiss xmm1,xmm8
//movss [rdi+1C],xmm1
exit:
jmp returnhere
///
bWalkKeyMethod:
dd 0 //0: hold, 1: toggle
bWalkKeyPressed:
dd 0
bWalkKeyID:
dd 12 //Alt key
dCustMaxSpeed:
dd (float)0.64
///
runSpeedCalOnRunAOB+5:
jmp newmem
nop
nop
nop
nop
returnhere:
///****************************************///
alloc(newmem2,2048,runSpeedCalOnRunAOB+10)
label(returnhere2)
label(originalcode2_walkkey)
registersymbol(originalcode2_walkkey)
label(exit2)
newmem2: //this is allocated memory, you have read,write,execute access
//place your code here
db F3 44 0F 11
readmem(runSpeedCalOnRunAOB+11,2)
//movss [rdi+1c],xmm8
jmp exit2
originalcode2_walkkey:
readmem(runSpeedCalOnRunAOB+10,7)
//mov [rdi+1C],3F800000
exit2:
jmp returnhere2
///
runSpeedCalOnRunAOB+10:
jmp newmem2
nop
nop
returnhere2:
///****************************************///
label(bEndThread_walkKeylistener_mem)
registersymbol(bEndThread_walkKeylistener_mem)
alloc(walkKeylistener_mem,2048,"SOTTR.exe")
registersymbol(walkKeylistener_mem)
createthread(walkKeylistener_mem)
label(keylistenerstart)
label(keylistenerend)
label(keylistenerexit)
walkKeylistener_mem:
sub rsp,28
push rax
keylistenerstart:
mov rcx,bWalkKeyID
movzx rcx,byte ptr [rcx]
//mov rcx,14 //CAPS LOCK key //12 //ALT key
push rcx
call GetAsyncKeyState
add rsp,08
shr ax,#15
mov rcx,bWalkKeyPressed
mov [rcx],al
keylistenerend:
mov rcx,#100
call Sleep
cmp dword ptr [bEndThread_walkKeylistener_mem],1
jne keylistenerstart
keylistenerexit:
pop rax
add rsp,28
mov dword ptr [bEndThread_walkKeylistener_mem],2
ret
///
bEndThread_walkKeylistener_mem:
dd 0
///
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
//obtained from SubBeam's ACS script - start//
{$lua}
if( syntaxcheck == false ) then --actual execution
local starttime = getTickCount()
if readInteger( "bEndThread_walkKeylistener_mem" ) == 0 then --could be 2 already
writeInteger( "bEndThread_walkKeylistener_mem", 1 ) --tell the thread to kill itself
end
while( getTickCount() < starttime + 1000 ) and ( readInteger( "bEndThread_walkKeylistener_mem" ) ~=2 ) do --wait till it has finished
sleep( 20 )
end
if( getTickCount() > starttime + 1000 ) then --could happen when the window is shown
showMessage( 'Disabling the thread failed!' )
error( 'Thread disabling failed!' )
end
sleep( 1 )
end
{$asm}
//obtained from SubBeam's ACS script - end//
//bEndThread_walkKeylistener_mem:
//dd 1
///****************************************///
dealloc(newmem)
runSpeedCalOnRunAOB+5:
readmem(originalcode_walkkey,9)
//db 41 0F 2F C8 F3 0F 11 4F 1C
//Alt: comiss xmm1,xmm8
//Alt: movss [rdi+1C],xmm1
unregistersymbol(originalcode_walkkey)
unregistersymbol(bWalkKeyMethod)
unregistersymbol(bWalkKeyPressed)
unregistersymbol(bWalkKeyID)
unregistersymbol(dCustMaxSpeed)
///****************************************///
dealloc(newmem2)
runSpeedCalOnRunAOB+10:
readmem(originalcode2_walkkey,7)
//db C7 47 1C 00 00 80 3F
//Alt: mov [rdi+1C],3F800000
unregistersymbol(originalcode2_walkkey)
///****************************************///
unregistersymbol(bEndThread_walkKeylistener_mem)
dealloc(walkKeylistener_mem)
unregistersymbol(walkKeylistener_mem)
</AssemblerScript>
<CheatEntries>
<CheatEntry>
<ID>15979</ID>
<Description>"status"</Description>
<DropDownList ReadOnly="1" DescriptionOnly="1" DisplayValueAsItem="1">0:hold key
1:toggle key
</DropDownList>
<LastState Value="1" RealAddress="1527B0081"/>
<Color>008000</Color>
<VariableType>Byte</VariableType>
<Address>bWalkKeyMethod</Address>
</CheatEntry>
<CheatEntry>
<ID>12575</ID>
<Description>"key"</Description>
<DropDownList DescriptionOnly="1" DisplayValueAsItem="1">10:SHIFT key
11:CTRL key
12:ALT key
14:CAPS LOCK key
</DropDownList>
<LastState Value="14" RealAddress="1527B0089"/>
<ShowAsHex>1</ShowAsHex>
<Color>008000</Color>
<VariableType>Byte</VariableType>
<Address>bWalkKeyID</Address>
</CheatEntry>
<CheatEntry>
<ID>12576</ID>
<Description>"speed"</Description>
<LastState Value="0.6399999857" RealAddress="1527B008D"/>
<Color>008000</Color>
<VariableType>Float</VariableType>
<Address>dCustMaxSpeed</Address>
</CheatEntry>
</CheatEntries>
</CheatEntry>
</CheatEntries>
</CheatTable>
what's new with the script is it has an entry
status added that allows you to choose if you want to "hold key" to walk or a "toggle key" to walk.
as I just added the new "function" to the injected cave, rather than the thread for key-listener, in theory you can only toggle between walk and normal
while you are moving the character. i.e., most likely you can't toggle between walk and normal when standing still.
also, note that I didn't test it actually, I've just made the changes without actually testing it in-game. so, report~
if it has no problem after you test run it, you can freely delete the original
walk key script then. remember to save the table afterwards~