I have this script for "Borderlands 2 Third Person Mode". (I got it from Nexus mods) It works fine but I want it to be 3rd person while the key is pressed and go back to normal when the key is released.
Currently it toggles on and off. Push G, it changes to 3rd person. Push G again it goes back to normal.
Can someone please make these changes for me?
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="14">
<CheatEntries>
<CheatEntry>
<ID>3656</ID>
<Description>"Third Person Mode v3.2 (press G to toggle)"</Description>
<Options moHideChildren="1"/>
<Color>80000008</Color>
<VariableType>Auto Assembler Script</VariableType>
<AssemblerScript>[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
aobscan(thirdpersonsubAOB1,F6 81 AC 0A 00 00 14 75 ** B8)
label(thirdpersonsubAOB1_jmp)
registersymbol(thirdpersonsubAOB1_jmp)
aobscan(thirdpersonsubAOB2,55 8b ec 83 ec 14 53 56 8b f1 8b 9e 94)
label(thirdpersonsubAOB2_jmp)
registersymbol(thirdpersonsubAOB2_jmp)
globalalloc(pCamera,4)
globalalloc(bToggleKeyPressed,4)
globalalloc(bScriptEnabled,4)
globalalloc(vCameraSet,4)
globalalloc(vCamreaMode,4)
///
pCamera:
dd 0
bToggleKeyPressed:
dd 0
bScriptEnabled:
dd 0
vCameraSet:
dd 0
vCamreaMode:
dd 000C0008
///
alloc(newmem,2048) //2kb should be enough
label(returnhere)
label(originalcode)
label(exit)
label(togglescript)
label(checktoggle)
label(thirdpersonmodestart)
label(setfirstperson)
label(setthirdpsrson)
label(dochangecamera)
newmem: //this is allocated memory, you have read,write,execute access
//place your code here
cmp dword ptr [ecx+00000190],0
je originalcode
mov [pCamera],ecx
pushad
push 'G' //key G, change to 0x74 for key F5
call GetAsyncKeyState
shr ax,#15
cmp ax,1
popad
je togglescript
mov [bToggleKeyPressed],0
jmp checktoggle
togglescript:
cmp [bToggleKeyPressed],1
je originalcode
mov [bToggleKeyPressed],1
xor [bScriptEnabled],1
jmp checktoggle
checktoggle:
cmp [bScriptEnabled],1
je thirdpersonmodestart
jmp setfirstperson
thirdpersonmodestart:
pushad
push 02 //key mouse right
call GetAsyncKeyState
shr ax,#15
cmp ax,1
popad
je setfirstperson
jmp setthirdpsrson
setfirstperson:
cmp [vCameraSet],0
je dochangecamera
jmp originalcode
setthirdpsrson:
cmp [vCameraSet],1
je dochangecamera
jmp originalcode
dochangecamera:
pushad
mov esi,ecx
mov ecx,[vCameraSet]
mov ecx,[vCamreaMode+ecx*2] //get new camera value
mov byte ptr [esi+00000AAC],cl //assign new camera value
mov dword ptr [esi+00000694],0 //unknown
mov ecx,esi
mov eax,dword ptr [esi+00000190] //data
push eax
call thirdpersonsubAOB2_jmp
popad
xor [vCameraSet],1
jmp originalcode
originalcode:
test byte ptr [ecx+00000AAC],14
exit:
jmp returnhere
thirdpersonsubAOB1: //"Borderlands2.exe"+61F640:
thirdpersonsubAOB1_jmp:
jmp newmem
nop
nop
returnhere:
thirdpersonsubAOB2: //?
thirdpersonsubAOB2_jmp:
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
thirdpersonsubAOB1_jmp: //"Borderlands2.exe"+61F640:
db F6 81 AC 0A 00 00 14
//Alt: test byte ptr [ecx+00000AAC],14
thirdpersonsubAOB2_jmp: //?
//
unregistersymbol(thirdpersonsubAOB1_jmp)
unregistersymbol(thirdpersonsubAOB2_jmp)
dealloc(pCamera)
dealloc(bToggleKeyPressed)
dealloc(bScriptEnabled)
dealloc(vCameraSet)
dealloc(vCamreaMode)
</AssemblerScript>
<CheatEntries>
<CheatEntry>
<ID>3675</ID>
<Description>"First Person Value"</Description>
<ShowAsHex>1</ShowAsHex>
<Color>80000008</Color>
<VariableType>Byte</VariableType>
<Address>vCamreaMode</Address>
</CheatEntry>
<CheatEntry>
<ID>3676</ID>
<Description>"Third Person Value"</Description>
<ShowAsHex>1</ShowAsHex>
<Color>80000008</Color>
<VariableType>Byte</VariableType>
<Address>vCamreaMode+2</Address>
</CheatEntry>
<CheatEntry>
<ID>3694</ID>
<Description>"[some values]"</Description>
<Color>80000008</Color>
<GroupHeader>1</GroupHeader>
<CheatEntries>
<CheatEntry>
<ID>3657</ID>
<Description>"aac"</Description>
<ShowAsHex>1</ShowAsHex>
<Color>80000008</Color>
<VariableType>Byte</VariableType>
<Address>pCamera</Address>
<Offsets>
<Offset>AAC</Offset>
</Offsets>
</CheatEntry>
<CheatEntry>
<ID>3661</ID>
<Description>"ae0 character's"</Description>
<Color>80000008</Color>
<VariableType>Float</VariableType>
<Address>pCamera</Address>
<Offsets>
<Offset>AE0</Offset>
</Offsets>
</CheatEntry>
<CheatEntry>
<ID>3663</ID>
<Description>"ae4 character's"</Description>
<Color>80000008</Color>
<VariableType>Float</VariableType>
<Address>pCamera</Address>
<Offsets>
<Offset>AE4</Offset>
</Offsets>
</CheatEntry>
<CheatEntry>
<ID>3662</ID>
<Description>"ae8 character's"</Description>
<Color>80000008</Color>
<VariableType>Float</VariableType>
<Address>pCamera</Address>
<Offsets>
<Offset>AE8</Offset>
</Offsets>
</CheatEntry>
<CheatEntry>
<ID>3658</ID>
<Description>"af0 camera's"</Description>
<Color>80000008</Color>
<VariableType>Float</VariableType>
<Address>pCamera</Address>
<Offsets>
<Offset>AF0</Offset>
</Offsets>
</CheatEntry>
<CheatEntry>
<ID>3660</ID>
<Description>"af4 camera's"</Description>
<Color>80000008</Color>
<VariableType>Float</VariableType>
<Address>pCamera</Address>
<Offsets>
<Offset>AF4</Offset>
</Offsets>
</CheatEntry>
<CheatEntry>
<ID>3659</ID>
<Description>"af8 camera's"</Description>
<Color>80000008</Color>
<VariableType>Float</VariableType>
<Address>pCamera</Address>
<Offsets>
<Offset>AF8</Offset>
</Offsets>
</CheatEntry>
<CheatEntry>
<ID>3687</ID>
<Description>"afc aim?"</Description>
<ShowAsSigned>1</ShowAsSigned>
<Color>80000008</Color>
<VariableType>4 Bytes</VariableType>
<Address>pCamera</Address>
<Offsets>
<Offset>AFC</Offset>
</Offsets>
</CheatEntry>
<CheatEntry>
<ID>3689</ID>
<Description>"afe aim?"</Description>
<ShowAsSigned>1</ShowAsSigned>
<Color>80000008</Color>
<VariableType>2 Bytes</VariableType>
<Address>pCamera</Address>
<Offsets>
<Offset>AFE</Offset>
</Offsets>
</CheatEntry>
<CheatEntry>
<ID>3688</ID>
<Description>"b00 aim?"</Description>
<ShowAsSigned>1</ShowAsSigned>
<Color>80000008</Color>
<VariableType>4 Bytes</VariableType>
<Address>pCamera</Address>
<Offsets>
<Offset>B00</Offset>
</Offsets>
</CheatEntry>
<CheatEntry>
<ID>3690</ID>
<Description>"b02 aim?"</Description>
<ShowAsSigned>1</ShowAsSigned>
<Color>80000008</Color>
<VariableType>2 Bytes</VariableType>
<Address>pCamera</Address>
<Offsets>
<Offset>B02</Offset>
</Offsets>
</CheatEntry>
</CheatEntries>
</CheatEntry>
</CheatEntries>
</CheatEntry>
</CheatEntries>
<UserdefinedSymbols/>
</CheatTable>