 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
LolSalad Grandmaster Cheater
Reputation: 1
Joined: 26 Aug 2007 Posts: 988 Location: Australia
|
Posted: Sun Sep 30, 2007 1:17 am Post subject: [Help] [Delphi] GetVariable error |
|
|
In my flash trainer made in Delphi, I'm trying to put a GetVariable on a timer so that it constantly gets a variable and puts it into an edit box. Then, another timer reads from the edit box and runs something if the text is '999999999'.
Thing is, when the variable doesn't exist, I instantly get an error. I need it to do nothing if the variable doesn't exist. However, I have no idea how to do this. Help please?
I tried 'try' and 'except', but I still get the same error on the same line.
Here's the code:
| Code: | procedure TTrainer.GetVarTimer(Sender: TObject);
var exp2lvl : string;
var maxhp : string;
begin
try
begin
exp2lvl := Game.GetVariable('_level0.questreward.intExpToLevel');
maxhp := Game.GetVariable('_level0.character.origStats.intMaxHP');
VarExport1.Text := exp2lvl;
VarExport2.Text := maxhp;
end;
except
on E : Exception do
begin
VarExport1.Text := 'Unavailable';
VarExport2.Text := 'Unavailable';
end;
end;
end;
|
_________________
|
|
| Back to top |
|
 |
compactwater I post too much
Reputation: 8
Joined: 02 Aug 2006 Posts: 3923
|
Posted: Sun Sep 30, 2007 1:55 am Post subject: |
|
|
Try | Code: | | MessageBox(Self.Handle, PChar(String(error.Message)), PChar(String(error.ClassName)), MB_OK); | instead.
|
|
| Back to top |
|
 |
|
|
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
|
|