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 


[issue] [Delphi] incompatible types.
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Xanatos
I post too much
Warning
Reputation: 18

Joined: 06 May 2007
Posts: 2559
Location: US

PostPosted: Mon Aug 06, 2007 10:43 am    Post subject: Reply with quote

compactwater wrote:
It's passed as a WideString I believe, so put '1000' not 1000.
It would be the same thing.
If you can't get the variable, that means it doesn't exist, or doesn't exist yet.


That won't work Sad.

When I do that, it gets handled as a NaN which means if I were to use it for say HP, I'd get killed in one hit. (tried it too).

Also I'm pretty sure the variable exsists because I put it on a timer and completed a quest with it and got an error at the point where I should've gotten an item because I was setting it to a String. The error was "invalid input"

_________________
Back to top
View user's profile Send private message
assaf84
Expert Cheater
Reputation: 0

Joined: 03 Oct 2006
Posts: 238

PostPosted: Tue Aug 07, 2007 12:09 am    Post subject: Reply with quote

Try doing something like this:
Code:

var
temp: DWORD;
temp2: array[0..3] of byte;
begin
temp:=StrToInt(Edit1.Text);
temp2[0]:=temp mod $100;
temp2[1]:=temp div $100 mod $100;
temp2[2]:=temp div $10000 mod $100;
temp2[3]:=temp div $1000000 mod $100;
DF.setVariable('_loc2',PChar(temp2));


I'm not sure if it's ok..
Back to top
View user's profile Send private message
The Numb3r
Newbie cheater
Reputation: 0

Joined: 14 Jul 2007
Posts: 12

PostPosted: Wed Aug 08, 2007 2:51 am    Post subject: Reply with quote

Try this:

Code:
procedure TForm1.ItemTimer(Sender: TObject);
begin
try
DF.GetVariable('_loc2');
DF.SetVariable('_loc2', IntToStr(1234)); //Replace 1234 with your number
Except
end;
end;


Or if you want with edit box:

Code:
procedure TForm1.ItemTimer(Sender: TObject);
begin
try
DF.GetVariable('_loc2');
DF.SetVariable('_loc2', YourEditBox.Text);
Except
end;
end;
Back to top
View user's profile Send private message
Xanatos
I post too much
Warning
Reputation: 18

Joined: 06 May 2007
Posts: 2559
Location: US

PostPosted: Sat Aug 11, 2007 3:20 pm    Post subject: Reply with quote

The Numb3r wrote:
Try this:

Code:
procedure TForm1.ItemTimer(Sender: TObject);
begin
try
DF.GetVariable('_loc2');
DF.SetVariable('_loc2', IntToStr(1234)); //Replace 1234 with your number
Except
end;
end;


Or if you want with edit box:

Code:
procedure TForm1.ItemTimer(Sender: TObject);
begin
try
DF.GetVariable('_loc2');
DF.SetVariable('_loc2', YourEditBox.Text);
Except
end;
end;


Wouldn't work, I already know and tried those, the function won't allow an integer type, I can only use widestring. Except that doesn't do me much good when I try changing the variables (results in being handled as NaN).

So I guess the only way to solve my problem would be to find a way to change the function to accept integer type data... If thats possible.

_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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