Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Is this a good example?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Gwinx
Advanced Cheater
Reputation: 0

Joined: 30 Jul 2010
Posts: 65

PostPosted: Tue Jul 05, 2011 3:50 pm    Post subject: Is this a good example? Reply with quote

Did I do everything correctly?

Code:

[Enable]
Alloc(SpendMoney,250)
Alloc(MyMoney,10)
Alloc(BorrowAmount,10)
Alloc(HamburgerPrice,10)
Alloc(HotDogPrice,10)
Alloc(SodaPrice,10)
Alloc(NoMoreMoney,10)
Alloc(BorrowMoney,25)
RegisterSymbol(BorrowAmount)
RegisterSymbol(MyMoney)
RegisterSymbol(HamburgerPrice)
RegisterSymbol(HotDogPrice)
RegisterSymbol(SodaPrice)
Label(GoRet)

MyMoney:
/* Your Money */
dd #015

BorrowAmount:
/* Borrow How Much */
dd #030

HamburgerPrice:
/* Price for a Hamburger */
dd #005
HotDogPrice:
/* Price for a Hot Dog */
dd #003
/* Price for a Soda */
SodaPrice:
dd #001

00123ABC:
Jmp SpendMoney

GoRet:

SpendMoney:
Mov [ESI],HamburgerPrice /* Order a Hamburger */
Mov [ESI],HamburgerPrice /* Order another Hamburger */
Mov [ESI],HotDogPrice /* Order a HotDog */
Mov [ESI],SodaPrice /* Order a Soda*/
Sub [MyMoney],ESI /* Spend Money */
Cmp Dword PTR [ESI],MyMoney /* Compare the total price with the amount of money you have */
JBE NoMoreMoney /* If you have 0 money or less than the total price you go borrow some money */
JL GoRet /* But if you have enough to pay go to ret */

NoMoreMoney:
Jmp BorrowMoney

BorrowMoney:
Add [MyMoney],BorrowAmount /* Add more money ( + BorrowAmount )*/
Jmp GoRet

[Disable]
00123ABC:
db 0F 84

Dealloc(SpendMoney)
Dealloc(MyMoney)
Dealloc(BorrowAmount)
Dealloc(HamburgerPrice)
Dealloc(HotDogPrice)
Dealloc(SodaPrice)
Dealloc(NoMoreMoney)
Dealloc(BorrowMoney)
UnregisterSymbol(BorrowAmount)
UnregisterSymbol(MyMoney)
UnregisterSymbol(HamburgerPrice)
UnregisterSymbol(SodaPrice)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 474

Joined: 09 May 2003
Posts: 25932
Location: The netherlands

PostPosted: Tue Jul 05, 2011 5:44 pm    Post subject: Reply with quote

not really sure and not much time right now, but from a quick view:
Code:

Mov [ESI],HamburgerPrice /* Order a Hamburger */
Mov [ESI],HamburgerPrice /* Order another Hamburger */
Mov [ESI],HotDogPrice /* Order a HotDog */
Mov [ESI],SodaPrice /* Order a Soda*/

that will always set the value at [ESI] to the sodaprice

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Gwinx
Advanced Cheater
Reputation: 0

Joined: 30 Jul 2010
Posts: 65

PostPosted: Tue Jul 05, 2011 6:03 pm    Post subject: Reply with quote

Darn it, how do I fix that then?

Like this?
Code:

Add [ESI],HamburgerPrice /* Order a Hamburger */
Add [ESI],HamburgerPrice /* Order another Hamburger */
Add [ESI],HotDogPrice /* Order a HotDog */
Add [ESI],SodaPrice /* Order a Soda*/
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites