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 


Cheat Engine Forum Index
PostGo back to topic
Dark Byte
Site Admin
Reputation: 458
Joined: 09 May 2003
Posts: 25296
Location: The netherlands

PostPosted: Thu Jul 08, 2010 7:02 pm    Post subject:

labels and allocs are only valid in the script they are in. More specifically, in the [enable] [disable] (or both)

So you can safely run two scripts with the same labels
As for using the template twice in the same script, ce will deal with this for you (it adds a number after the label names)

To use a label outside the scope of the current script, you must use the "registersymbol" command so that other scripts (and the rest of ce, like tables) can understand what you mean with the specific label name

As for alloc there is a special variant for this:
GlobalAlloc(name,size)

If you use GlobalAlloc it will be registered as a symbol so it's usable by the rest of CE, AND any new call to GlobalAlloc won't allocate the memory again but just gives the already allocated block(But make sure the sizes you give in all scripts are the same, a re-alloc because the size is bigger means that some of the old data will be gone)

---
Of course, most likely you'll be fine with the normal alloc in enable and dealloc in disable, there's usually not that much need for multiple scripts to allocate the same block of memory. Only useful when some scripts need to make use of the same allocated memory, and you're not sure which one will get executed first by the user
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Post reviews:   Approve 3
Author Review
justa_dude
Review: Approve
Post reference:
ReviewPosted: Wed Jul 14, 2010 8:24 pm

One of a billion examples of DB kindly taking the time to share his wisdom. Thank you, DB!
Back to top
View user's profile Send private message
Yazu™
Review: Approve
Post reference:
ReviewPosted: Sun Nov 07, 2010 11:42 am

Vuile slet.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
AylinCE
Review: Approve
Post reference:
ReviewPosted: Thu Mar 11, 2021 2:19 am

Thanks..
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display:  
Cheat Engine Forum Index


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites