Hi,
I dont know if this is the right place to post, ive checked the forum and havent found what i was looking for.
i have a script that i am working on for enemy health in "little witch nobeta" but i would like to know how to code an on/off variable as so to enable or disable a ohk.
i would like orignal code to activate when "off" and changed code to activate when "on". But i dont know how to create such a variable, i have seen them in other trainers.
thank you in advance
help with aa on/off varaible (dont know if this is the place to post)
-
- Expert Cheater
- Posts: 852
- Joined: Fri Oct 12, 2018 10:25 pm
- Reputation: 896
help with aa on/off varaible (dont know if this is the place to post)
[CODE=nasm]alloc(ohk,1)
registersymbol(ohk)
newmem:
cmp byte ptr [ohk],01
jne originalcode
*mov health to 0 here*
originalcode:
*whatever your code already has*[/CODE]
With that, add 'ohk' to the address list, and set to 1 to enable ohk and 0 to disable.
registersymbol(ohk)
newmem:
cmp byte ptr [ohk],01
jne originalcode
*mov health to 0 here*
originalcode:
*whatever your code already has*[/CODE]
With that, add 'ohk' to the address list, and set to 1 to enable ohk and 0 to disable.
Last edited by GreenHouse on Thu Jan 01, 1970 12:00 am, edited 1 time in total.
help with aa on/off varaible (dont know if this is the place to post)
thank you :)
[automerge]1593095925[/automerge]
i am really grateful for the code snippet above i can now switch between the 2 sections with on/off. only issue is writing the value i want for the ohk ( 0 ). with normal values im fine. but im am wondering if i could have some guidance on how to write to dwords that are using fstp and fld.
only issue i have is i cant seem to write my desired value
fstp dword ptr [edi+18] //when this is nop health wont decrease, but i can seem to set it to 0 for one hit kill
[CODE=nasm]EnemyCode:
cmp byte [ohk],1
jne EnemyOrigDamage
//OHK
fstp dword ptr [edi+18] //when this is nop health wont decrease, but i can seem to set it to 0 for one hit kill
fld dword ptr [edi+00000080]
jmp return
EnemyOrigDamage:
fstp dword ptr [edi+18]
fld dword ptr [edi+00000080]
push rax
lea rax,[edi+18]
mov [EnemyHealthAddress],rax
pop rax
jmp return[/CODE]
[automerge]1593095925[/automerge]
i am really grateful for the code snippet above i can now switch between the 2 sections with on/off. only issue is writing the value i want for the ohk ( 0 ). with normal values im fine. but im am wondering if i could have some guidance on how to write to dwords that are using fstp and fld.
only issue i have is i cant seem to write my desired value
fstp dword ptr [edi+18] //when this is nop health wont decrease, but i can seem to set it to 0 for one hit kill
[CODE=nasm]EnemyCode:
cmp byte [ohk],1
jne EnemyOrigDamage
//OHK
fstp dword ptr [edi+18] //when this is nop health wont decrease, but i can seem to set it to 0 for one hit kill
fld dword ptr [edi+00000080]
jmp return
EnemyOrigDamage:
fstp dword ptr [edi+18]
fld dword ptr [edi+00000080]
push rax
lea rax,[edi+18]
mov [EnemyHealthAddress],rax
pop rax
jmp return[/CODE]
Last edited by mflvs on Thu Jun 25, 2020 2:39 pm, edited 2 times in total.
- Dread_Pony_Roberts
- Table Makers
- Posts: 525
- Joined: Sun Dec 09, 2018 8:46 am
- Reputation: 388
help with aa on/off varaible (dont know if this is the place to post)
You can then turn the ohk address into a simple enable/disable script by writing
[CODE][ENABLE]
ohk:
db 1
[DISABLE]
ohk:
db 0[/CODE]
[CODE][ENABLE]
ohk:
db 1
[DISABLE]
ohk:
db 0[/CODE]
help with aa on/off varaible (dont know if this is the place to post)
ohhhh, that would make it easier than changing it in a dropdown box. only issue is i can seem to make the
fstp dword ptr [edi+18] hold the varaible i want. I know im missing something obvious. Which makes this way funer :D
fstp dword ptr [edi+18] hold the varaible i want. I know im missing something obvious. Which makes this way funer :D
Last edited by mflvs on Thu Jan 01, 1970 12:00 am, edited 1 time in total.
-
- Expert Cheater
- Posts: 852
- Joined: Fri Oct 12, 2018 10:25 pm
- Reputation: 896
help with aa on/off varaible (dont know if this is the place to post)
[QUOTE="mflvs, post: 140700, member: 498"]
only issue is i can seem to make the fstp dword ptr [edi+18] hold the varaible i want. I know im missing something obvious. Which makes this way funer :D
[/QUOTE]
Can't you just do a mov to edi+18? At the end of it.
[CODE=nasm]mov [edi+18],(float)0[/CODE]
only issue is i can seem to make the fstp dword ptr [edi+18] hold the varaible i want. I know im missing something obvious. Which makes this way funer :D
[/QUOTE]
Can't you just do a mov to edi+18? At the end of it.
[CODE=nasm]mov [edi+18],(float)0[/CODE]
Last edited by GreenHouse on Thu Jan 01, 1970 12:00 am, edited 2 times in total.
help with aa on/off varaible (dont know if this is the place to post)
Thank you greenhouse :) it wortked. i may of been trying too hard. i wasnt putting (float) facepalm
i love your work :D hopefully i get this working so i can update my script with ohk
i love your work :D hopefully i get this working so i can update my script with ohk
Last edited by mflvs on Thu Jan 01, 1970 12:00 am, edited 2 times in total.
Who is online
Users browsing this forum: kuromau35