| View previous topic :: View next topic |
| Author |
Message |
Xanatos I post too much
Reputation: 18
Joined: 06 May 2007 Posts: 2559 Location: US
|
Posted: Mon Aug 06, 2007 10:43 am Post subject: |
|
|
| 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 .
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 |
|
 |
assaf84 Expert Cheater
Reputation: 0
Joined: 03 Oct 2006 Posts: 238
|
Posted: Tue Aug 07, 2007 12:09 am Post subject: |
|
|
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 |
|
 |
The Numb3r Newbie cheater
Reputation: 0
Joined: 14 Jul 2007 Posts: 12
|
Posted: Wed Aug 08, 2007 2:51 am Post subject: |
|
|
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 |
|
 |
Xanatos I post too much
Reputation: 18
Joined: 06 May 2007 Posts: 2559 Location: US
|
Posted: Sat Aug 11, 2007 3:20 pm Post subject: |
|
|
| 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 |
|
 |
|