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 


Code Not Working...

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Shapeless
How do I cheat?
Reputation: 0

Joined: 30 Jun 2013
Posts: 7

PostPosted: Tue Aug 20, 2013 6:13 pm    Post subject: Code Not Working... Reply with quote

I'm making a trainer for assaultcube because it is fairly simple.

Edit: I know I can use openProcess to open the process but how can I make sure it is open?

Edit: Made code even shorter...

Edit: Optimized code....Again...

Edit:
I remade the script using the autoAssembler function. The code now quite a bit shorter.
"Infinite ammo" and "All guns automatic" now work but using "No recoil" crashes the game.

If I manually change the instructions in the memory viewer then it does not crash.

Also how would I make the trainer wait until the game is open.

I hope somebody can help...Razz

Code:
local Hacks = {
   ["Ammo"] = {"0045b75f";"dec [esi]";"nop";"Infanite Ammo"};
   ["Recoil"] = {"ac_client.exe+5B717";"call edx";"nop";"No Recoil"};
   ["Auto"] =  {"ac_client.exe+5B6BB";"jne 0045B6C6";"jmp 0045B6C6";"All Guns Automatic"};
    ["Health"] = {"ac_client.exe+254D9";"sub [edi+04],ebx";"add [edi+04],ebx";"Invincible"};
}

function Run(a,b)
   autoAssemble(([[
      %s:
      %s
   ]]):format(a,b))
end

function getTable(Button)
         for _,n in pairs(Hacks) do
             if n[5] == Button then
                return n;
             end
         end
end

local function Changed(Sender)
    local State = checkbox_getState(Sender)
    local Hack = getTable(Sender)
    Run(Hack[1],Hack[State+2])
end

local Form = createForm(true)
local Index = 0
for o,n in pairs(Hacks) do
    n[5] = createCheckBox(Form)
    control_setPosition(n[5],0,Index*50)
    control_setCaption(n[5],n[4])
    checkbox_onChange(n[5],Changed)
    Index = Index + 1
end
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Fri Aug 23, 2013 8:07 am    Post subject: Reply with quote

onOpenProccess and the autoattach list
_________________
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
Shapeless
How do I cheat?
Reputation: 0

Joined: 30 Jun 2013
Posts: 7

PostPosted: Fri Aug 23, 2013 2:24 pm    Post subject: Reply with quote

Sooo Like this?


Code:

stringlist_add(getAutoAttachList(),"ac_client.exe")

function onOpenProcess(Id)
showMessage("Yaaay!!!")
end
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sat Aug 24, 2013 4:24 am    Post subject: Reply with quote

That should work yes
The first line registers ac_client.exe to be opened when ce sees it , and when it has been opened onOpenProcess will be called

_________________
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
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting 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