help with aa on/off varaible (dont know if this is the place to post)

Post your topics and discussions here that you can't find a good section for.
Post Reply
mflvs
Expert Cheater
Expert Cheater
Posts: 65
Joined: Fri Mar 03, 2017 8:55 pm
Reputation: 5

help with aa on/off varaible (dont know if this is the place to post)

Post by mflvs »

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

GreenHouse
Expert Cheater
Expert Cheater
Posts: 857
Joined: Fri Oct 12, 2018 10:25 pm
Reputation: 889

help with aa on/off varaible (dont know if this is the place to post)

Post by GreenHouse »

[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.
Last edited by GreenHouse on Thu Jan 01, 1970 12:00 am, edited 1 time in total.

mflvs
Expert Cheater
Expert Cheater
Posts: 65
Joined: Fri Mar 03, 2017 8:55 pm
Reputation: 5

help with aa on/off varaible (dont know if this is the place to post)

Post by mflvs »

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]
Last edited by mflvs on Thu Jun 25, 2020 2:39 pm, edited 2 times in total.

User avatar
Dread_Pony_Roberts
Table Makers
Table Makers
Posts: 521
Joined: Sun Dec 09, 2018 8:46 am
Reputation: 385

help with aa on/off varaible (dont know if this is the place to post)

Post by Dread_Pony_Roberts »

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]

mflvs
Expert Cheater
Expert Cheater
Posts: 65
Joined: Fri Mar 03, 2017 8:55 pm
Reputation: 5

help with aa on/off varaible (dont know if this is the place to post)

Post by mflvs »

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
Last edited by mflvs on Thu Jan 01, 1970 12:00 am, edited 1 time in total.

GreenHouse
Expert Cheater
Expert Cheater
Posts: 857
Joined: Fri Oct 12, 2018 10:25 pm
Reputation: 889

help with aa on/off varaible (dont know if this is the place to post)

Post by GreenHouse »

[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]
Last edited by GreenHouse on Thu Jan 01, 1970 12:00 am, edited 2 times in total.

mflvs
Expert Cheater
Expert Cheater
Posts: 65
Joined: Fri Mar 03, 2017 8:55 pm
Reputation: 5

help with aa on/off varaible (dont know if this is the place to post)

Post by mflvs »

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
Last edited by mflvs on Thu Jan 01, 1970 12:00 am, edited 2 times in total.

Post Reply

Who is online

Users browsing this forum: No registered users