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 


Return value problem

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

Joined: 02 Jun 2011
Posts: 6
Location: Brasil

PostPosted: Sat Mar 22, 2014 1:21 pm    Post subject: Return value problem Reply with quote

Code:
60 ?? ?? 66 ?? ?? 66 ?? ?? 61 ?? ?? 60 ?? 66 ?? ?? 60 ?? ??
>
24 00 02 02 02 02 02 02 02


When I click back to the orginal value, it adds a 00 byte.

For exemple
Code:
00 60 ?? ?? 66 ?? ?? 66 ?? ?? 61 ?? ?? 60 ?? 66 ?? ?? 60 ?? ??


My script

Code:
function replaceAOB3()

  r=AOBScan("60 ?? ?? 66 ?? ?? 66 ?? ?? 61 ?? ?? 60 ?? 66 ?? ?? 60 ?? ??")


  if (r~=nil) then
    c=strings_getCount(r)
    if (c>0) then
      resultlist3=nil
      resultlist3={}
      for i=0,c-1 do
        a=strings_getString(r,i);
        resultlist3[i+1]={}
        resultlist3[i+1][1]=a
        resultlist3[i+1][2]=readBytes(a, 20, true)

for j=0,0 do
          writeBytes(tonumber("0x"..a)+j, 36)
        end
for j=1,1 do
          writeBytes(tonumber("0x"..a)+j, 0)
        end
for j=2,8 do
          writeBytes(tonumber("0x"..a)+j, 2)
        end

      end

    else
       showMessage("sorry");
    end
  else
     showMessage("sorry");
  end

end


function restoreAOB3()
  for i=1,#resultlist3 do
    local a=tonumber("0x"..resultlist3[i][1])
    local orig=resultlist3[i][2];
    for j=0,8 do
      writeBytes(a+j,orig[j])
    end
  end
end


--TRAINERGENERATORSTART--
--This is autogenerated code. Changing code in this block will
--get erased and rewritten if you regenerate the trainer code

--Uncomment the following line if this is a Cheat Table format trainer and you don't want CE to show (Tip, save as .CETRAINER alternatively)
--hideAllCEWindows()

RequiredCEVersion=6.2
if (getCEVersion==nil) or (getCEVersion()<RequiredCEVersion) then
  messageDialog('Please install Cheat Engine '..RequiredCEVersion, mtError, mbOK)
  closeCE()
end
addresslist=getAddressList()


control_setVisible(CETrainer_SEPERATOR, false)

strings_add(getAutoAttachList(), "game.exe")
gBeepOnAction=false
form_show(CETrainer)
function AboutClick()
  showMessage(gAboutText)
end
gAboutText=[[This trainer was made by Cheat Engine
cheatengine.org]]

function CloseClick()
  closeCE()
  return caFree --onClick doesn't care, but onClose would like a result
end

--TRAINERGENERATORSTOP--
Back to top
View user's profile Send private message
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Sat Mar 22, 2014 2:24 pm    Post subject: Reply with quote

Check this,
http://forum.cheatengine.org/viewtopic.php?t=571294

Suits your needs and less hassle.

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
Bruno pnt
How do I cheat?
Reputation: 0

Joined: 02 Jun 2011
Posts: 6
Location: Brasil

PostPosted: Sun Mar 23, 2014 10:48 pm    Post subject: Reply with quote

I can not excuse anymore, he did not return the first byte.
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 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